Apache Configuration - DNS

Posted October 24, 2014 4.6k views

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

$TTL    1800
            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.

        DocumentRoot /var/www/

Thanks in advance

1 comment

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
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 (/etc/apache2/sites-enabled/ 000-default.conf:1)
    port 80 namevhost (/etc/apache2/sites-enabl ed/000-default.conf:1)
    port 80 namevhost (/etc/apache2/sites-enabl ed/
    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/”
    Define: DUMPVHOSTS
    Define: DUMP
    User: name=“www-data” id=33 not
    Group: name=“www-data” id=33 not_used