Document root help
Posted by: tufa (---.dsl.snfc21.sbcglobal.net)
Date: March 04, 2008 05:32PM

I'm having difficulty getting the document root set properly. I have a number of sites in the www folder.

I thought the correct way of doing this was to uncomment this line in httpd.conf...

Include conf/extra/httpd-vhosts.conf

and then to add in httpd-vhosts.conf...

<VirtualHost *:80>
ServerName domain1.com
DocumentRoot /localhost/domain1.com
</VirtualHost>

<VirtualHost *:80>
ServerName domain2.com
DocumentRoot /localhost/domain1.com
</VirtualHost>

<VirtualHost *:80>
ServerName localhost
DocumentRoot C:/wamp/www
</VirtualHost>

This doesn't work. Root relative links still point to C:/wamp/www. So then I changed /localhost/ to c:/wamp/www/ for each domain and that didn't work either.

What is the correct way of making root relative links work?

Options: ReplyQuote
Re: Document root help
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: March 04, 2008 05:50PM

you need to change your hosts file in c:/windows/system32/drivers/etc

and add a line like

127.0.0.1 www.domain1.com






also ur document roots are wrong

you should use
c:/wamp/www/domain1

Options: ReplyQuote
Re: Document root help
Posted by: yfastud (Moderator)
Date: March 04, 2008 05:57PM

Check Setup Virtual Host guide on my personal website

Have fun,

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

Options: ReplyQuote
Re: Document root help
Posted by: tufa (---.dsl.snfc21.sbcglobal.net)
Date: March 04, 2008 06:02PM

Nevermind, I figured it out. It didn't like the .com

<VirtualHost domain1>
ServerName domain1
DocumentRoot C:/wamp/www/domain1.com
</VirtualHost>

<VirtualHost domain2>
ServerName domain2
DocumentRoot C:/wamp/www/domain2.com
</VirtualHost>

<VirtualHost localhost>
ServerName localhost
DocumentRoot C:/wamp/www
</VirtualHost>

Options: ReplyQuote
Re: Document root help
Posted by: tufa (---.dsl.snfc21.sbcglobal.net)
Date: March 04, 2008 06:06PM

stevenmartin99 Wrote:
-------------------------------------------------------
> also ur document roots are wrong
>
> you should use
> c:/wamp/www/domain1

No, the folder name is domain1.com. Apparently if I put a "." in the ServerName it gets confused. Don't know why I didn't think of that sooner.

Options: ReplyQuote
Re: Document root help
Posted by: yfastud (Moderator)
Date: March 04, 2008 06:12PM

He meant that you should put the full path there, which you have corrected; however, to access your local domains w/i your lan, check my guide on my website, which is a little too long to post them here

Have fun,

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

Options: ReplyQuote
Re: Document root help
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: March 04, 2008 06:19PM

you were going to name your folder domain.com ??? lol

Options: ReplyQuote


Sorry, only registered users may post in this forum.