server works after restart for 10 seconds then nothing...

oah

Well-Known Member
Jan 23, 2018
65
10
58
Iraq
cPanel Access Level
Website Owner
Hi
My server was working just fine ( CENTOS 7.6 xen hvm [host] v82.0.9
and it just went cold. I restarted the server and the webistes went back on for 10 seconds then I am getting ":


Network Error (tcp_error)
A communication error occurred: "Operation timed out"
The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.
I restarted the services apache, php-fpm but to no vail, when I do a hard server reset, the websites comeback to work for 10 seconds then they just stop, meanwhile the WHM panel is totally functional and even the service status is showing everything to be working as shown below:

Any ideas on where should I start checking? what commands, files, logs should I check ?




Service Information
The Service Information table only reports monitored services. You can enable service monitoring.

ServiceVersionStatus
cpanellogdup
cpdavdup
cphulkdup
cpsrvdup
crondup
dnsadminup
exim4.92-2up
ftpd1.0.47up
httpd2.4.39up
imap2.3.5up
ipaliasesup
lfdup
lmtpup
mailman2.1.27-4up
mysql5.7.27up
named0up
nscd0up
pop2.3.5up
queueprocdup
rsyslogd0up
spamd3.4.2up
sshd0up
System Information

System ItemDetailsStatus
Server Load0 (2 CPUs)
Memory Used18.04% (728,744 of 4,040,064)
Swap Used0% (0 of 0)
Disk Information

DeviceMount PointUsageStatus
/var/tmp/var/tmp0% (14,584 of 3,997,376)
/tmp/tmp0% (14,584 of 3,997,376)
//13% (12,999,828 of 103,079,180)
 
Last edited by a moderator:

oah

Well-Known Member
Jan 23, 2018
65
10
58
Iraq
cPanel Access Level
Website Owner
Update-1, I was testing on php pages, so I made a sub-domain and installed "elinks, which is a terminal based browser" and placed a plain html page inside one of the websites and tried to open it with elinks and it is just showing "request sent". I checked apache and the service is up and running.... so any ideas on where to check ( i will keep posting as I do more tests) by the way this is the output when checking if apache is running:
1566223947817.png

I find the line marked in red weird, any ideas on where to go next ?
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,304
363
Houston
Hello,

Based on that screenshot all services are up and running. Do you have a firewall management software such as CSF installed? If not you might try temporarily flushing iptables and checking the sites once more. It's odd that you'd be able to reach cPanel/WHM in this instance but worth exploring.

Do you have the sites on a different IP from cPanel/WHM?
 
  • Like
Reactions: oah

oah

Well-Known Member
Jan 23, 2018
65
10
58
Iraq
cPanel Access Level
Website Owner
Hi @cPanelLauren
You are right, AWS blocked the server from their firewall because of a page that seemed to be a "phishing" page on one of the domains.
I clarified the issue with them, and they removed the block. Back to normal.
@cPanelLauren U you can really help me in two things:

1- How can I start apache from command line and have it show in real time the requests as they come (if I knew how to do it then I would have easily figured out the requests were being blocked by AWS as nothing would have been delivered).

2- Can you guys please make a tutorial on how to change the Private IP address on AWS images that are restored from snapshots. Long story short:
I have a snap-shot of the server from AWS but that snapshot has the private IP address from the old machine, when I boot that image into a new machine, AWS assigns a new IP address (private) and I get into a sea of troubles as the WHM is not working, I had to hire a free lancer twice to do that "IP thing".
Note: I am not taking about the elastic IP in AWS as that one is easily transferable, I am talking about booting from an image which contains private IP address X while aws has assigned private IP Y to its LAN.
By the way, the scenario that I am referring to results in:
1566337708640.png

and I am not sure on where to start fixing it, shall I do it from
1- The NAT
2- change sites IP address
3- edit current IP address
4- DNS
5- do I have to rebuild apache with the new IP

If you guys can clarify where the private IP address is "hard-coded' into the WHM in which sections that would be great.
Thx :)
 
Last edited by a moderator:

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,304
363
Houston
Hi @oah

You can restart apache from the command line with the following:

Code:
/scripts/restartsrv_httpd
You can see the current requests and their status along with some other really useful information with the following:

Code:
apachectl --status
2- Can you guys please make a tutorial on how to change the Private IP address on AWS images that are restored from snapshots. Long story short:
I have a snap-shot of the server from AWS but that snapshot has the private IP address from the old machine, when I boot that image into a new machine, AWS assigns a new IP address (private) and I get into a sea of troubles as the WHM is not working, I had to hire a free lancer twice to do that "IP thing".
Note: I am not taking about the elastic IP in AWS as that one is easily transferable, I am talking about booting from an image which contains private IP address X while aws has assigned private IP Y to its LAN.
I can definitely look into getting something like this up though I'm unsure how different the process would be than the instructions here: Launch an AWS AMI Instance - cPanel Knowledge Base - cPanel Documentation - were you able to ask the administrator that performed the work for the exact steps?
 
  • Like
