QuoteWe have been getting emails from the server, which means the server is alive. In order to send those manager reports, we use php, and the two mysql databases. When you try to go to www.domain.com, you get an error that looks like a timeout error. The web server part is probably not working. One thing we can try (which I haven't tried) is to login to the server through ssh or telnet. The type "sudo apache2 restart". That should fire up the web server again. If that doesn't work, then you should at least get an eror message that may be more descriptive.
...so my guy tried what he said:
Quote* Restarting web server apache2
[Sat Jan 14 17:13:10 2012] [warn] The Alias directive in /etc/apache2/conf.d/phppgadmin.conf at line 1 will probably never match because it overlaps an earlier Alias.
[Sat Jan 14 17:13:10 2012] [warn] The Alias directive in /etc/apache2/conf.d/phppgadmin.conf at line 1 will probably never match because it overlaps an earlier Alias.
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
...then my guy said:
QuoteSo I made a soft reboot of the slice from the Slicehost slice manager tool. This didn't fix the issue (same symptoms as before). Googling up the error message hasn't been productive either -- so far.
Anyone out there seen this before?
Start by looking at /etc/apache2/conf.d/phppgadmin.conf and see if something funny is in there.
10/4
He replied, but I don't understand a word...
QuoteNot that I can see...
sudo vim /etc/apache2/conf.d/phppgadmin.conf
Shows:
Alias /phppgadmin /usr/share/phppgadmin/
<Directory /usr/share/phppgadmin/>
DirectoryIndex index.php
Options +FollowSymLinks
AllowOverride None
order deny,allow
deny from all
allow from 127.0.0.0/255.0.0.0 ::1/128
allow from all
<IfModule mod_php5.c>
php_flag magic_quotes_gpc Off
php_flag track_vars On
php_value include_path .
</IfModule>
</Directory>
...LM, this make any sense to you?
The response to this from the other coder was:
QuoteWe don't currently use phppgadmin.
I mv'd phppgadmin.conf to /tmp
tried restart again
the alias warning went away, but the restart still fails with the same error.
trying something else....
...so maybe he might figure it out. Thanks for the help. I'll keep you tuned.
Apache's telling you that it can't listen on port 80 because something else already is. This is enough to stop it running. It could be a case of another service using port 80, such as another web server or proxy. However, I'm thinking that the alias warnings might indicate that you have two conflicting vhosts (perhaps the same site info setup twice?) which is causing the problem, rather than another app being involved.
I'm not familiar with Slicehost, but if you had root access, use a2dissite to disable all of your Apache sites other than the default one, and try restarting Apache. If that works, add the sites back in one by one with a2ensite, and restart Apache after each one. When it falls over, you'll know where to look.
Much obliged, my man, message relayed to the guys...
FYI, the aliases warning is because somewhere in the Apache config, probably spread across more that one file, you have two lines like:
Alias /source/ /destination/one/
Alias /source/ /destination/two/
The first one states that requests for http://www.yourdomain.com/source/nameoffile.html should be redirected to http://www.yourdomain.com/destination/one/nameoffile.html
The first one states that requests for http://www.yourdomain.com/source/nameoffile.html should be redirected to http://www.yourdomain.com/destination/two/nameoffile.html
The warning is Apache telling you that you can only have an alias pointing to one destination, and that the second one won't be used. This is a *warning* though. It isn't the thing that's stopping Apache from starting.
Again, thank you for your insight... Relaying it now
>spread across more that one file
That is one thing I don't like about Apache2 vs the old Apache days -- too many config files.
I guess that you can still put everything in one file if you want, but you'd sacrifice some control. A guy I work with introduced me to a different way of doing things: He symlinks the individual vhost conf files to conf files a level above the document root of each site. These are then maintained as part of the subversion repository. This way he gets rollback for the Apache configuration, and changes in configuration can be rolled out at the same time the sites are updated.
I've started using this with environmental variables, and I can have a single Apache vhost conf that works on a local Windows box, and dev and live Linux servers. The variables can be picked up in PHP, so my code knows what platform it's running on, and can adapt accordingly. It's a really neat way of working.
whoa, didnt see your last post... I'll relay that. Thanks.
Bad news is we still have no glory...
Quote"When we are restarting the apache server, the symptoms point towards apache2.conf being read twice. apache2.conf has Include statements that read other configuration files and directories. One thought is that there is a copy of apache2.conf sitting in one of the included directories. Or maybe one of those auto-backup files from a text editor with a ~ in the name is lurking out there. I haven't found it.
I did disable the sites (a2dissite), so once we get the server up, those will have to be a2ensite'd."
Quote"I tried looking at the error logs for apache, but i can't get into that directory (which is strange). /var/log/apache2
I edited apache2.conf to put an error log in /tmp and changed the error level to debug (which should tell us exactly what is being read and in what order), but the log file never gets written. The error message still says it cannot open the log file.
???"
"I tried looking at the error logs for apache, but i can't get into that directory (which is strange)"
Add the user to the group which owns the logs. It's www-data on Ubuntu. Don't know about other distros.
thanks...
is this solved ?
0.0.0.0:80 is strange.. 0.0.0.0 should be a valid IP address or host I think.
Perhaps check there is a servername value in phppgadmin.conf or any of the other .conf files (httpd.conf) , and that the value makes sense.
<added>
PS. Other idea. Part of the article at this link explains finding and killing any old (Apache) processes still running on port 80 before starting Apache again.
http://ubuntuforums.org/showthread.php?t=1636667
Seems worth a try.
</added>
Not solved. My guys are looking but not finding and its driving them crazy. They think it was an autoupdate/patch of some sort.
I'll pass this on to them and let you all know what they say.
Thanks.
note I just updated my post with a second suggestion as well.
How about brute force? Stop any old Apache processes as Damian suggested, then grep for
(^|\s+)Alias
in the apache2 dir, identify all files that have alias settings, comment them all out and see if you can get Apache booted.
At the very least, that should get rid of the Alias error message and get you along to the next one until you find the problem.