apache and log rotate, ubuntu 16.04

4 posts / 0 new
Last post
#1 Sun, 05/14/2017 - 08:43
Arvi89

apache and log rotate, ubuntu 16.04

Hello,

I had a problem, every X days (didn't notice when exactly), my apache would restart, but while it would still be on, the systemctl status apache2.status would return me not running, and I wouldn't be able to reload or restart because it believed it was not running.

My colleague made a search and apparently the problem is on Ubuntu 16.04, after a logrotate, a graceful (or whatever we use, I don't remember what he told me and I don't have the link he found) would not properly restart apache2. It works, but the system will think it's down.

Sun, 05/14/2017 - 09:14
unborn
unborn's picture

@Arvi89

Hi, well the date you can found in your apache logs in folder /var/log/folder/...log you need and I think you can go way back.. search when the apache had the problem and have look what was the problem.

If you restart the apache and your system will still thinks its down and you know its not (apache is running and working) then I would suggest using different distro aka centos or debian or something more stable. Just have good search on what distro si good and well stable and robust for server - or on other hand ask ubuntu community about this issue. I did try to use ubuntu few times for server but always some unexpected issues and when ask the community I had luck with some amateur results but nothing official or proper reply from canons regards anything - serious in business. I wish you lot of patients with ubuntu community and ubuntu it self.

Configuring/troubleshooting Debian servers is always great fun

Sun, 05/14/2017 - 18:49 (Reply to #2)
Arvi89

No, I'm fine with Ubuntu server, been using that for 4 years, it's perfect (and I really don't centos), here is just the way to restart apache used in log rotate the problem. I'll ask my colleague later what was the link he found, but I'll keep ubuntu server for sure ^^

Sun, 05/14/2017 - 13:31
CEEWorld

Spam assassin can have a similar problem on Ubuntu 16.04. When you set start at boot time will show in the webmin menus yet after a restart will not actually have restarted to get spamassassin to work properly and to start on reboot you need to enter from a command line

sudo systemctl enable spamassassin.service

It may be that you are having a similar issue with Apache in this instance so it would be worth trying the following via command line

sudo systemctl enable apache2.service

This should make apache2 start at reboot or startup.

Hope it helps.

Topic locked