Reactions: oah

oah

Well-Known Member
Jan 23, 2018
65
10
58
Iraq
cPanel Access Level
Website Owner
Thx @cPanelLauren
The commands are definitely what I need.

As for the aforementioned tutorial that doesnot apply to my case for the following reason:
The tutorial assumes you have a fresh image while in the scenario that I am mentioning you have the following:
short-version:
Assume you have a server which is working just fine with its WHM. the server is running behind a nat and it has a private IP address of 10.10.10.2, lets just assume you did restart the machine and the IT guy tells you ur new IP address is 10.10.10.3 while the WHM was installed when the private IP address was 10.10.10.2. what would you do in such case?

Long-version:
1- A machine on AWS with WHM is running.
2- You take AWS-snap shot from that machine ==> great, but the snapshot has the private IP address of the current machine embedded into it.
3- When you create an Image from that snap-shot and LAUNCH that image into a machine, AWS will allocate a private IP address to the instance however, the WHM within the image is configured to the private IP address of the old machine.
4- As a result the WHM is accessible but none of the websites work.
5- Even after I re-assign the elastic IP from the old machine to the new one, I still have a private IP mis-match.
6- At this point I am lost as I look into my machine and see the old private IP address which was inhereted from the snap-shot all over the place, for starters I can see it in the NAT.
7- I have no clue on where to change it.
8- I can send you snap-shot pics for what is going on.
9- At this point if I don't hire a freelancer to fix the private IP address mismatch in my machine, the snap-shot image is worthless.
10- I was suggesting making a tutorial for that case.
11-THank you :)

Hi @oah

You can restart apache from the command line with the following:

Code:
/scripts/restartsrv_httpd
You can see the current requests and their status along with some other really useful information with the following:

Code:
apachectl --status


I can definitely look into getting something like this up though I'm unsure how different the process would be than the instructions here: Launch an AWS AMI Instance - cPanel Knowledge Base - cPanel Documentation - were you able to ask the administrator that performed the work for the exact steps?
 

oah

Well-Known Member
Jan 23, 2018
65
10
58
Iraq
cPanel Access Level
Website Owner
Hi @cPanelLauren
I checked the tutorial that you referred to " Launch an AWS AMI Instance - cPanel Knowledge Base - cPanel Documentation " but it doesn't cover my issue. The issue that arises with booting-up from an AWS snapshots is similar to the scenario below (if you answer the one below then you will solve the problem):

Assume you have a server which is working just fine with its WHM. the server is running behind a nat and it has a private IP address of 10.10.10.2, lets just assume you did restart the machine and the IT guy tells you ur new IP address is 10.10.10.3 while the WHM was installed when the private IP address was 10.10.10.2. what would you do in such case?

thx
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,304
363
Houston
Hi @oah


Thanks! I will look into getting a tutorial for this, right now we don't have anything for your situation specifically and unfortunately, I'm not familiar enough with the intricacies of AWS to provide advice on this. I'll look into it further and update you with my findings as soon as I can.


Thanks!
 
  • Like
Reactions: oah

oah

Well-Known Member
Jan 23, 2018
65
10
58
Iraq
cPanel Access Level
Website Owner
Hi @oah


Thanks! I will look into getting a tutorial for this, right now we don't have anything for your situation specifically and unfortunately, I'm not familiar enough with the intricacies of AWS to provide advice on this. I'll look into it further and update you with my findings as soon as I can.


Thanks!

Hi @cPanelLauren

I am pretty familiar with AWS and I can approximate the scenario to the case in the image below (regardless of AWS, assume it is just a dedicated server).

Assume I have a dedicated server running Centos along WHM. The server is running behind a NAT with a private IP address of 10.10.10.5, and lets just assume you did restart the machine and the IT guy tells you ur new IP address is 10.10.10.6 while the WHM was installed when the private IP address was 10.10.10.5. what should we/you do in such case?

1566746808727.png

Note after restarting the server, it has the new private IP address which is 10.10.10.6 while the public IP attached to the NAT is still the same, so the WHM is accessible via TELNET as well as with the browser BUT NONE of the websites work as it shows the page below:

1566746748406.png

If you provide such a tutorial, that will be awesome :)

thx again.
 

Attachments

Last edited: