Change location of the www directory?
Posted by: angelman7 (---.hsd1.nm.comcast.net)
Date: May 18, 2008 06:26AM

Is there a way to change the location of the www directory? If I change the doc root in the conf file, will all the wamp functions still work?

I have WAMP installed in the default location (C:\wamp), and I need the doc root to be D:\Web\www.

Options: ReplyQuote
Re: Change location of the www directory?
Posted by: toivo (---.nsw.bigpond.net.au)
Date: May 18, 2008 07:54AM

Hi,

That works all right, you can have a number of virtual hosts. You may want uncomment this line in httpd.conf:
#Include conf/extra/httpd-vhosts.conf
- and add the virtual hosts to the httpd-vhosts.conf file, replacing the DocumentRoot directive with the folder you wantfor each virtual host.

You should also add the <Directory> directive to each virtual host, like in the example in httpd.conf

Regards,.

toivo
Sydney, Australia

Options: ReplyQuote
Re: Change location of the www directory?
Posted by: angelman7 (---.hsd1.nm.comcast.net)
Date: May 18, 2008 04:01PM

Thanks!

Options: ReplyQuote
Re: Change location of the www directory?
Posted by: yfastud (Moderator)
Date: May 18, 2008 04:35PM

Follow my tutor guide here for setup Virtual Hosts, of course change the location as you want

[guides.jlbn.net]

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Change location of the www directory?
Posted by: angelman7 (---.hsd1.nm.comcast.net)
Date: May 18, 2008 04:54PM

Great guide! Thanks!

Options: ReplyQuote
Re: Change location of the www directory?
Posted by: yfastud (Moderator)
Date: May 18, 2008 06:25PM


Options: ReplyQuote
Re: Change location of the www directory?
Posted by: angelman7 (---.hsd1.nm.comcast.net)
Date: May 18, 2008 09:34PM

Ok, I did the following and it's not working:

1. Added "127.0.0.1 www" to the hosts file. Now [localhost] and [www] both bring up the WAMP page. I'd like [www] to point to my work directory at d:\Web\www.

2. Opened C:\wamp\bin\apache\apache2.2.8\conf\extra\httpd-vhosts.conf and changed it to this:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName localhost
DocumentRoot C:/wamp/www
ErrorLog C:/wamp/www/logs/error.log
CustomLog C:/wamp/www/logs/access.log common
</VirtualHost>

<VirtualHost *:80>
ServerName www
DocumentRoot D:/Web/www
ErrorLog D:/Web/www/logs/error.log
CustomLog D:/Web/www/logs/access.log common
</VirtualHost>

3. Uncommented "Include conf/extra/httpd-vhosts.conf" in C:\wamp\bin\apache\apache2.2.8\conf\httpd.conf

4. Restarted WAMP

Then nothing worked. I recomented the line in httpd.conf, restarted WAMP, and it's back to normal.

What am I doing wrong?



Edited 2 time(s). Last edit at 05/18/2008 09:42PM by angelman7.

Options: ReplyQuote
Re: Change location of the www directory?
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: May 18, 2008 10:13PM

ur vhost is wrong


u need an

Akias www www

line

look at examples on apache.org

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: Change location of the www directory?
Posted by: angelman7 (---.hsd1.nm.comcast.net)
Date: May 19, 2008 05:26AM

Steven, I assume you meant to say "Alias www www"? ServerAlias is only needed in the vhost if you want it to respond to more than one name.

My problem turned out to be an invalid path to the log directory in the first vhost. I fixed that, and it works fine. Now all I have to do is find out why some PHP functions, such as opendir, aren't working in the second vhost....

Options: ReplyQuote
Re: Change location of the www directory?
Posted by: yfastud (Moderator)
Date: May 19, 2008 06:19AM

Agree, I don't think you need Alias and your vh is fine. If you more functions for your vh, try the vh codes I've just pm it to you

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote


Sorry, only registered users may post in this forum.