httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kai Hendry <hen...@cs.helsinki.fi>
Subject [users@httpd] Optimizing Virtual host(s) configuration on apache 1.3.31
Date Thu, 15 Jul 2004 13:52:14 GMT
Can I configure apache to automagically look in
/web/subdomain.mydomain.org for a vhost on the ip of my server?

For example. On a client machine I can:
sudo echo 62.220.235.20 made.it.up >> /etc/hosts

And when putting in made.it.up in my browser, I would get a 404. :)
Unless I mkdir /etc/make.it.up on my server.



Right now my configuration is real pain in the ass[1].

In my monstrous httpd.conf, I have somewhere my vhosts listed like so:

NameVirtualHost 62.220.235.20:80                                                         
                                                                                    
                                                                                         
                                                                                    
<VirtualHost www.dabase.com dabase.com>                                            
                                                                                         

    Include conf/dabase.com.conf                                                         
                                                                                    
</VirtualHost>                                                                     
                                                                                         


...

What is the point of NameVirtualHost? I still have to put in the IP, as
thanks to:
http://httpd.apache.org/docs/dns-caveats.html

I have since learnt to put in the ip address and use ServerName to
avoid errors like:
error.log:[Thu Jul 15 00:32:37 2004] [error] Cannot resolve host name test.natalian.org ---
ignoring!

<VirtualHost 62.220.235.20>                                                        
                                                                                         

    Include conf/test.natalian.org.conf                                                  
                                                                                    
</VirtualHost> 

All my sites are pretty much the same. I override any settings with .htaccess.
So my configurations in /etc/apache/conf duplicate each other:

bilbo$ diff -u test.natalian.org.conf tips.natalian.org.conf 
--- test.natalian.org.conf      2004-07-15 16:00:17.000000000 +0300
+++ tips.natalian.org.conf      2004-07-15 00:38:55.000000000 +0300
@@ -1,10 +1,10 @@
-  CustomLog /var/log/apache/test.natalian.org-access_log combined
-  ServerAdmin test@natalian.org
-  ServerName test.natalian.org
+  CustomLog /var/log/apache/tips.natalian.org-access_log combined
+  ServerAdmin tips@natalian.org
+  ServerName tips.natalian.org
 
-DocumentRoot /web/test.natalian.org
+DocumentRoot /web/tips.natalian.org
 
-  <Directory "/web/test.natalian.org">
+  <Directory "/web/tips.natalian.org">
     Options All
     AllowOverride All
     Order allow,deny


So ideally I would not have to edit httpd.conf, make a new configuration
file and restart apache everytime I start a new web project.  I also
forgot to update httpd.conf when my machine switched to another IP. That
was another painful exp I would like to avoid.

[1] http://db.cs.helsinki.fi/~hendry/faqwiz/faqw.py?req=show&file=faq01.083.htp

---------------------------------------------------------------------
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


Mime
View raw message