PDA

View Full Version : [ubuntu] 12.04 Upgrade - Apache Errors



grpace
May 16th, 2012, 04:10 PM
I have just upgraded from 10.04 to 12.04. The upgrade has killed my installation of Apache.

The errors I get are:
-----
* Starting web server apache2
/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
[Wed May 16 09:04:14 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
-----

1st) I had Apache working fine on 10.04.
2nd) I did not have any Virtual Hosts defined.
3rd) Why did the OS Upgrade even mess with the Apache Server ???

What has happened here ?? How can I fix it ???

Thank you in advance.

grpace

grpace
May 16th, 2012, 07:33 PM
Look... This 12.04 is an LTS... Long Term Support...
The installation of this killed my server...

I expect some support...

Why did this happen???
Why did Ubuntu upgrade mess with Apache ???

How do I fix it???
I need some answers !!

Cadeyrn
May 16th, 2012, 11:13 PM
I just now ran into the same errors after a fresh install of 12.04, and it seems that I have to type

sudo service apache2 restart
rather than

service apache2 restart
for apache2 to restart with no problems.

I guess something about the service command in 12.04 makes it require sudo now?

thomasreggi
May 17th, 2012, 10:48 AM
I'm getting this issue too.

apache2ctl -S


/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)

running

sudo service apache2 restart

and

service apache2 restart

both don't work

they both return


* Restarting web server apache2
Action 'start' failed.
The Apache error log may have more information.

rpms
May 19th, 2012, 12:45 AM
Tried just now to access my website and same problems for me.

Tried to restart apache and got ..
--------------
service apache2 restart
* Restarting web server apache2 /usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
----------

I will watch this post for help and provide it if I find an answer. Good luck folks :)

rpms
May 19th, 2012, 01:49 AM
Hey guys, very weird. When I posted at 1st I could not access the websites on my server. Now I can. So I restarted apache2 and guess what?


/usr/sbin/apache2ctl: 87: ulimit: error ... etc.

Ya, the very same. But the server answers and ..

