Software development, photography, jokes, ....

Sites by me

 
tas-logoTransportation Administration System
snoezelkussen-logo-kleinstSnoezelkussens voor verstandelijk gehandicapten
ikzoekeenbegeleider-logoBegeleiders voor gehandicapten
Laat uw hond het jaarlijkse vuurwerk overwinnen
Betuweroute en Kunst
logo 50x50Hey Vos! Je eigen naam@vos.net emailadres?
Kunst in huis? Nicole Karrèr maakt echt bijzonder mooie dingen
nettylogo2Kunst in huis? Netty Franssen maakt ook bijzonder mooie dingen
Professionele opvang bij Gastouderbureau
Kind-Zijn
Salarisadministratie en belastingadvies bij
De Zaak Loont
Zutphense Bomenstichting

Hosting Favorites

 
ANU Internet Services
XelMedia .internet Services
register.com

Blogroll

 
Bomenstichting
LassoSoft
MacFreak
Quality that computes
The Economy of Motion
Wheel 2.0
IntrAktv



Website Hosting bij Xel Media

Marc's Place


 

 Apache VHOST sort order

  How create make sure your VHOSTs are in the right order.
Pasted Graphic 1


I have this CentOS server. And I mainly use Webmin to manage the settings. But creating virtual hosts is something different. Webmin lists your virtual hosts in alphabetical order - and this is never the order in which the virtual hosts are stored in /etc/httpd/conf/httpd.conf, if you choose to do so.

apache-webmin-vhost-1

The virtual hosts are stored in order of entry. That is a bit of a pain and it’s a pity the Webmin interface does not work in the same way as the Webmin interface for the firewall rules; there one has these arrows on the right to move a rule up- or downwards in the list. Would be a cool thing to implement in the virtual host list too.

Anyway, Webmin does a good job if you store the virtual hosts in separate files - if you make modifications to a virtual host, it save the changes in the correct file.

apache-webmin-vhost-2

To manage your hosts like this and move them from the httpd.conf file into separate files, first create a folder /etc/httpd/vhosts and then create files for each vhost listed in http.conf. Copy/Paste each complete <VirtualHost></VirtualHost> block. When you are done, remove all virtual hosts from http.conf and add the following line of text:

Include vhosts/*.conf

Save and exit http.conf

You can now control the load order of the virtual hosts easily by beginning the file names with a number. Number the catch-all host the highest. Then check if you did a good job:

$ apachectl configtest

If all is OK, restart Apache:

$ apachectl graceful

Or, if you did it all via Webmin, click Apply changes at the top-right of the window of the Apache Webserver interface.

Another thing what I miss from Webmin’s virtual host overview is the name of the file where the virtual host is in. But you can see it if you click a virtual host’s name and then click 'Edit Directives':

apache-webmin-vhost-3

My list of vhosts looks like this:

$ ls -C1 /etc/httpd/vhosts

00awf-beeldendenklinkend.conf
00begeleider.conf
00bomeninfo.conf
00bszutphen.conf
00handidate.conf
00nicolekarrer.conf
00tradsys.conf
00voelkussen.conf
10snoezelen-pillow.conf
11snoezelen-kissen.conf
12coussin-calin.conf
19snoezelkussen.conf
20bobvosnet.conf
21ceesvosnet.conf
22daanvosnet.conf
23loesvosnet.conf
24marcvosnet.conf
29vosnet.conf
90sds82.conf


That’s it!
© 1997- Marc Vos (and others) Contact Me