Hi,
What do I need to do to use virtual hosts in apache?
I have this configuration in httpd-vhosts.conf
Code:
#NameVirtualHost *:80
<VirtualHost *>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "/srv/httpd/htdocs"
ServerName rmg.ilri.cgiar.org
ErrorLog "/var/log/httpd/error_log"
CustomLog "/var/log/httpd/access_log" common
</VirtualHost>
<VirtualHost *>
<Directory /var/www/git.darkstar.ilri.org/gitorious/public>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from All
</Directory>
DocumentRoot /var/www/git.darkstar.ilri.org/gitorious/public
ServerName repository.rmg.ilri.cgiar.org
ErrorLog /var/log/httpd/repository_log
CustomLog /var/log/httpd/repository_log combined
# Gzip/Deflate
# http://fluxura.com/2006/5/19/apache-for-static-and-mongrel-for-rails-with-mod_deflate-and-capistrano-support
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Far future expires date
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
ExpiresActive On
ExpiresDefault "access plus 1 year"
</FilesMatch>
# No Etags
FileETag None
RewriteEngine On
# Check for maintenance file and redirect all requests
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html [L]
</VirtualHost>
But when I type rmg.ilri.cgiar.org or repository.rmg.ilri.cgiar.org both go to the DocumentRoot of the first (/srv/httpd/htdocs)!
Do I need to remove some lines from httpd.conf if I use virtual hosts?
Both rmg.ilri.cgiar.org and repository.rmg.ilri.cgiar.org are declared elsewhere in a Windows Domain server.
Any help is much appreciated.
Carlos