service apache2 status
Apache2 is running (pid ####)

I am staying on this until an answer comes.
Googlebot found my own website before I did says the apache logs.

rpms
May 19th, 2012, 06:53 PM
Answer came. Thanks to google and the website http://ubuntuforum-br.org/index.php?topic=94983.15. It translates well from Portuguese.

Now the terminal reports ..
service apache2 restart
* Restarting web server apache2
... waiting [ OK ]

Nice!:KS

Now the terminal reports ..
service apache2 restart
* Restarting web server apache2
... waiting [ OK ]

I had choosen to keep the old apache2.conf file during upgrade.
old file: /etc/apache2/apache2.conf
upgrade version: /etc/apache2/apache2.conf.dpkg-dist
I simply commented out one of my custom changes to the old file like so ..

# @Myself: after phpmyadmin install per ubuntu LAMP guide ..
#Include /etc/phpmyadmin/apache.conf

rpms
May 20th, 2012, 07:01 PM
Well .. today it's back. The problem in my case was temporarily gone. I made no changes and when I restarted to test things this morning the problem is back.

What is the answer? I don't know. Seemed I did.

rpms
May 20th, 2012, 11:44 PM
Yes!!! .. I am a proven fool. Oooops, I highly suspect I am a victim of not remembering that root and other users produce different results.

That is,

sudo service apache2 restart # no errors
service apache2 restart # errors, oppps!

grpace
May 21st, 2012, 11:45 PM
Hi, All... I'm the OP on this thread.

When upgrading to 12.04, I saw a message during the upgrade process... As best as I can remember... Apache2 is broken. We're not restarting it. That made me wonder why, so I started digging to try to find out why. I *was* using sudo to start the server.

The important errors:

#1:
-----
* Starting web server apache2
/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
-----
Something is wrong here... And no explanation as to what to look for.

#2:
-----
[Wed May 16 09:04:14 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
-----
I was not using Virtual Hosts!
After some digging, I found that NameVirtualHosts was defined in ports.conf.
Comment-out that line and that error went away.

#3:
-----
(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
-----
There is a mysterious error going on here. On first glance, Permission denied, it would appear that the server was not being started by a root user... But I was !

However, it seems that after a reboot the server starts and runs silently as a service... with no errors reported on the boot. But, that doesn't explain the errors. I *was* using sudo to try to start the server. By the way... It runs "hound dog slow" compared to 10.04.

Now... It's my thoughts that is not a deliberate thing on the part of the Ubuntu team. I think during the upgrade process, they try to hook us up with the latest version of Apache. It's my thinking that version of Apache has these errors... Not the Ubuntu team themselves.

But, still... My main point to begin with... An OS upgrade should not be messing with Apache. If we want to upgrade the Apache server, then we can do that ourselves.

By the way...
Would changing ownership of the apache2 folder and all sub-folders/files to myself as the owner instead of "root being the owner" prevent this from happening in the future ??

grpace

P.S. Thank all of you that has posted with the same errors. That lets me know I'm not delusional... At least not yet !

rpms
June 8th, 2012, 07:05 PM
Hello grpace (http://ubuntuforums.org/member.php?u=1103914). Sorry to hear you are still having the errors you reported.
I have experienced all of the error you report but only after the upgrade and not during. The "no VirtualHosts" is handled as you indicate by commenting out a line in the ports.conf file.

For all the other errors they only came in my case during manual start/stop/restart of apache2 on the command line when not root user.

Man I was much distressed as I the website on that server is my main day to day focus.

A few days after the upgrade I had shut down for a moment after updates. The o/s would not restart and had to by reinstalled using version 11.10 ubuntu which was all I had backed up. Crossed fingers and upgraded again after recovery and now (a month and some later?) all is well.

Apache2 runs somewhat faster and smoother as does ubuntu generally.

I wonder if the 2 level upgrade from version 10.04 to 12.04 was somewhat the culprit in your case?

Maybe uninstall apache2 and reinstall? Not a pleasant prospect by good chance to fix things I think.

* would have replied much sooner but I find ubuntuforums very user unfriendly when I look hard and see no way to subscribe to a post.
** update: I just clicked "Go Advanced". Now I am subscribed .. I hope!

holobeat
July 26th, 2012, 07:54 PM
I've just upgraded to 12.04 and now I cannot start Apache2. I tried reinstalling Apache2, restarting...nothing worked. According to some posts, it may be an issue with version of libc.

This is the syslog:

Jul 26 14:11:56 gosfcs kernel: [ 9037.776698] apache2[6307]: segfault at 0 ip 00007fc471978626 sp 00007fff1a78dd38 error 4 in libc-2.15.so[7fc471848000+1b3000]

My system is:

Ubuntu Linux 12.04
Linux 3.2.0-27-generic on x86_64
Intel(R) Xeon(R) CPU E5620 @ 2.40GHz, 8 cores
Zend Server 5.6.0

schir2
August 12th, 2012, 06:21 AM
It's probably a little late but I came across this same problem. I was able to resolve it though.

The problem for me was that apache breaks up the config file across many files all over the etc/apache2 directory.

All apache files were stored in my:
/etc/apache2

The configuration seems to have been spread across
apache2.conf
httpd.conf
ports.conf
/sites-available/default

httpd.conf is empty on ubuntu so I left it as is.
When I edited /sites-enabled/default to listen to port 9999 to avoid the port from being blocked by the ISP, everything was working fine.

This is what I put in:

Listen 9999
<VirtualHost *:9999>
ServerName sitename1.local
DocumentRoot /var/www/sitename1
</VirtualHost>

When I restarted the server it gave me a warning about not having a NameVirtualHost for *:80. It worked anyway.

This was a wordpress website, and I was also trying to mess around with php on a different site but on the same server. I looked up virtualhost by port and it suggested all I had to do was add in the NameVirtualHost *:port to my default file. So my default file looked like this.


ServerName 192.168.1.4

Listen 80
Listen 9999

NameVirtualHost *:80
NameVirtualHost *:9999

<VirtualHost *:80>
ServerName sitename2.local
DocumentRoot /var/www/sitename2
</VirtualHost>


<VirtualHost *:9999>
ServerName sitename1.local
DocumentRoot /var/www/sitename1

</VirtualHost>

When I saved and attempted to restart the server I started to get the error you mentioned. I looked around trying to figure out what was causing it, but I couldn't figure it out. The original warning I got seems to have given me hints as to what was going on. When I installed the apache server I looked through all the configs just to be familiar, so that helped.

After a while it hit me. the ports.config had a very similar config to the /sites-available/default config. It had inside the following:


Listen 80
NameVirtualHost *:80

I went back to my default file and just removed the Listen 80 line. After my frustration it worked. I went back to getting the warning though. To get rid of the warning I actually completly removed both of the lines from the ports file, and added them on to my /sites-available/default file.

What the problem was for me, was that it was running the listen 80 command twice. Once inside ports.conf and once insde the /sites-available/default file. Apparently the ports.conf is run first and it would cause problems for the default file.

If I were you I would check to make sure that you don't have duplicate lines of "listen 80" in the 4 configuration files. httpd.conf, apache2.conf, ports.conf, /sites-available/default.