Submitted by LeGiangAnh on Sun, 03/27/2016 - 10:17 Pro Licensee
Hi,
My Apache randomly stops and I cannot start it again. I said the address already in use. https://goo.gl/Osz905 I have to follow this post (first answer) to kill the process: http://askubuntu.com/questions/277162/apache-fails-to-start-address-alre... And then restart Apache by: service apache2 start
Then I follow the second answer to disable the port in ports.conf but the problem still exists. It show other error when I try to start via webmin: https://goo.gl/cKt31z
Please help me. It is very urgent for me.
Thanks, Giang Anh
Status:
Active
Comments
Submitted by andreychek on Sun, 03/27/2016 - 10:37 Comment #1
Howdy -- it sounds like the process may have gotten stuck.
You should be able to correct that by running these two commands:
killall -9 apache2
service apache2 start
Submitted by LeGiangAnh on Mon, 04/04/2016 - 02:11 Pro Licensee Comment #2
Hi,
Is this the permanent solution? Or I have to use these command every I have this issue?
Thanks, Giang Anh
Submitted by andreychek on Mon, 04/04/2016 - 09:25 Comment #3
Hmm, are you seeing that issue a lot?
That issue shouldn't be occurring frequently... if it is, we may need to try and troubleshoot what is causing the processes to lock up like that.
Submitted by LeGiangAnh on Sun, 04/10/2016 - 01:59 Pro Licensee Comment #4
Yes. I have this issue about 3-4 day/time. I have just happened as well.
Submitted by andreychek on Sun, 04/10/2016 - 09:50 Comment #5
Ah, that sounds very bad, that should definitely not happen. Are you perhaps on a VPS? If so, what is the output of "free -m"?
Also, do you see any errors or interesting messages in /var/log/apache2/error_log around the time that Apache is stopping?
Submitted by LeGiangAnh on Sun, 04/10/2016 - 13:27 Pro Licensee Comment #6
Hi,
Submitted by andreychek on Sun, 04/10/2016 - 13:36 Comment #7
Do you see any errors or interesting messages in /var/log/apache2/error_log around the time that Apache is stopping?
And if this is a VPS, what kind of VPS is it? For example, KVM, Xen, or OpenVZ?
Submitted by LeGiangAnh on Wed, 04/13/2016 - 13:55 Pro Licensee Comment #8
Hi,
The log here.
It's MS Azure Virtual Machine, not VPS.
Submitted by andreychek on Wed, 04/13/2016 - 15:45 Comment #9
Yikes, it looks like you're seeing some unusual Apache crashes.
What is the output of these commands:
dpkg -l 'apache*'
ls /etc/apache2/mods-enabled
Submitted by LeGiangAnh on Wed, 04/13/2016 - 21:22 Pro Licensee Comment #10
Hi,
Submitted by andreychek on Wed, 04/13/2016 - 21:38 Comment #11
Hmm, that all looks fairly normal.
When did this problem start occurring?
I've been doing some research on your problem, and it sounds like some people who were seeing that issue were using a PHP cache, such as Zend. Are you using any PHP caching modules for any of your domains?
Submitted by LeGiangAnh on Wed, 04/13/2016 - 21:48 Pro Licensee Comment #12
Hi,
It happened from around 2 months ago. I'm using PHP caching for my Joomla and Wordpress websites. Please let me know if you need root account of the server.
Thanks, Giang Anh
Submitted by andreychek on Wed, 04/13/2016 - 22:00 Comment #13
You appear to be seeing either an Apache bug, or a PHP bug.
What you might want to do is disable the PHP caching temporarily, to see if that resolves the problem that you're experiencing.
If it does resolve the issue, you may need to look into a different caching type.
Which type of PHP cache are you using, out of curiosity?
Submitted by LeGiangAnh on Wed, 04/13/2016 - 23:30 Pro Licensee Comment #14
I have just disable OPcache in my php.ini file. Will keep you updated.
Submitted by LeGiangAnh on Thu, 04/14/2016 - 03:12 Pro Licensee Comment #15
It still happens. 5 times today.
Submitted by andreychek on Thu, 04/14/2016 - 09:23 Comment #16
And just to verify, you removed those caching modules from all domains that are using them?
Submitted by LeGiangAnh on Thu, 04/14/2016 - 09:29 Pro Licensee Comment #17
I disable it in php.ini file in my server. And yes, it will be removed on all sites.
Submitted by andreychek on Thu, 04/14/2016 - 09:58 Comment #18
Just to verify -- are you having any problems with any other services running on your server?
If not, then it's either an Apache bug, or a PHP bug, that you're experiencing.
There isn't an easy way to resolve that.
You could always post a note in the Ubuntu bug tracker regarding that, but they're going to ask what modules you're using, as it's very rare to see Apache crash like that.
So what you could always try, is to review both your Apache modules, as well as your PHP modules, and remove any that you don't need.
For starters, what is the output of this command:
dpkg -l 'php*'
Also, how many domains are running on your server there?
Submitted by LeGiangAnh on Thu, 04/14/2016 - 10:45 Pro Licensee Comment #19
Hi,
I don't have any other issue and this problem happens randomly. Also I'm not familiar with Ubuntu nor Ubuntu bug tracker since from the first time I began with Linux, I use Virtualmin under your support :)
I'm running around 6 websites under this server. However, this is a powerful server with 16 core strong CPU and 64GB RAM
Submitted by andreychek on Thu, 04/14/2016 - 11:03 Comment #20
What you're seeing there is very odd!
Ubuntu 14.04 is one of the more popular distributions for running Virtualmin, and we've never seen crashes like you're experiencing.
I was actually wondering if maybe it were a hardware issue, but if you aren't seeing problems with other services, that is unlikely.
I double-checked the Apache modules that are loaded, and noticed one that stood out -- the socache_shmcb module.
You may want to try disabling that to see if that helps... that can be disabled with this command:
a2dismod socache_shmcb
After running that, restart Apache.
Submitted by LeGiangAnh on Thu, 04/14/2016 - 11:49 Pro Licensee Comment #21
Hi,
I tried to disable that module but it requires ssl module to be disabled. After disable those 2 modules. I cannot restart apache:
Submitted by andreychek on Thu, 04/14/2016 - 13:24 Comment #22
Okay, I didn't realize the SSL module depended on it. It sounds like you'll need to re-enable both socache_shmcb and ssl.
I'll do some digging to see if I can get any other ideas.
Submitted by abdulmalik on Sun, 07/16/2017 - 02:04 Comment #23
This Solve it for me: For Debian based systems :
Replace ' apache2 reload ' with ' apache2 restart ' in /etc/logrotate.d/apache2 file.
For RHEL based systems
Replace ' httpd reload ' with ' httpd restart ' in /etc/logrotate.d/httpd file.
If the above steps do not help on Debian/Ubuntu OSes, edit log rotation settings of apache in /etc/logrotate.d/apache2 file. Change " /etc/init.d/apache2 reload " to " /etc/init.d/apache2 restart ":
cat /etc/logrotate.d/apache2.... /etc/init.d/apache2 restart > /dev/null;