Welcome, Guest. [ Log In ]
Question   Common values needed in CGIs.
Search KBase

Related Links:
· Where is....?

Top 5 in this Area:
1. How can people subscribe to my mailing list?
2. Do you have this perl module installed on your servers?
3. What's the difference between PHP-CGI and PHP as an Apache module?
4. PHP Security
5. How do I dump data into MySQL?

Common values needed in CGIs.
Many CGIs and Perl scripts require different utilities to function. For example, a guestbook may want the path to the Unix/Linux 'date' program, whereas another may want to know what the root of your account is. Here are some values that you may find useful and/or necessary in order to work.


The sendmail executable can be found at the following path:



The date executable can be found at the following path:


Perl Interpreter

The Perl interpreter, needed at the beginning of your Perl scripts, can be found at either of the following two paths:



You can find Python here:


Root Directory

The root directory of your account can be found at the following path, substituting 'username' with your username.


Root Directory Of Web Site

The root directory of your web site is usually stored within the root directory of your account, and is almost always named the same thing as the domain or subdomain it is hosted under (ie. 'mydomain.com' or 'subdomain.domain.com'). For example:


This is also the path of the directory in which you should place your files for any given site.


Dreamhost does not use a standard CGI-BIN, but rather allows you to place executable scripts anywhere within your account and achieve the same functionality. Simply create a directory somewhere within your account and put your scripts there, then use the 'pwd' command while within that directory to get its pathname. This is what you would use within your script's configuration when asked for a path to the CGI-BIN.

Error Logs

A potentially useful way to find out why your script isn't working is by looking in your site's "error log". This is located inside your home directory in the following directory:
By looking at the last line of the error log you may get an idea why your script is giving an Internal Server error..

Last updated: Jul 16, 2003.

User Post (2002-10-20 14:25:12 by josh)
Hey Vincentc

You can turn on telnet (or hopefully SSH) access for your user through the users > users area of our web panel.. just click on edit for that user and make sure "Shell access" is checked off!
User Post (2001-07-13 14:54:09 by josh)
For you Toxik,
Displaying the Working Directory:
To display the current working directory, issue the 'pwd' command. The 'pwd' command requires no options or arguments.<pre>
root@desktop:/root# pwd
The 'pwd' command displays the absolute pathname of the working directory.
User Post (2003-03-21 22:25:49 by liquid95)
thank tyou-thank you thank you a million times!!! i have been seeing that ".abcdufd" crap in every script that i put in and people kept calling them excellent scripts yet i could never get them to work
User Post (2002-10-25 01:38:21 by vincentc)
Thanks. For the tip, Josh. The guestbook script is now working! It was all about changing the user permissions. PS I like this form of tech support.
User Post (2002-10-18 13:23:10 by vincentc)
Hey I'm almost there. Thru Telnet, my account only allows ftp access. Is there another way to use the pwd command? I don't have SSL.
User Post (2002-10-09 09:55:55 by sanfranciscojack)
Regarding the post from jandb about home directories:

I noticed this, too. If you cd into /home (using telnet or ssh) from your user account, then do an ls -la, you'll see that the usernames listed are links that point to the various .whatever/username directories. I'd guess this is due to dreamhost having 200 servers and that the .whatever names are the various servers that have home directories... this may have something to do with the way apache creates "virtual servers" etc which is how dreamhost can host so many domains without having a ton of IP addresses...

also, this could be some sort of user account synch. thing that makes it easier for us to access resources across different machines without the sysadmins having to create accounts for everyone on every single machine...anyway, I can't say I've run into problems using "/home/username" instead of "/home/.whatever/username" in scripts, etc."

I could very well be wrong about all this...but I think i'm on the right track...hopefully, it hasn't derailed...


User Post (2002-09-09 10:00:24 by jandb)
All these commands are run from a telnet (or, preferably, SSH) session logged into your account.

The info on these pages may be a bit out of date. I found that my home directory was not


but instead was


Don't know what .fonda is, but when I specified full paths for my objects with that corrected directory location, everything worked.
User Post (2002-05-19 14:50:58 by delgirl)
pwd = Present Working Directory
User Post (2001-06-26 05:09:41 by fba)
Hi "Toxik". If you have a telnet window open. Send the "pwd" command to the server, and the server should return with the full path to the directory you are currently in. It's just a good way of finding your away about a system, but could also come in handy when configuring scripts.
User Post (2001-06-23 00:36:58 by toxik)
Hey anybody!
"Simply create a directory somewhere within our account and put your scripts there, then use the 'pwd' command while within that directory to get its pathname."

Someone please explain this sentence to me! What 'pwd' cammand? Where do I make this command??