homepage Welcome to WebmasterWorld Guest from 54.234.128.25
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Setting up an alias for DocumentRoot
JohnKelly




msg:4252166
 12:47 am on Jan 12, 2011 (gmt 0)

I have a site that has been moved from one server to another. The directory structure on the new server is different, and rather than change hundreds of files I would like to try to set up an alias for DocumentRoot.

The path contained in my files is:
/home/httpd/vhosts/domain.com/httpdocs/

The DocumentRoot in the vhost.conf on my server is:
DocumentRoot /srv/www/domain.com/public_html/

Is there a way to alias /home/httpd/vhosts/domain.com/httpdocs/ to /srv/www/domain.com/public_html/?

I have tried the Alias directive, but it didn't work, perhps I had the syntax wrong.

 

g1smd




msg:4252242
 8:03 am on Jan 12, 2011 (gmt 0)

Why not just change the DocumentRoot directive in the configuration so that it points to the right place?

What do you mean by "hundreds of files"? Have you "included" files and used the full path in the reference? An editor such as EditPlus3 could do a find and replace on all of your files in minutes. However, the server path for PHP includes (if that is what it is) should have been defined in a variable or set as a configuration line in the config file or in .htaccess.

JohnKelly




msg:4252329
 12:01 pm on Jan 12, 2011 (gmt 0)

The changing of httpdocs to public_html I'm not concerned about, it's the /srv/www part that I thought may cause problems.

I know I could change via find-and-replace. But this is a temporary server and I don't want to maintain two sets of files.

g1smd




msg:4252556
 7:44 pm on Jan 12, 2011 (gmt 0)

Replace the fixed path with a variable and define it once in one place.

JohnKelly




msg:4252638
 12:23 am on Jan 13, 2011 (gmt 0)

There are several installed apps that I am unable to change (path is hard coded in after installation). That is why I am in need of a DocumentRoot alias in vhost.conf or httpd.conf.

jdMorgan




msg:4253399
 5:42 pm on Jan 14, 2011 (gmt 0)

You may also want to look into using symlinks (symbolic links) at the server OS level.

Jim

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved