Click to See Complete Forum and Search --> : Virtual host problem


0piate
12-05-2000, 03:27 AM
What do I need to setup the document root as?
Im running linux and its set so when I create an acct, they are /home/user/www/cgi-bin

it says to set it up as
DocumentRoot /www/docs/host.some_domain.com

Right now ive got it setup so that when I create an accout, it sets up a www and www/cgi-bin dir in their home account. So they have /home/blah/www/cgi-bin

Do I need to setup the doc root as /home/blah/www/foo.domain.com ?

If so, that doesnt seem to be working.

Last thing, above it sets up the virtual cgi-bin dir. Do I need to set one up in this?

ScriptAlias /cgi-bin/ "/home/httpd/cgi-bin/"

Would I need todo something like /cgi-bin/ "/home/blah/www/cgi-bin/"

?

This is how it says to setup virtuals in my httpd.conf file.

# If you want to use name-based virtual hosts you need to define at
# least one IP address (and port number) for them.
#
#NameVirtualHost 12.34.56.78:80
#NameVirtualHost 12.34.56.78

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
#
#<VirtualHost ip.address.of.host.some_domain.com>
# ServerAdmin webmaster@host.some_domain.com
# DocumentRoot /www/docs/host.some_domain.com
# ServerName host.some_domain.com
# ErrorLog logs/host.some_domain.com-error_log
# CustomLog logs/host.some_domain.com-access_log common
#</VirtualHost>

#<VirtualHost _default_:*>
#</VirtualHost>

NameVirtualHost 209.145.148.54

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
#
<VirtualHost 209.145.148.54>
ServerAdmin webmaster@mlr.cdgaming.com
DocumentRoot /www/docs/mlr.cdgaming.com
ServerName mlr.cdgaming.com
ErrorLog logs/mlr.cdgaming.com-error_log
CustomLog logs/mlr.cdgaming.com-access_log common
</VirtualHost>

<VirtualHost _default_:*>
</VirtualHost>


I also tried commenting out the
NameVirtualHost 209.145.148.54
line and also tried with
NameVirtualHost 209.145.148.54:80
NameVirtualHost 209.145.148.54

Know what im doing wrong?




------------------

ckevin
12-05-2000, 11:17 AM
You need to make it clear what is the path of your desired www dir? for example, if you want

/home/blah/www/YourDomain.com as the folder for your web files...

just put:

DocumentRoot /home/blah/www/YourDomain.com

inside your VirtualHost tags and restart your apache, then it should work.

For your CGI-bin, acutally I won't suggest you make the alias to your server CGI-bin for security reason. without this alias, you still can give YourDomain.com CGI files work, once you set correct config in httpd.conf which allow your domain to execute CGI/PL files.

Hope this helps.

0piate
12-09-2000, 08:57 PM
I add this without the #s:

#NameVirtualHost 209.145.148.54:80
#NameVirtualHost 209.145.148.54

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
#
#<VirtualHost 209.145.148.54>
# ServerAdmin webmaster@mlr.cdgaming.com
# DocumentRoot /home/mlr/www/mlr.cdgaming.com
# ServerName mlr.cdgaming.com
# ErrorLog logs/mlr.cdgaming.com-error_log
# CustomLog logs/mlr.cdgaming.com-access_log common
#</VirtualHost>

#<VirtualHost _default_:*>
#</VirtualHost>

And it no longer finds my index.html page on www.cdgaming.com (http://www.cdgaming.com) and for mlr.cdgaming.com and gives the 404 file not found error for both. What im doing wrong?