1

THIS QUESTION SHOULD BE MARKED AS CLOSED

I've recently compiled MapServer 6.2 on a CentOS 6.3 machine, using

./configure --with-ogr=/usr/bin/gdal-config --with-gdal=/usr/bin/gdal-config --with-proj=/usr --with-geos=/usr/bin/geos-config --with-postgis=/usr/bin/pg_config --with-php=/usr/include/php --with-wfs --with-wfsclient --with-wmsclient --enable-debug --with-threads --with-wcs --with-sos --with-gd --with-freetype=/usr/bin --with-jpeg --with-cairo --with-curl

if that is of interest, anyway.

So after that, Apache/2.2.15 silently fails to restart, i.e. when apachectl graceful, it says "httpd not running, trying to start". There is nothing of interest in the Apache errors_log, /var/log/messages, and it is weird because so far it has always worked.

Restarting the machine multiple times did not solve the problem. Some other stuff I did:

[root@R12X0210 cgi-bin]# service httpd status
httpd is stopped
[root@R12X0210 cgi-bin]# ps aux|grep httpd
root      1846  0.0  0.0 103236   864 pts/0    S+   12:11   0:00 grep httpd

I suspect this might have something to do with a php module that was altered/added by MapServer, but I don't really know... I don't even know how to properly debug this.

EDIT: Alright, /var/log/httpd/error_log is not necessarily empty, it rather shows those two things after doing /sbin/service/httpd start

[Wed Dec 19 17:33:24 2012] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Dec 19 17:33:24 2012] [error] Server should be SSL-aware but has no certificate configured [Hint: SSLCertificateFile] ((null):0)

Does the SSL error result in the termination of the start mechanism? The thing is we have a unsigned certificate running, i.e. we're testing https Access but not yet in production mode. Absolutely nothing has been changed in the SSL configuration of Apache before it stopped working.

EDIT2: In the meantime, I reinstalled httpd with yum reinstall httpd, this did not solve the problem, either.

grssnbchr
  • 157
  • 2
  • 8
  • What is in your apache error log file? – Jordi Kroon Dec 19 '12 at 11:16
  • See my edit above. I still think this is not directly related to the problem. – grssnbchr Dec 19 '12 at 14:42
  • If SSL layer can not be started, apache will not start. Level `error` in the apache error_log should not be ignored ever. – Mircea Vutcovici Dec 19 '12 at 15:46
  • Fine, when commenting out all of the SSL related stuff, Apache starts. But as I said, ABSOLUTELY NOTHING has been changed in httpd.conf, but all of a sudden it stopped working. Apache never had an SSLCertificateFile configured, but still the server started without problems. Just until some days ago, when I installed MapServer. – grssnbchr Dec 20 '12 at 07:12

1 Answers1

1

If PostgreSQL is running on the same machine make sure it is listening on 0.0.0.0 or on 127.0.0.1, or on :: on port 5432. To check this, the following command should return something:

sudo netstat -tlnp|egrep ':5432'

If you have PostgreSQL running on a different machine, check that the hosts file is configured correctly and that the proper host is used in the PostgreSQL configuration of your PHP application

Mircea Vutcovici
  • 16,706
  • 4
  • 52
  • 80
  • This doesn't return anything. PG runs on the same machine, but has been correctly configured to listen where it should listen. Just, from one moment to the other, this is not set anymore. How can this happen? – grssnbchr Dec 20 '12 at 05:13
  • I've added the stuff that's in pg_hba.conf - to me it looks ok. Where else could I change settings? – grssnbchr Dec 20 '12 at 05:21
  • Could you please provide the output of `sudo netstat -tlnp`. I think that PostgreSQL is not started, or it is not listening on the right socket (IP:port). – Mircea Vutcovici Dec 20 '12 at 06:58
  • You were right, postgres was not started. I forgot that in CentOS, obviously, everything needs to be started manually (including Apache and Postgres). I edited my whole question since PostgreSQL is actually not part of the problem, this question should be only about Apache. – grssnbchr Dec 20 '12 at 07:09
  • Can you post the apache configuration? Remove all comments and edit/hide/remove sensitive information like passwords. – Mircea Vutcovici Dec 20 '12 at 07:22
  • Run also `rpm -V httpd` to see which files were changed in the apache package. Do you use a source control for configuration files? Do you have a backup of the server or image when it was working? Could you make a diff between backup and the current one that is not working? – Mircea Vutcovici Dec 20 '12 at 07:25
  • Listen, this leads nowhere. Possibly, there is human error involved because multiple have been working on this stuff without properly communicating. Right now we just use HTTP and will only configure SSL as soon we have a properly signed cert. Also, I was really confused by the fact that CentOS does not autostart services such as httpd and postgresql. I will close the question now. Thanks anyway! – grssnbchr Dec 20 '12 at 07:55
  • @wnstnsmth, There's a related question at http://serverfault.com/q/288125/87017 and http://serverfault.com/q/585504/87017 and http://serverfault.com/q/458569/87017 and http://serverfault.com/q/109420/87017 and http://serverfault.com/q/530916/87017 – Pacerier Apr 15 '16 at 20:34