Question

I have installed CentOS 6.5 on my VPS (IP 149.210.167.9). Eventually I want to serve multiple domains, but for now I only want to handle 1 domain in particular: aforismo.eu. When you surf to the IP directly it shows me an Apache test page, so that works. When I ping aforismo.eu it shows me the correct IP, so I think the DNS is setup correctly. If I'm missing something trivial, please teach me :)

What I did so far to handle this domain:


I) I've created /etc/httpd/conf.d/site-aforismo.conf

<VirtualHost *:80> 
    ServerAdmin    webmaster@aforismo.eu 
    DocumentRoot   /var/www/aforismo.eu/public/ 
    ServerName     aforismo.eu
    ServerAlias    *.aforismo.eu 
    ErrorLog       logs/aforismo.error_log 
    CustomLog      logs/aforismo.access_log common
</VirtualHost>

II) Modified a few bits in /etc/http/conf/httpd.conf:

Include conf.d/*.conf

NameVirtualHost *:80

III) Afterwards I've restarted apache

service httpd restart

IV) Checking httpd -S results in:

wildcard NameVirtualHosts and _default_ servers:
_default_:443  vps.vanoosten.me (/etc/httpd/conf.d/ssl.conf:74)
*:80           is a NameVirtualHost
     default server aforismo.eu (/etc/httpd/conf.d/site-aforismo.conf:1)
     port 80 namevhost aforismo.eu (/etc/httpd/conf.d/site-aforismo.conf:1)
       wild alias *.aforismo.eu Syntax OK

But ... surfing to http://www.aforismo.eu (or http://aforismo.eu) does not work. Since it's not my everyday business, I'd sure miss something quite trivial, but I can't find out what it is. Can you help me a bit further? Much appreciated.

Was it helpful?

Solution 2

Update: As you guys suggested, it turns out to be a DNS issue. I thought I had created an A record to the given IP. But ... in the interface of my DNS provider I had to use the @-character for the domain itself instead of to really write it down. So what I really created was an A-record for aforismo.eu.aforismo.eu. Fixed (and next time I promise to read the manual :P)

OTHER TIPS

You may need to add Listen *:80.

You may also need to add UseCanonicalName off under <VirtualHost *:80>.

Edit:

Unless it's meant to be internal only, there is something wrong with your DNS. I can hit the IP but aforismo.eu doesn't resolve to anything.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top