Re: Virtual Host Performance Oddity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



André Warnier wrote:
> J. Greenlees wrote:
> [...]
> As slightly off-topic, I would like to add a note :
>
> Because of the way in which VirtualHosts work, with the first-defined
> VHost being the one handling all requests which somehow are "wrong",
> it is often difficult to sort out where such problems are coming from.
> To avoid this, I usually define a first Vhost that has some non-real
> DNS ServerName  (e.g. ServerName defaulthost), specifically to catch
> requests that arrive at the server with an invalid hostname (for
> example someone entering "http://(server-ip-address)".  That one has a
> DocumentRoot containing a single html index page, which shows clearly
> that the caller shouldn't do that. It also has its own separate logfiles.
> That helps sorting out the "wrong" calls from the "good" calls.
>
> In your case, that would be something like :
>
> <VirtualHost *:80>
>     ServerName default
>     DocumentRoot /home/defaulthost/docs
>     DirectoryIndex DontDoThat.html
>     ErrorLog /var/log/httpd/defaulthost-error_log
>     CustomLog /var/log/httpd/defaulthost-access_log common
> </VirtualHost>
>
> <VirtualHost *:80>
>     ServerAdmin
>     DocumentRoot /home/jaqui/public_html
>     ServerName dev.runic-hosting.com
>     ErrorLog /var/log/httpd/dev.runic-hosting.com-error_log
>     CustomLog /var/log/httpd/dev.runic-hosting.com-access_log common
> </VirtualHost>
>
> <VirtualHost *:80>
>     ServerAdmin
>     DocumentRoot /home/dawnfyre/public_html
>     ServerName dev.jaqui-greenlees.net
>     ErrorLog /var/log/httpd/dev.jaqui-greenlees.net-error_log
>     CustomLog /var/log/httpd/dev.jaqui-greenlees.net-access_log common
> </VirtualHost>
>
> <VirtualHost *:80>
>     ServerAdmin
>     DocumentRoot /home/shawan/public_html
>     ServerName dev.shawanspage.com
>     ErrorLog /var/log/httpd/dev.shawanspage.com-error_log
>     CustomLog /var/log/httpd/dev.shawanspage.com-access_log common
> </VirtualHost>
>
> Since "default" is not a valid DNS name, nobody would ever get to your
> server using "http://default";.  But that host would catch calls to
> "http://ip-address-of-your-server";, and also re-directed calls that
> somehow do not have a "Host:" header, or an invalid one (like possibly
> the result of wrong re-directs).
> And in its logfile, you would have these calls isolated from the
> explicit calls to your host "dev.runic-hosting.com".
>
>
well, I like that idea.
found out that both the second and third vhost containers are not being
read.
changed the conf to have the hostname specified rather than the *:80

which apachectl give this warning:
 apachectl stop
[Wed Dec 31 04:14:38 2008] [warn] NameVirtualHost
dev.jaqui-greenlees.net:80 has no VirtualHosts
[Wed Dec 31 04:14:38 2008] [warn] NameVirtualHost dev.shawanspage.com:80
has no VirtualHosts
apachectl start
[Wed Dec 31 04:15:23 2008] [warn] NameVirtualHost
dev.jaqui-greenlees.net:80 has no VirtualHosts
[Wed Dec 31 04:15:23 2008] [warn] NameVirtualHost dev.shawanspage.com:80
has no VirtualHosts


ok, going back to the *:80 got rid of the warnings.
but now only the default is working.

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux