Dreamhost document root for private servers

Posted by Matt Thommes on October 4, 2008 | Post type: Gain

I recently switched to Dreamhost PS from a standard Dreamhost shared hosting account for all of my domains. Dreamhost claims the process is seamless and you shouldn't have to make any changes.

However, I noticed one thing, and I thought I'd document it here.

The absolute path to your document root changes when you switch to a Dreamhost PS. This immediately had an effect on all of my domains since I specify that path in top-level htaccess scripts that control content output.

Once the DNS resolved, all of my sites were showing an "internal server error" message.

The old, shared hosting format of my document root used to look like this:

/home/[username]/[site directory]

... where [username] is your Dreamhost username/account name, and [domain name] is the domain name. Here's an example:

/home/joe655/mysite.com

With Dreamhost PS, the format changes:

/mnt/local/home/[username]/[site directory]

Example:

/mnt/local/home/joe655/mysite.com

Dreamhost didn't specify this in any documentation when I converted to one of their private servers. Perhaps it's now listed somewhere, but a nice "word of warning" about this would have been helpful.

Turns out this is a relatively small change to make, but depending on how many places you specify that path, you may have a lot of tedious pasting to do.

About the author(s)

Matt Thommes is an independent publishing enthusiast, mobile blogger, content creator, informative writer, web developer from a suburb of Chicago. Never one to conform, Matt intends to promote the effect the web has on our lives, in an effort to intensify, instruct, and clarify all that is happening around us.

Comments

Note: Comments may be viewed by authors, but if you have a more specific question you'd like to ask them, please email matt.thommes@paininthetech.com.

# Guy at 4/20/2009 3:44 pm cst

I have just suffered the pain from this issue and found the best way to fix it is to go into the phpMyAdmin for your site, export the database, open it in a text editor, find and replace all instances of your servername and re-import it using phpMyAdmin.

For example, my old shared hosting document root was /home/.olenko/myusername/mysite.com

and my new one is just /home/myusername/mysite.com

So I did find and replace for /.olenko/ in the database and just replaced it with '/' (one forward slash). This did the trick.

I've had to do it for about 20 sites so I too would have appreciated a warning beforehand or some sort of automated script to do it for me...

Quick Link to this comment: http://TTIP.me/c5044

# Jared at 6/12/2009 2:34 pm cst

You don't actually have to do this; I emailed in to their support as I had this exact same problem (with Wordpress as it happens) and they just said they needed to reboot Apache. Of course the above method should work too but I hate messing about the my MySQL dbs :)

Quick Link to this comment: http://TTIP.me/c5148

# Guy at 6/12/2009 3:38 pm cst

I don't see how rebooting Apache can change all the urls in the database... but then I don't know much MySQL and php so maybe it is possible.

Quick Link to this comment: http://TTIP.me/c5150

# Matt at 6/12/2009 3:54 pm cst

Oddly, I can now use the old format: /home/myusername/mysite.com. I didn't make any specific server changes to get this working - I just started using it one day, and it worked fine. To be clear, I believe both approaches work, but I prefer the old approach, as probably every DH customer would.

Luckily, I didn't have this value stored in database records, just script pages, but if I did, Guy's instructions would help find/replace it all.

And you're right - rebooting Apache would do nothing to the database records, but perhaps he meant it "reset" something on the server so it recognizes the old format.

Quick Link to this comment: http://TTIP.me/c5151