Can't get DNS Alias work on Ubuntu 10.04 with Apache 2

Posted by Johnny on Server Fault See other posts from Server Fault or by Johnny
Published on 2010-06-10T06:49:27Z Indexed on 2010/06/10 6:53 UTC
Read the original article Hit count: 230

Filed under:
|
|

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:

  1. 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
  1. 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?

© Server Fault or respective owner

Related posts about apache

Related posts about ubuntu