Apache Configuration - DNS

October 24, 2014 1.1k views

Hello, sorry to bother you all.
I hope you guys can help me out on this one.
So when I type in www.transportesantamaria.com.mx it goes directly to the page but when dropping off the www and just like http://transportesantamaria.com.mx
It takes me to the folder directory. I have no .htaccess configured and my DNS configuration looks like this:

$TTL    1800
@       IN  SOA NS1.DIGITALOCEAN.COM.   hostmaster.transportesantamaria.com.mx. (
            1413392660 ; last update: 2014-10-15 17:04:20 UTC
            3600 ; refresh
            900 ; retry
            1209600 ; expire
            1800 ; ttl
             IN      NS      NS1.DIGITALOCEAN.COM.
                     NS      NS2.DIGITALOCEAN.COM.
                     NS      NS3.DIGITALOCEAN.COM.
            MX 1    ASPMX.L.GOOGLE.COM.
            MX 5    ALT1.ASPMX.L.GOOGLE.COM.
            MX 5    ALT2.ASPMX.L.GOOGLE.COM.
            MX 10   ASPMX2.GOOGLEMAIL.COM.
            MX 10   ASPMX3.GOOGLEMAIL.COM.
@   IN A
www CNAME   @
*   CNAME   @

Also here is the .conf file

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port th                                                                             at
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.

        ServerName transportesantamaria.com.mx
        ServerAlias www.transportesantamaria.com.mx
        ServerAdmin servicios@transportesantamaria.com.mx
        DocumentRoot /var/www/transportesantamaria.com.mx/public_html

Thanks in advance

1 comment
1 Answer

run this:

service apache2 restart # Ubuntu/Debian


service httpd restart #CentOS/Fedora/RHEL

If it is still broken, paste the output of this command in here so we can see what's going on:

apache2ctl -S #Ubuntu/Debian


httpd -S #CentOS/Fedora/RHEL
  • Hello, thanks for replying back!
    I already tried it before with no sucess.
    So here I paste the info with the command:

    VirtualHost configuration:
    *:80 is a NameVirtualHost
    default server transportesantamaria.com.mx (/etc/apache2/sites-enabled/ 000-default.conf:1)
    port 80 namevhost transportesantamaria.com.mx (/etc/apache2/sites-enabl ed/000-default.conf:1)
    port 80 namevhost transportesantamaria.com.mx (/etc/apache2/sites-enabl ed/transportesantamaria.com.mx.conf:1)
    alias www.transportesantamaria.com.mx
    ServerRoot: "/etc/apache2"
    Main DocumentRoot: "/var/www"
    Main ErrorLog: "/var/log/apache2/error.log"
    Mutex mpm-accept: usingdefaults
    Mutex watchdog-callback: using
    Mutex default: dir="/var/lock/apache2" mechanism=fcntl
    PidFile: "/var/run/apache2/apache2.pid"
    Define: DUMPVHOSTS
    Define: DUMP
    User: name="www-data" id=33 not
    Group: name="www-data" id=33 not_used


Have another answer? Share your knowledge.