I have a web server with a website and i want to add another address for pre-production use.
Here the existant:
httpd.conf:
ServerAdmin support@toto.com
ServerName www.toto.com:80
DocumentRoot "/home/tutu/var/www/html"
modules/vhost.conf:
<VirtualHost *:80>
ServerAdmin support@toto.com
ServerName www.toto.com:80
DirectoryIndex index.php
ErrorLog /home/tutu/var/log/httpd/error-mod_log
LogLevel warn
CustomLog /home/tutu/var/log/httpd/access-mod_log common-cookie
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>
</VirtualHost>
And I have tried to add another VirtualHost but the new address not working:
<VirtualHost *:80>
ServerAdmin support@toto.com
ServerName www2.toto.com:80
DirectoryIndex index.php
ErrorLog /home/tutu/var/log/httpd/error-www2_log
LogLevel warn
CustomLog /home/tutu/var/log/httpd/access-www2_log common-cookie
DocumentRoot "/home/tutu/var/www2/html"
</VirtualHost>
The address www2.toto.com is not working.
Have you an idea?
Thanks
Have you added www2.toto.com to DNS?
It’s not added to public DNS yet. (But http://www.toto.com is)
“Not working” is not very specific. Do you get the default Apache web-page for that site or do you not reach the server? If it’s the latter, DNS lookup is likely your real problem, not the Apache config.
The Apache-config looks good, but you should not need to specify :80 as the alias port.