You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Mandrich <ma...@4fts.com> on 2003/09/20 20:45:49 UTC

Re: [users@httpd] Virtual Hosting Woes....... (SOLVED (kind of))

Hi. thanks to all for your responses! After setting up a second server,
creating a default installation of Apache, and configuring it for vitual
hosts I've determined that the problem stems from my manually moving Apache
to /var. Apache runs fine, but the virtual hosts just don't want to work.
The conf file, directory structure, ownership and group membership are
identical with the exception of one being run from /usr/local and one being
run from /var/local. I use FreeBSD and install from the ports collection, so
I'm guessing that if I use a switch on the installation command to install
directly into /var and not play around with moving stuff manually that the
virtual hostig should work fine. If there are any fellow BSD users on this
list who can drop me a hint or two on the proper way to customize the
install from ports, it would be greatly appreciated.

One other question I had:

My virtual hosting directives work fine using the following <VirtualHost
192.168.0.202:*> for all of the virtual domains I've set up. I see from the
examples below AND from some friends of mine who run production Apache
servers in a corporate enviroment that the <VirtualHost > container can use
the domain name instead ofthe IP. However, the Apache docs say NOT to do
this because this causes Apache to do a DNS lookup to resove the domain name
in the VirtualHost directive, and if DNS is down that Apache won't start
correctly. Have any of you ever experienced this? What were the results?

Mark
----- Original Message ----- 
From: "Joseph A Nagy Jr" <jo...@charter.net>
To: <us...@httpd.apache.org>
Sent: Saturday, September 20, 2003 1:17 PM
Subject: Re: [users@httpd] Virtual Hosting Woes.......


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Saturday 20 September 2003 13:12, Fortin, John {PBG} wrote this in an
attempt to be witty or informative:
> I believe that since the IP addresses for your domains are the same,
> you need to use the hostname to differentiate between the sites like
> this:
>
> <VirtualHost www.Dom1.com:80>
> ServerName www.Dom1.com
> DocumentRoot /var/local/www/data/Dom1
> ErrorLog /var/log/Dom1-error_log
> CustomLog /var/log/Dom1-access_log common
> </VirtualHost>
>
> <VirtualHost www.Dom2.com:80>
> ServerName www.Dom2.com
> DocumentRoot /var/local/www/data/Dom2
> ErrorLog /var/log/Dom2-error_log
> CustomLog /var/log/Dom2-access_log common
> </VirtualHost>
>
> Good luck...
>
> --john
<snip>

Actually, he doesn't have to do that. I have one IP and my vhosts are
set up thusly:

<VirtualHost *>
    ServerAdmin joseph_a_nagy_jr@charter.net
    DocumentRoot /linux/joseph-a-nagy-jr/
    ServerName joseph-a-nagy-jr.homelinux.org
    CustomLog /linux/logs/joseph-a-nagy-jr.access.log combined
    ErrorLog /linux/logs/joseph-a-nagy-jr.error.log
    ErrorDocument 404 /cgi-bin/404-error.pl
    ErrorDocument 403 "Forbidden"
    ScriptAlias /cgi-bin/ /linux/cgi-bin/
 <Directory />
        Options All Multiviews
 </Directory>
 <Directory /linux/cgi-bin>
     AllowOverride None
     Options None
     Order allow,deny
     Allow from all
 </Directory>
    Alias /icons/ "/var/www/icons/"
    <Directory "/var/www/icons">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
Alias /manual "/var/www/manual"
<Directory "/var/www/manual">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
     <Directory "/linux/images/friends/">
        AuthType Basic
        AuthName "Friends Only"
        AuthUserFile /etc/httpd/conf/passwords/friends-pics
        Require valid-user
     </Directory>
#     <Directory "/linux/joseph-a-nagy-jr/homework/">
#        AuthType Basic
#       AuthName "Authorized Users Only"
#       AuthUserFile /etc/httpd/conf/passwords/homework
#       Require valid-user
#     </Directory>
 Alias /images/ /linux/images/
 Alias /wav/ /linux/wavs/
 Alias /html40/ /linux/html40/
 Alias /css2.1/ /linux/css2.1/
 Alias /test/ /linux/temp/
 Alias /css/ /linux/css/
 Alias /sound/ /linux/sound/
 Alias /xhtml1/ /linux/xhtml1/
 Alias /LDP/ /mirror/ldp/
 Alias /video/ /linux/video/
 Alias /download/ /linux/downloads/
 Alias /flash/ /linux/flash/

# Begin Spam protection rules

RewriteCond %{HTTP_USER_AGENT}
email.?(magnet|reaper|siphon|harvest|collect|wolf) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} floodgate [NC,OR]
RewriteCond %{HTTP_USER_AGENT}
web(bandit|snake|collector|mole|miner|weasel) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} cherry.?picker [NC,OR]
RewriteCond %{HTTP_USER_AGENT} extractor.?pro [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^crescent [NC,OR]
RewriteCond %{HTTP_USER_AGENT} nicerspro [NC]
RewriteCond %{REQUEST_URI} !^/scripts/
RewriteRule .* /scripts/visions [PT]
ScriptAlias /scripts/ /linux/cgi-bin/sugarplum/poison
</VirtualHost>

I have about 15 other vhost files, all in a similar format (some
simpler, some not).
- -- 
Wielder of the mighty +1 LARTsaber of Unsubscribe Instructions At End of
Message, the +3 Clue-by-Four of No Attachments to a Mailing List, and
the -4 Shield of No Spell Checker.
http://joseph-a-nagy-jr.homelinux.org http://mc-luug.homelinux.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/bJmlnjt9jEvKYeARArFvAJ9ynXXDyyewE4fUXe/LRertd0HdOwCePsjI
YgZ0un5qkHtznoTV2YFbaa8=
=5mzY
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org