Getting error "This site can’t be reached"
Hello,
I am using Linode server with server pilot. Last night i had deleted few old apps from server pilot. Later on i got all website down which were running on it. i have disabled all the plugins and also updated latest version of php but unable to resolve the issue. Tried several times with different methods but totally failed. My all websites are down.
Anyone can help/guide please?
Here is the link of a wesbite for your necessary action please:
https://bestguideline.com/
10 Replies
I ran an nmap scan of the IP address for that website's A record (172.104.19.247):
$ nmap -sV 172.104.19.247 -p 22,80,443 --reason
Starting Nmap 7.91 ( https://nmap.org ) at 2022-12-16 04:37 EST
Nmap scan report for li1833-247.members.linode.com (172.104.19.247)
Host is up, received conn-refused (0.038s latency).
PORT STATE SERVICE REASON VERSION
22/tcp open ssh syn-ack OpenSSH 7.2p2 Ubuntu 4ubuntu2.10 (Ubuntu Linux; protocol 2.0)
80/tcp closed http conn-refused
443/tcp closed https conn-refused
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 0.89 seconds
When an nmap scan returns a message that a port is closed, that means it didn't find an active service listening to networking traffic on that port. Essentially, it looks like your web server service isn't running, whether it be Apache, NGINX, or whatever it might be. Running a curl to that IP address also shows no connection on port 80, the default port for HTTP traffic:
$ curl -IL 172.104.19.247
curl: (7) Failed to connect to 172.104.19.247 port 80: Connection refused
If you rebooted the Linode, it's possible that the web server wasn't enabled to start at boot. You can start the service with a command like:
sudo systemctl start httpd
(Apache), or
sudo systemctl start niginx
(NGINX)
To enable the service to start next time the Linode reboots:
sudo systemctl enable $service
, with $service
being whichever web server, or any service really, you want to boot up.
Thank you for your immediate response.
Just tried with the provided commands but failed to enable.
Error shared below. kindly guide
root@localhost:~# sudo systemctl start niginx
Failed to start niginx.service: Unit niginx.service not found.
root@localhost:~# sudo systemctl start httpd
Failed to start httpd.service: Unit httpd.service not found.
After Ran netstat, we got following output
root@localhost:~# netstat -ltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 localhost:mysql : LISTEN 889/mysqld
tcp 0 0 localhost:1119 : LISTEN 877/hs-agent
tcp 0 0 localhost:81 : LISTEN 970/httpd
tcp 0 0 localhost:smtp : LISTEN 1180/master
tcp 0 0 *:ssh *:* LISTEN 1592/sshd
tcp6 0 0 [::]:ssh [::]:* LISTEN 1592/sshd
root@localhost:~# sudo systemctl start httpd
Failed to start httpd.service: Unit httpd.service not found.
On Linux distros, the apache web server is usually called apache2. I'm afraid @watrick has given you some bad advice… The correct command is:
sudo systemctl start apache2
If you're going to use https you need to configure your VirtualHosts to use port 443:
<VirtualHost _default_:443>
...
...
...
</VirtualHost>
You're going to need a TLS certificate too.
Re:
tcp 0 0 localhost:81 : LISTEN 970/httpd
Your web server is only listening to port 81 on localhost. This means it will only accept requests from browsers running on localhost. You need to fix this in your server configuration. For apache, you need to change the Listen directive from whatever you have to
Listen 80
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
I added whitespace for readability.
-- sw
Hello Thank you for the response.
Current status of my server is inactive(dead), that's why i can be able to run any command.
#
root@localhost:~# sudo systemctl status nginx
● nginx.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
#
Further if i try to start nginx it shows below error(Failed to start nginx.service: Unit nginx.service not found)
root@localhost:~# sudo systemctl start nginx
Failed to start nginx.service: Unit nginx.service not found.
#
Similarly if i run below command it shows following error.
root@localhost:~# sudo systemctl reload nginx
Failed to reload nginx.service: Unit nginx.service not found.
#
I got this error(Unit nginx.service not found) on every command.
Would you please guide me, how can start/reload nginx?
Thank you
Is nginx even installed? The lack of the systemd service for starting/stopping/reloading it seems to indicate that.
Did you try
sudo systemctl start apache2
???
Have you tried restoring a backup of the system from a time before you did whatever it is that you did?
-- sw
Yeah several times I did but shows following error
root@localhost:~# sudo systemctl start apache2
Failed to start apache2.service: Unit apache2.service not found.
root@localhost:~#
No I haven't try to restore any backup
Yes please
You have to do this. I'm just a Linode user like you. Also, Linode support doesn't have access to your Linode so they can't do it either.
See: https://www.linode.com/docs/products/storage/backups/guides/restore-to-an-existing-linode/
You need to make sure that the backup you restore is dated Dec 16th…the date of your first post in this thread.
-- sw