DreamHost cgi-system issues
We recently took a Drupal installation that we had running on another host and tried to install it on an account at DreamHost. When we access the site, we are seeing that the content will load when accessed directly but the system is inserting "cgi-system" into all of our drupal links. In addition, the error log files are indicating that the files are not being found as the server is looking in the "/dh/cgi-system/" directory and the files do not exist there, they are at the web root.
We tried to update the settings.php to add "/dh/cgi-system" or "/cgi-system" to the base_url but that did not change anything. While we did find a Wiki from DreamHost about installing Drupal, there was no mention of using PHP as CGI, which is how this particular hosting account is created.
Any ideas? I am busy searching the forums and web but I haven't found anything as of yet.

Details
Forgot to add the details....
Drupal 4.7 RC 3 installed with MySQL5 and PHP5 running as CGI.
I'm not with dreamhost
I'm not with dreamhost anymore but if I remember correctly they use phpsuexec. I'm not sure if this will be useful but check this link.
http://corz.org/devblog/2006-Q1/phpsuexec
Things just behave differently with phpsuexec so it's a good read.
-joon
www.dvessel.com
Uncommenting $base_url = did
Uncommenting
$base_url =
did the trick!
Thanks!!
Are you trying to use
Are you trying to use fast-cgi? Not really necessary. I would turn it off.
Well....
The client has not allowed us to access the control panel because they indicated that they have multiple domains under the control of that login and will not allow us access, so I am not sure of the specific configuration. Here is what the person in charge of the Dreamhost account sent to us via email:
"As I have previously stated, there is no longer the option of running as NOT a CGI program."
---
"The site was setup long before dreamhost switched to exclusively using PHP as a CGI... yes, it is no longer selectable as to which you wish to use. Since you seemed to have difficulty getting set up. I have disabled mod_security. You are running under a PHP 4.4.2 environment, if you require a 5.1.2 environment let me know and I can switch it. It is now running as basic as can be provided. Since you did get a database uploaded, I can assume that the password worked correctly. Can you please point out WHERE in the Drupal documentation it says that PHP running as a CGI will not function correctly?"
The problem is trying to determine the cause of the problems with only being able to access the FTP site. We are not sure of the specific configuration. I have not determined why/how the server is looking for the "/dh/cgi-system" path and/or inserting "cgi-system" into our links. If I remove the "cgi-system" from the link, the Drupal node loads but it cannot load the CSS because it logs an error that it is looking in the "dh/cgi-system" directory, which does not exist.
I realize this is likely a crap-shoot since we don't have details on the server configuration but I thought I would see if anyone on the forums has run into similar issues with Dreamhost. We did the exact same install that we ran on our development server with icdSoft, which worked flawlessly. So I suspect it is something with the server configuration, I just don't know what.
===================================
Additional update....I received access to the control panel and now see the following details:
PHP Version 4.4.2
Extra Web Security is disabled
FastCGI Support is disabled
Web Directory: /home/username/site.com/ (which is where we uploaded our drupal files)
I have still not yet determined where the "cgi-system" is coming from in our drupal links. One thing I am going to try is to disable the clean url's and see if that is causing a problem.
Working
Just thought that I would post back that I got it working....
The problem seems to be that the .htaccess needed some changes to the RewriteBase and one of the RewriteRule settings. The RewriteBase had to be set to "/cgi-system" and then I had to add an "/" to the following RewriteRule: RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]
Once I made these changes, everything works properly. While we had tried the RewriteBase, we did not have the RewriteRule set properly either so things were not working.
Thanks to all for the suggestions and information.
Are there more details ?
Does Your setup work with clean urls ?
Which modules do work, which eventually don't ?
I already signed up for 2 years at DreamHost using the promo code from a member who said he would give the commission to drupal.
Then I found out that install is more complicated than on my old host,
Now, I urgently need a hand, as I have a trip to Europe ahead saoon and need almost every minute
for preparations.
Any detailled hint, advice or sample htaccess and setup files etc. would be really helpful.
As with other software, the differenz seems to be the path to the script or php.cgi
Eventually it would be necesarry to change some code in the scripts - ... where ?
Many thanks in advance.
Roland
More details
Yes, we have it working with the clean urls enabled on DreamHost. As far as modules, we don't really have too many enabled right now but here is the list of everything that is installed (all installed modules are working):
basicevent
event
eventrepeat
flexinode
nice_menus
path
print
profile
search
simplenews
webform
We are in the process of implementing TinyMCE on our test server but haven't moved that to the live site yet. So I cannot comment on whether or not that will work well on DH but I know it required some modifications to the paths within the module on our test server.
With regard to the .htaccess settings on DH and what we had to do to get everything working, I think I have mentioned it above but will repeat it here. Here are the settings from our .htaccess file:
# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
RewriteBase /cgi-system
# Rewrite old-style URLs of the form 'node.php?id=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^id=([^&]+)$
#RewriteRule node.php index.php?q=node/view/%1 [L]
# Rewrite old-style URLs of the form 'module.php?mod=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
#RewriteRule module.php index.php?q=%1 [L]
# Rewrite current-style URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]
# Allow access through to Dreamhost stats
RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/failed_auth.html$
RewriteRule ^.*$ - [L]
In addition, we have modified the settings.php to enable the $base_url setting and that is pointed to the url of the website. Drupal is installed at the webroot.
If you have more specific problems or questions, I will try my best to help you out. But the above is really the only thing that we had to change on DH to get it working properly.
-Derek
4.6.6 works fine, 4.7.0 doesn't
Hmmm, having the same problems with "cgi-system" being added to the link with 4.7.0 on Dreamhost, I tried your solution here, but couldn't make it work. I checked and rechecked my coding, and since I couldn't find any fault, I ended up erasing the lot, and tried installing 4.6.6 instead. And it worked like a dream, without any .htaccess modifications.
I've had the 4.7 beta and release candidates running fine on this Dreamhost account, but this 'finished' product doesn't work. I've tried comparing the .htaccess files between versions, and I've also tried just replacing this new one with an older version. So in short, I guess there is some major difference somewhere else in the code, between eg. 4.7 rc 2 and 4.7.0, that makes Drupal break on Dreamhost.
Update: I tried installing 4.7.0 on my local machine, in case there was something wrong with the downloaded files. But no, it runs fine here on localhost.
It works
I do following what you say, and I fix that error. Thanks so much.
Same problem with cgi-system
This is very annoying. Same problem on my dreamhost account. Anyone who can resolve this? Basically all links point to /cgi-system/ folder instead of /subfolderwhereiinstalleddrupal/. Example /cgi-system/?q=user/register. I've tried to modify .htaccess as directed above, but nothing changes.
I am running drupal 4.7.
Solved it
It was only a matter setting the $base_url to the subdir. Then I did not need the .htaccessmodifications either.
right, now it works for me
right, now it works for me too
Solved the issue with Dreamhost for me also...
BTW: The change is in settings.php, just to be clear!
Thanks...
More CGI-System DreamHost NighMares
So my accomplice and I have tried each and every one of these procedures with lackluster results. The *cgi-system* link is continuously added. Is there anything else that is going on here? That 90 day money back guarantee DreamHost offers seems tempting.
Running Drupal 4.7.3 on DreamHost.
Lord, please forgive me, for I know not what I am doing.
Try to uncomment $base_url
Try to uncomment $base_url in setting.php.
It works for me
Got it!
I recently had to install a backup on dreamhost. the old webhost was unavailable so i could not make the backup with clean url's turned off.
After trying a number of things I changed AND UNCOMMENTED $base_url in setting.php
Since I have drupal in a subdirectory my mod rewrite file looks like this
-----note how I included the subdirectory in the URL on the last line.
# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
# RewriteBase /drupal
# Rewrite old-style URLs of the form 'node.php?id=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^id=([^&]+)$
#RewriteRule node.php index.php?q=node/view/%1 [L]
# Rewrite old-style URLs of the form 'module.php?mod=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
#RewriteRule module.php index.php?q=%1 [L]
#Dreamhost recommends
RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/failed_auth.html$
RewriteRule ^.*$ - [L]
# Rewrite current-style URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /VTDW/index.php?q=$1 [L,QSA]
</IfModule>
Therese
http://datadesigns.ca
vancouver bc
here too - but on a site that had been running for several mths
Drupal 4.6.5
I also received this problem today. This site is also on DreamHost, but.... this site has been running for about 6 months. Then suddenly today, it started to get the inserted the "cgi-system" stuff in the URLs.
Why all of a sudden - heck got me there.
Unless Dreamhost made some server changes today. Until I found this message I thought I had been hacked or something.
I got lucky with this issue. The company is in the middle of a name change and changing the domain name as well. The new site, on the new domain, has been running for about two weeks. And I was just waiting to be sure the new site was running ok - before taking it into full production.
So after reloading all the modules and still having the issue I just did a Redirect to the new site.
Now to contact DreamHost and ask them what they changed, overnight.
Thanks to this Post... if need be, I can fix the problem by making the above changes.
Thank you everyone for posting this issue.
Access statistic page error
Thank's for all before, i'm new user at dreamhost. Your advice almost done for me. But my statistic page still error.
Statistic page at dreamhost is mydomain.com/stats
if i load that page.. still page not found.
Please help me.. to solve itu.
And thank you again.
Ahmad Daniyal
http://ahmad.indieoffset.com
use dreamhost php 5.2
Another solution is to use Dreamhost's php 5.2 offering(as per http://mu.wordpress.org/forums/topic.php?id=4605). This clears up the cgi crap without having to modify your settings or htaccess files.
Only problem is that you need to be using drupal 4.7.5 or you have the instant logoff problem (forgets you are logged in). The workaround for the login problem is here http://drupal.org/node/102114.
ta da.
PHP 5.2
It's odd how this problem popped up after a simple upgrade from Drupal 5.1 to 5.2. Setting $base_url fixed the problem with PHP 4, but I ended up re-commenting it in settings.php and switching from PHP 4 to PHP 5.2.2.
Thanks for the info!
http://2tbsp.com
None of those work
I tried everything in this thread and nothing works, this is very frustrating and makes me not want to use drupal anymore. I updated just fine on my other site, not hosted on dreamhost.
Editing the .htaccess, editing the settings.php and disabling clean urls all do not work for me. Is there anything else I can try?
My drupal installation is in my root folder and I'm using 5.1. I just re-upload the old files and it works again, is there any way I can manually edit the problems with the 5.1?
Thanks for any help in advance...
Drupal 5.x Installation
I realize that this is under 4.7.x, but for those who Googled this issue and are using 5.x, I wanted to share how I was able to solve this. On DreamHost, if it inserts 'cgi-system', you can just set the $base_url variable in the settings.php.
Under the base Drupal installation, I went into sites\default\settings.php and changed
# $base_url = 'http://www.example.com'; // NO trailing slash!to
$base_url = 'http://www.brewday.org/content'; // NO trailing slash!Note that I did not have a trailing slash, and I have my drupal installation in a folder called content. By doing this, I was able to get the installation going and could then proceed with multiple 'sites' within the drupal installation.
I'll see if there is a relevant post in 5.x installations and post this there.
dmahmoudi - A late thank
dmahmoudi - A late thank you for your post. This solved my problem. I really appreciate it.
Changing PHP Version to 5.2x solved the problem for me
I had this problem on Dreamhost when trying to install Drupal 6.x. The solution that worked for me was from the wordpress thread on the same problem recommended by bermin. For the benefit of future Dreamhost problem solvers, I'm reproducing the instructions here:
1. Select Drupal 5.2x from your "Manage domains" > "Edit" link in your Dreamhost account.
2. Wait for about 10 minutes to make sure the changes are done.
I also had the base url set to my domain name in sites/default/default.settings.php, but I don't know whether that made a difference or not.