Forum Moderators: phranque

Message Too Old, No Replies

document root problem

         

virtuwul

3:57 am on Apr 21, 2004 (gmt 0)

10+ Year Member



Hello,

Not sure what I did to my httpd.conf file. I thought
I didn't change anything, but now, all my domains are going to the root level var/www/html instead of
going to /home/virtual/sitename/var/www/html....

Any ideas on how to fix it?

-Virtuwul

virtuwul

1:10 pm on Apr 21, 2004 (gmt 0)

10+ Year Member



I guess I don't understand something in general about how this works...I've taken a look at a few examples of httpd.conf , and the document root is always /var/www/html. ...so how the heck does it find /home/virtual/site/var/www/html?

I tried using a virtualdocumentroot command, (not within a virtualhost tag), and that made my www.firstdomain.com and www.seconddomain.com and www.thirddomain.com all show up as the content of www.firstdomain.com.... I guess apache couldn't differentiate because they're on the same IP.

Can someoneone please explain what is broken and why the normal /var/www/html document root doesn't display my pages? Mucho appreciated. - Virtuwul

denisdekat

3:51 pm on Apr 21, 2004 (gmt 0)

10+ Year Member



You need one tag for the IP saying it will be shared:

NameVirtualHost 123.123.123.123:80

You need a tag like this per domain:

<VirtualHost 123.123.123.123>
ServerName domain.name
ServerAlias www.domain.name
ServerAdmin webmaster@domain.name
DocumentRoot /home/user/webfolder
ScriptAlias /cgi-bin/ /home/user/webfolder_html/cgi-bin/
CustomLog path/to/logs/logs_domain.name combined
</VirtualHost>

Something like that. You would need one per domain, make sure the IP matches what DNS says.

HTH :)

virtuwul

5:21 pm on Apr 21, 2004 (gmt 0)

10+ Year Member




Thanks for the reply

Well, setting up virtual hosts would probably work.
But I shouldn't need to set up a virtual host for
every domain I create.

There is something else going on - something probably
outside httpd.conf, perhaps something that the control
panel configures - that tells apache where to look
to get the root before going to the document root.

For example, Cpanel might store web pages in a different folder from ensim..(i'm using ensim)... ...something must
tell apache where these folders are if you leave the
document root as var/www/html in httpd.conf.