Moved Domain Name from blogger to wordpress. Getting 404 error

October 20, 2018 747 views
DNS Ubuntu 18.04

Hi. I moved my site from blogger to wordpress and just moved the domain earlier today. I've been getting trouble since I've move the domain name to DO. The site works and goes down intermittently. The site gives an 404 error for an hour or so and then randomly works alright again and then again shows a 404 error without me touching anything anywhere, which is quite weird. This happened 2-3 times and now the site is down since over 12 hours. I have used DO + namesilo before and never faced such an issue.

Got a reply from the support team after 7-8hours! saying

[This appears to be directly impacted by the application your web server is trying to serve. We have a community article that can help provide guidance on general web server troubleshooting:
https://www.digitalocean.com/community/tutorials/how-to-troubleshoot-common-site-issues-on-a-linux-server](http://)

How a simple addition of a domain name to a working droplet can cause such a big issue is beyond me. Anyways going through that guide.

  1. Check the Logs

[My error.log file in apache

[Sat Oct 20 06:25:03.254865 2018] [mpm_prefork:notice] [pid 19446] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Sat Oct 20 06:25:03.254898 2018] [core:notice] [pid 19446] AH00094: Command line: '/usr/sbin/apache2'
[Sat Oct 20 06:31:28.231070 2018] [mpm_prefork:notice] [pid 19446] AH00169: caught SIGTERM, shutting down
[Sat Oct 20 06:31:28.428436 2018] [mpm_prefork:notice] [pid 8334] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Sat Oct 20 06:31:28.428512 2018] [core:notice] [pid 8334] AH00094: Command line: '/usr/sbin/apache2'
[Sat Oct 20 06:32:19.729556 2018] [mpm_prefork:notice] [pid 8334] AH00169: caught SIGTERM, shutting down
[Sat Oct 20 06:32:19.865461 2018] [mpm_prefork:notice] [pid 8379] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Sat Oct 20 06:32:19.865536 2018] [core:notice] [pid 8379] AH00094: Command line: '/usr/sbin/apache2'
](http://)

  1. Is your Web Server Installed?

Yep? I used the one click wordpress installation

  1. Is your Web Server Running? sudo netstat -plunt | grep apache2

Yep.

  1. Is the Syntax of your Web Server Configuration File Correct? apache2ctl configtest

yep

  1. Are the Ports you Configured Open? sudo nc -z 111.111.111.111 80

Yep

  1. Are your DNS Settings Directing you to the Correct Place? host -t A example.com

yep

  1. Make sure your Configuration Files Also Handle your Domain Correctly

Done. Added servername and serveralias. restarted apache. still getting the error.

  1. Does the Document Root Point to the Location of your Files?

yep

  1. Is your Web Server Serving the Correct Index Files?

Added the below code and restarted no change

<Directory /var/www/html>
DirectoryIndex index.html index.php
</Directory>

  1. Are the Permissions and Ownership Set Correctly?

Did not mess around with this. Would want to be messing up file permissions.

  1. Are you Restricting Access through your Configuration Files?

Looks all good here.

  1. If you have a Database Backend, is it Running? sudo netstat -plunt | grep mysql

Yes

  1. If you have a Database Backend, can your Site Connect Successfully? / Is your Web Server Configured to Pass Dynamic Content to a Script Processor?

come on. i've added a domain before to a droplet. it took minutes. If a DO technician could just look under the hood as to what the problem is, my site wouldnt be down for so long. It's been down for nearly 18 hours now. Can someone help me out with this?

2 Answers

The reason it works and then stops working intermittently is due to the nature of DNS propagation for your domain. It's because the old one works but not on DO. So the 404 might be the permanent error until it's resolved. Try providing the domain name, DO server IP, etc. A closer look is definitely needed.

  • Domain name: hairstylo.com

    DO server IP: 142.93.251.67

    Wordpress 1 click install on Ubuntu 18.04 at NYC1

    Let me know if you need more information

    • It appears to be working. I don't get any 404. Is there any page in particular that's showing the 404?

      • Doesn't work for me. This is what I get https://imgur.com/a/nJZDLW0

        Also I used dnschecker.org and the DNS seems to have propogated everywhere except NYC. Which is where my DO is hosted. It's been over 36 hours now, which is very weird. DNS usually propogates within 7-8 hours. https://imgur.com/a/NOpirzs

        • This is going to seem weird but try this link: http://hairstylo.com./

          The domain has a trailing dot to see if it invalidates the local cache. Or at least trigger an actual DNS query to the SOA. Does it help?

          Also try doing a dig/nslookup from your local machine. That will show you how long you have to wait to get the latest records:

          nslookup -debug hairstylo.com
          
          dig hairstylo.com
          

          Ex:

          $ nslookup -debug hairstylo.com
          Server: 127.0.1.1
          Address: 127.0.1.1#53


          QUESTIONS:
          hairstylo.com, type = A, class = IN
          ANSWERS:
          ->  hairstylo.com
          internet address = 142.93.251.67
          **ttl = 3564**
          AUTHORITY RECORDS:
          ADDITIONAL RECORDS:
          

          Non-authoritative answer:
          Name: hairstylo.com
          Address: 142.93.251.67

          or dig:

          $ dig hairstylo.com

          ; <<>> DiG 9.10.3-P4-Ubuntu <<>> hairstylo.com
          ;; global options: +cmd
          ;; Got answer:
          ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7469
          ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

          ;; OPT PSEUDOSECTION:
          ; EDNS: version: 0, flags:; udp: 4096
          ;; QUESTION SECTION:
          ;hairstylo.com. IN A

          ;; ANSWER SECTION:
          hairstylo.com. 3471 IN A 142.93.251.67

          ;; Query time: 4 msec
          ;; SERVER: 127.0.1.1#53(127.0.1.1)
          ;; WHEN: Sun Oct 21 00:28:47 CDT 2018
          ;; MSG SIZE rcvd: 58

          • This is going to seem weird but try this link: http://hairstylo.com./
            
            The domain has a trailing dot to see if it invalidates the local cache. Or at least trigger an actual DNS query to the SOA. Does it help?
            
            

            Yep, this works. The site loads perfectly.

            Here is nslookup

            nslookup -debug hairstylo.com
            Server:     127.0.0.53
            Address:    127.0.0.53#53
            
            Non-authoritative answer:
            Name:   hairstylo.com
            Address: 142.93.251.67
            
            

            here is dig

            ; <<>> DiG 9.11.3-1ubuntu1.2-Ubuntu <<>> hairstylo.com
            ;; global options: +cmd
            ;; Got answer:
            ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19774
            ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
            
            ;; OPT PSEUDOSECTION:
            ; EDNS: version: 0, flags:; udp: 65494
            ;; QUESTION SECTION:
            ;hairstylo.com.         IN  A
            
            ;; ANSWER SECTION:
            hairstylo.com.      2944    IN  A   142.93.251.67
            
            ;; Query time: 0 msec
            ;; SERVER: 127.0.0.53#53(127.0.0.53)
            ;; WHEN: Sun Oct 21 11:14:42 IST 2018
            ;; MSG SIZE  rcvd: 58
            
            
            
            
          • And now it's down again even for http://hairstylo.com./

            When the DNS goes down on the second Holtsville NY server, my site goes down. When I checked earlier the DNS was down on the 1st holtsville server but showed a green tick for the second holtsville, NY server and hence the site worked.

            Now it's showing a green tick for the first and is down for the second Holtsville server and the site won't load

Have another answer? Share your knowledge.