3

I need to run both http and https on the same hostnames on my server. I had everything running without SSL with hosts configured in the /etc/httpd/conf.d directory.

    System: CentOS release 5.6 (Final)
    Server: Apache/2.2.3

I was following the instructions here: http://shapeshed.com/journal/setting_up_mod_ssl_on_apache_centos_52/

But now:

    sudo /etc/init.d/httpd restart

Responds with:

    Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:443
    (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
                                                       [FAILED]

At the bottom of /etc/httpd/conf/httpd.conf I have:

    NameVirtualHost *:80

I tried adding NameVirtualHost *:443 below that but it didn't help.

One more thing: Webmin was previously installed and that is already running at http://XXX.XXX.XXX.XXX:10000

Could that be a factor?

Any help would be greatly appreciated; as you can probably tell I'm flying by Google here I've not done this before.

Thanks!

2 Answers 2

5

Solved:

Prior to installing mod_ssl, httpd.conf contained:

    Listen 31.222.163.118:443

And the mod_ssl installer had added this to the automatically created ssl.conf (in conf.d)

    Listen 443

The duplication was naturally causing a conflict. I removed the line from httpd.conf and now it starts normally.

3

It looks like you already have something listening on port 443. Disable it and then try again to run Apache. You can find what is listening on that port with the following command:

netstat -ptnl | grep 443
5
  • netstat -ptnl | grep 443 returns nothing.
    – Ade
    Sep 8, 2011 at 9:42
  • That's odd. May I propose to look at this post and try if the same solution would work for you: digitalsanctum.com/2007/08/18/… Sep 8, 2011 at 9:49
  • Thanks. However, there are no mystery processing running according to ps -aux and ps aux | grep httpd returns nothing.
    – Ade
    Sep 8, 2011 at 10:27
  • As root, can you run "lsof -i TCP:443" and look for lines that say "LISTEN"? Make sure the "lsof" package is installed first ("yum install lsof"). If there's nothing there, you might want to try to run the httpd process directly in the foreground, as root run "/usr/sbin/httpd -X".
    – cjc
    Sep 8, 2011 at 11:46
  • 2
    Solved (many thanks to Rackspace support). Webmin had added to httpd.conf: Listen 31.222.163.118:443 And the mod_ssl installer had added this to the automatically created ssl.conf (in conf.d): Listen 443 The duplication was naturally causing a conflict.
    – Ade
    Sep 8, 2011 at 11:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .