Can't acess my site through url, only by ip

April 3, 2017 4.9k views
Apache DNS Ubuntu 16.04

I have a brand new Digital Ocean (DO) running Ubuntu 16.04 (this was a Ubuntu 16.04 with LAMP). I’ve installed Wordpress on it using the default configuration.

It’s been 3 days since my DNS are pointing to DO servers, but I can’t access my site through url, but I can access it by typing the IP on address bar.

I’ve add a A record with @ pointing to my droplet, then when I type my url it changes to my IP and I can access the site. Off course, I don’t want this configuration.

My domain is novetatd.com.br

My apache configuration file is:

<VirtualHost *:80>
    ServerName novetatd.com.br
    ServerAlias www.novetatd.com.br

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        <Directory /var/www/html/>
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        <IfModule mod_dir.c>
            DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
        </IfModule>

</VirtualHost>

At DO domain panel I have only 3 records with type NS, hostname novetatd.com.br, value ‘directs nsX.digitalocean.com.’ (X from 1 to 3), TTL 1800

What I’m missing?

4 Answers

What’s the value of WordPress Address URL and Site Address URL when you look here?
http://novetatd.com.br/wp-admin/options-general.php

Your domain has no A records.

Hi @JonathanBatista
In the DO control panel, in the DNS section, you need to add A-records pointing to you server for “@” and for “www”

You say “I’ve add a A record” - but where have you done that?

How!
The problem was WORDPRESS!
I don’t know why but Wordpress configurations was pointing to my ip instead of my domain

It is now solved!

Thanks!

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!