Can't get DNS Alias work on Ubuntu 10.04 with Apache 2
- by Johnny
I want to use the DNS Alias to configure one of my domain pointing to a specific directory on the server.
Here is what I've done:
Change the IP address in domain setting, and it works
$ ping www.example.com
PING example.com (124.205.62.xxx): 56 data bytes
64 bytes from 124.205.62.xxx: icmp_seq=0 ttl=48 time=53.088 ms
64 bytes from 124.205.62.xxx: icmp_seq=1 ttl=48 time=52.125 ms
^C
--- example.com ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 52.125/52.606/53.088/0.482 ms
Add sites-available and sites-enabled
$ ls -l /etc/apache2/sites-available/
total 16
-rw-r--r-- 1 root root 948 2010-04-14 03:27 default
-rw-r--r-- 1 root root 7467 2010-04-14 03:27 default-ssl
-rw-r--r-- 1 root root 365 2010-06-09 18:27 example.com
$ ls -l /etc/apache2/sites-enabled/
total 0
lrwxrwxrwx 1 root root 26 2010-06-09 15:46 000-default -> ../sites-available/default
lrwxrwxrwx 1 root root 33 2010-06-09 18:17 001-example.com -> ../sites-available/example.com
But it doesn't work and when I open the browser for www.example.com, it shows an 111 error:
The following error was encountered:
Connection to 124.205.62.48 Failed
The system returned:
(111) Connection refused
Here is how example.com's config:
$ cat /etc/apache2/sites-enabled/001-example.com
<virtualhost *:80>
DocumentRoot "/vhosts/example.com/htdocs/"
ServerName www.example.com
ServerAlias example.com
<Location />
Order Deny,Allow
Deny from None
Allow from all
</Location>
#Include /etc/phpmyadmin/apache.conf
ErrorLog /vhosts/example.com/logs/error.log
CustomLog /vhosts/example.com/logs/access.log combined
Could you please tell me how to solve this?