I can access my site with IP but not with domain name

September 15, 2017 751 views
LAMP Stack Ubuntu 16.04

Hello

I am new here and i have some problems setting up my custom domain. I can access it via server ip, but i cant access it with domain name. Here is screenshot on my domain settings.

Screenshot

Thanks for help

2 Answers

That's because you need to add a vhost.
https://httpd.apache.org/docs/2.2/vhosts/

  • I added vhost.. but still not working

    • Can you provide any access logs and vhost?

      • This is my virtual host

        <VirtualHost *:80>
                ServerAdmin matej@matejhladnik.com
                ServerName matejhladnik.com
                ServerAlias www.matejhladnik.com
                DocumentRoot /var/www/html/matejhladnik.com
                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined
        </VirtualHost>
        
        

        I dont know where i can find access logs.. i am new into this, so i am learning on the go.

        • /var/logs/apache2

          • Here are couple of last lines in access.log

            104.238.248.15 - - [16/Sep/2017:01:24:35 +0000] "GET / HTTP/1.1" 200 1814 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)"
            167.114.228.206 - - [16/Sep/2017:01:38:07 +0000] "GET / HTTP/1.0" 200 1833 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:51.0) Gecko/20100101 Firefox/51.0"
            95.213.177.123 - - [16/Sep/2017:01:52:48 +0000] "CONNECT check.proxyradar.com:80 HTTP/1.1" 400 0 "-" "-"
            185.110.132.239 - - [16/Sep/2017:02:42:08 +0000] "GET / HTTP/1.1" 200 1833 "-" "Scanbot"
            110.88.45.18 - - [16/Sep/2017:03:40:28 +0000] "GET / HTTP/1.1" 200 1870 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1"
            104.238.248.15 - - [16/Sep/2017:04:26:07 +0000] "GET / HTTP/1.1" 200 1814 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)"
            139.162.114.70 - - [16/Sep/2017:06:11:04 +0000] "GET / HTTP/1.1" 200 1833 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/5$
            158.69.229.134 - - [16/Sep/2017:06:27:02 +0000] "GET / HTTP/1.1" 200 1870 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10116) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2752.0$
            95.213.177.124 - - [16/Sep/2017:06:31:01 +0000] "CONNECT check.proxyradar.com:80 HTTP/1.1" 400 0 "-" "-"

Hey, just wanted to let you know, that my site is now working.. I had to wait for DNS to change for 2 days.. didnt know that it takes so long.

Thanks for help anyway.

  • Make sure you're using a static IP for your AAAA record! You probably already knew that, but I thought I should mention it just in case.

Have another answer? Share your knowledge.