httpd can't start due to ports 80 and 443 magically being in-use...why?

General support questions including new installations
torontob123
Posts: 95
Joined: 2009/11/30 20:21:14

Re: httpd can't start due to ports 80 and 443 magically being in-use...why?

Post by torontob123 » 2009/12/06 15:26:41

:-) I am laughing at my own stupidity now. Of course it's the passphrase. So, how can I incorporate that passphrase? In fact, now that I am thinking of it, it's a useless security feature for me but I think I had no choice but to chose a passphrase.

So, httpd does start at boot and that's how it should be.
Wondering if I can add --passphrase "password" or something like that?


P.S. Here is a way to remove passphrase from SSL-key:
Ref. http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html#removepassphrase

How can I get rid of the pass-phrase dialog at Apache startup time?
The reason this dialog pops up at startup and every re-start is that the RSA private key inside your server.key file is stored in encrypted format for security reasons. The pass-phrase is needed to decrypt this file, so it can be read and parsed. Removing the pass-phrase removes a layer of security from your server - proceed with caution!

Remove the encryption from the RSA private key (while keeping a backup copy of the original file):

$ cp server.key server.key.org
$ openssl rsa -in server.key.org -out server.key

Make sure the server.key file is only readable by root:

$ chmod 400 server.key

Now server.key contains an unencrypted copy of the key. If you point your server at this file, it will not prompt you for a pass-phrase. HOWEVER, if anyone gets this key they will be able to impersonate you on the net. PLEASE make sure that the permissions on this file are such that only root or the web server user can read it (preferably get your web server to start as root but run as another user, and have the key readable only by root).

As an alternative approach you can use the ``SSLPassPhraseDialog exec:/path/to/program'' facility. Bear in mind that this is neither more nor less secure, of course.

Thanks a bunch for the tips.

andrea_hit
Posts: 1
Joined: 2011/08/04 18:13:13

Re: httpd can't start due to ports 80 and 443 magically being in-use...why?

Post by andrea_hit » 2011/08/04 18:22:24

I've had a similar problem:
I tried to install a tomcat distribution on a centos server with existing apache
after the reboot, apache doesn't restart and I am not able to restart it manually:
I tried ./httpd start and I have the following output:

Starting httpd: [Thu Aug 04 14:21:28 2011] [warn] module ssl_module is already loaded, skipping
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:443
no listening sockets available, shutting down
Unable to open logs

Can you help me?

ppostma1
Posts: 1
Joined: 2012/01/27 23:32:44
Contact:

Re: httpd can't start due to ports 80 and 443 magically being in-use...why?

Post by ppostma1 » 2012/01/27 23:38:47

the error is, "service httpd stop" can't find the httpd.pid to halt the server. service by default looks in the /var/run for the file by {service_name}.pid to find what to terminate.

Most common error is when the .pid is assigned to logs/httpd.pid
To fix, make sure in the httpd.conf that
PidFile /var/run/httpd.pid

then service finds and shuts it down.
:pint:

michaelr
Posts: 1
Joined: 2012/07/12 20:31:18

Re: httpd can't start due to ports 80 and 443 magically being in-use...why?

Post by michaelr » 2012/07/12 20:36:20

I am so happy I bothered read to the bottom of this thread. Sure 'nuf, checked httpd.conf & fixed path.

"An ounce of prevention...." TY ppostma1!

wilburunion
Posts: 22
Joined: 2017/01/05 14:55:14

Re: httpd can't start due to ports 80 and 443 magically being in-use...why?

Post by wilburunion » 2017/09/22 23:17:08

Another strange occurrence that can cause this is "saved" ssl.conf files in the conf.d directory. Apache will get confused trying to read the Certificate file paths - make sure only ONE ssl.conf of any kind - that is REMOVE any renamed or saved files by copying them OFF the server and delete them out of the conf.d directory. Go figure.

Locked