Need help writing a clean /etc/hosts file that will work with Apache Virtual domains
Question: Is there a better(cleaner) way to write this /etc/hosts file ?
Problem:
Apache will not restart unless I have the following virtual domains in the host file.
This is very messy looking.
The comments indicate changes that I have tried.
cat /etc/hosts
127.0.0.1 localhost
#192.168.1.111 breezysolutions.com www.breezysolutions.com breezy \
www.annapolislinux.org annapolis
#192.168.1.111 breezysolutions.com www.breezysolutions.com breezysolutions\
annapolislinux.org www.annapolislinux.org annapolislinux
192.168.1.111 www.annapolislinux.org annapolislinux
192.168.1.111 annapolislinux.org
192.168.1.111 www.breezysolutions.com breezysolutions
192.168.1.111 breezysolutions.com
192.168.1.2 work.annapolislinux.org work
192.168.1.5 lap.annapolislinux.org lap
192.168.1.10 workstation.annapolislinux.org debby
192.168.1.254 bsd.annapolislinux.org bsd
cat /etc/resolv.conf
search darwin.net
nameserver 209.119.92.10 #ns1.sdf.darwin.net
nameserver 208.141.8.10 #ns2.sdf.darwin.net
/etc/httpd.conf apache Virtual domain stuff
<VirtualHost 192.168.1.111>
ServerAdmin webmaster@annapolislinux.org
DocumentRoot /home/httpd/html
ServerName www.annapolislinux.org
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combine
d
CustomLog /var/log/apache/access.log combined
ErrorLog /var/log/apache/error.log
#TransferLog /var/log/apache/access.log
ServerAlias www.annapolislinux.org *dhs.org
ServerAlias www.annapolsilinux.org *wox.org
ServerAlias www.annapolislinux.org *annapolis-linux.org
ServerAlias www.annapolislinux.org *annapolislinux.org
</VirtualHost>
<VirtualHost 192.168.1.111>
ServerAdmin webmaster@breezysolutions.com
DocumentRoot /home/httpd/html/breezy_solutions
ServerName www.breezysolutions.com
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /var/log/apache/breezy_solutions/access.log combined
ErrorLog /var/log/apache/breezy_solutions/error.log
#TransferLog /var/log/apache/breezy_solutions/access.log
ServerAlias www.breezysolutions.com *breezysolutions.com
ServerAlias www.breezysolutions.com *breezynetworks.com
</VirtualHost>
Thanks.
-Ted
Reply to: