0

I have just setup my VPS with centos and using bind server to add domains to it. My only problem is that when I access the domain with www. it doesnt work. After I investigated my problem on the interwebs I found out that by adding a IN CNAME to the domain should work, but it doesnt.

Here is how my records file looks like:

$ttl 38400
senatoronline.ro.   IN  SOA ns1.bebliuc.ro. bebliuc\.george.gmail.com. (
            1365567122
            5M
            3600
            604800
            38400 )
senatoronline.ro.   IN  NS  ns1.bebliuc.ro.
senatoronline.ro.   IN  NS  ns2.bebliuc.ro.
senatoronline.ro.   IN  A   176.223.127.161
ns1.bebliuc.ro. IN  A   176.223.127.161
ns2.bebliuc.ro. IN  A   176.223.127.161
senatoronline.ro.   IN  MX  10 mail.bebliuc.ro.
www.senatoronline.ro.   IN  CNAME   senatoronline.ro.
*.senatoronline.ro. IN  A   176.223.127.161

LE : VHosts file

<VirtualHost *:80>
    ServerName senatoronline.ro
    ServerAlias www.senatoronline.ro
    ServerAdmin [email protected]
    DocumentRoot /var/www/senatoronline.ro
    <Directory /var/www/senatoronline.ro>
            AllowOverride All
            Allow from all
    </Directory>
</VirtualHost>

Any help with this is MUCH appreciated.

Thanks

6
  • 1
    Your DNS records look fine. What exactly is the problem? Sep 9, 2013 at 20:23
  • When I got to domain.com/index.html it works, but when I try www.domain.com/index.html it doesnt, also I tried to traceroute for both variations and without www works but with it stals.
    – Bdesign
    Sep 9, 2013 at 20:26
  • May be you forgot add www.senatoronline.ro as ServerAlias in vhost config?
    – ALex_hha
    Sep 9, 2013 at 20:27
  • I edited my question with the vhosts file.
    – Bdesign
    Sep 9, 2013 at 20:32
  • 2
    Did you wait for DNS caching to expire? I notice that while the records were correct, the TTL was 21600 (6 hours). Wait six hours and try again. Sep 9, 2013 at 20:33

2 Answers 2

1

both those virtual hosts works fine.

jamzed@lnxwrk:~$ lwp-request -Sde senatoronline.ro
GET http://senatoronline.ro
403 Forbidden
Connection: close
Date: Wed, 11 Sep 2013 07:20:40 GMT
Accept-Ranges: bytes
Server: Apache/2.2.23 (CentOS)
Content-Length: 3700
Content-Type: text/html; charset=UTF-8
Client-Date: Wed, 11 Sep 2013 07:20:41 GMT
Client-Peer: 176.223.127.161:80
Client-Response-Num: 1
Title: Test Page for the Nginx HTTP Server on Fedora

jamzed@lnxwrk:~$ lwp-request -Sde www.senatoronline.ro
GET http://www.senatoronline.ro
403 Forbidden
Connection: close
Date: Wed, 11 Sep 2013 07:20:43 GMT
Accept-Ranges: bytes
Server: Apache/2.2.23 (CentOS)
Content-Length: 3700
Content-Type: text/html; charset=UTF-8
Client-Date: Wed, 11 Sep 2013 07:20:43 GMT
Client-Peer: 176.223.127.161:80
Client-Response-Num: 1
Title: Test Page for the Nginx HTTP Server on Fedora

What exactly happen if you try get www.senatoronline.ro? is it a problem related to DNS? or Apache configuration? Try resolve both hosts senatoronline.ro and www.senatoronline.ro and check if you'll get the same IPs. Did you modified /etc/hosts for tests purpose?

0

DNS looks fine, but you might need an equivalent wildcard entry for Apache's vhosts file - something like:

   ServerAlias *.senatoronline.ro

Then apache will catch those requests.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .