LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   nginx and ssh server does not respond (Debian6, Ispconfig3, Bind) (https://www.linuxquestions.org/questions/linux-server-73/nginx-and-ssh-server-does-not-respond-debian6-ispconfig3-bind-4175430084/)

SkarmoutsosV 10-02-2012 11:06 AM

nginx and ssh server does not respond (Debian6, Ispconfig3, Bind)
 
I know nothing about nginx but I have installed it together with ISPConfig3 to create a "perfect server".

The server was working fine for about 3 months. A long power failure drained UPS batteries and the server powered-off without a UPS shutdown signal.

When the server turned on again, it could not resolve dns queries. I ssh to the server and it looked like bind was not running. I browse to the ISPconfig using the static IP and ISPconfig's web interface was showing that all services was running.

So I decided to reinstall bind but after a second thought I did an
Code:

aptitude -y upgrade
Upgrade finished and server started to resolve dns queries. Now the web server does not respond and putty informs me that the connection is rejected.

I would like some suggestions to be able to recover the server.

Thank you.

unSpawn 10-02-2012 11:54 AM

Powering off a machine incorrectly can lead to all sorts of file system inconsistencies and errors, some of which may remain hidden until it is too late. Especially in the event of a failed emergency shutdown you should pro-actively check file systems before commencing. Also when an important subsystem fails the default approach should be to troubleshoot the issue and find out the reason why and not simply reinstall the software. Finally while vendors, providers and resellers want you to believe that using a web-based management panel makes Linux "easy" without any knowledge its usage should be founded on basic OS knowledge and admin skills and not to shield yourself from having to learn about and deal with it.

Quote:

Originally Posted by SkarmoutsosV (Post 4795048)
the web server does not respond and putty informs me that the connection is rejected. I would like some suggestions to be able to recover the server.

If the server is hosted in a remote location and the panel and SSH are your only means of access then no other options remain: ask your provider to reset it or restore a backup.

SkarmoutsosV 10-02-2012 01:45 PM

Thank you very much for your reply. It was very attractive to replace bash commands and nano with a nice web interface. It was attractive to replace Apache with nginx for use at older hardware. Unfortunately that was wrong. My omissions (proper NUT configuration) were critical and my knowledge is not enough.

The server is physically reachable but I felt I should get some advice before try something more.

So, any troubleshooting advices are very welcome.

unSpawn 10-02-2012 03:05 PM

Quote:

Originally Posted by SkarmoutsosV (Post 4795273)
It was very attractive to replace bash commands and nano with a nice web interface. It was attractive to replace Apache with nginx for use at older hardware. Unfortunately that was wrong.

No, replacing SW itself isn't wrong. It's just that "control panel" doesn't necessarily equal "control" ;-p


Quote:

Originally Posted by SkarmoutsosV (Post 4795273)
The server is physically reachable

OK. Start by booting the machine into runlevel 1 or use a Live CD like KNOPPIX or the OS installer disk in rescue mode. Go to the /var/log directory, sort by date and check the most recent files like messages, syslog, secure, etc, etc for clues. If all looks OK and if you didn't use a CDROM you could bring it up to runlevel 3 (multi-user, networking) with "telinit 3" and check the logs again.

SkarmoutsosV 10-02-2012 05:44 PM

I booted at runlevel 1 but could not find any useful information at log files. Anyway while running "telinit 2", I have noticed that server stopped responding while showing it was trying to start bind. So, I rebooted and it stopped responding while it was trying to start ClamAV (which was the next message line after "Starting bind"). Finally, I re-booted once more and this time the boot process finished normally.

Now dns resolves queries, ssh works, nginx responds with a default web page, ISPconfig interface and it's sites are not reachable. All web content files are reachable thru putty.

Is it a hard disk problem?

unSpawn 10-02-2012 08:28 PM

Quote:

Originally Posted by SkarmoutsosV (Post 4795466)
I (..) could not find any useful information at log files. (..) ISPconfig interface and it's sites are not reachable. (..) Is it a hard disk problem?

Do yourself a favor and run reboot the machine with the "forcefsck" boot arg to check all file systems just to make sure. When done run the system and daemon logs through Logwatch (the "--numeric --detail 5 --service all --range All --archives --output unformatted --save /var/log/logwatch.log" args should do) and "less /var/log/logwatch.log". If you don't know what you're looking for that's probably easier. If the Logwatch report has clues wrt services not working, fine, else we'll troubleshoot things until we do know.

SkarmoutsosV 10-03-2012 06:03 PM

Force filesystem check at reboot:
Code:

shutdown -rF now
did not show any problems about filesystem.

I should mention that some logfile had a clue about named not running, but that was exactly after power failure and it disappeared after "aptitude -y upgrade".

syslog and daemon.log logfile analysis:
Code:

logwatch --logfile syslog --logfile daemon.log --numeric --detail 5 --service all --range All --archives --output unformatted --filename /var/log/logwatch.log
showed some messages like:
Quote:

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
so I realized that my previous post was not accurate. The default web page was generated from apache and not nginx. When I ran the "aptitude -y upgrade" command somehow the apache started. I stopped apache and started nginx using the following commands:
Code:

apachectl -k stop
service nginx restart

Now the system works as expected.

How can I prevent apache to restart itself after an upgrade? Any more suggestions?

unSpawn 10-03-2012 07:17 PM

Quote:

Originally Posted by SkarmoutsosV (Post 4796481)
Force filesystem check at reboot (..) did not show any problems about filesystem.

That's good to hear.


Quote:

Originally Posted by SkarmoutsosV (Post 4796481)
I should mention that some logfile had a clue about named not running, but that was exactly after power failure and it disappeared after "aptitude -y upgrade".

Hmmm. And was that all the report showed? No other problems or anomalies?


Quote:

Originally Posted by SkarmoutsosV (Post 4796481)
Now the system works as expected.

All is well that ends well...


Quote:

Originally Posted by SkarmoutsosV (Post 4796481)
How can I prevent apache to restart itself after an upgrade?

A web server should only contain what SW you use right now so I'd opt for removing it if you don't need it.


Quote:

Originally Posted by SkarmoutsosV (Post 4796481)
Any more suggestions?

Other than making regular backups and ensuring you protect your assets (hardening), no.

SkarmoutsosV 11-13-2012 02:52 AM

Thank you unSpawn, your posts were really helpful.


All times are GMT -5. The time now is 02:24 PM.