Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

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.

share|improve this answer
add comment

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
share|improve this answer
    
netstat -ptnl | grep 443 returns nothing. –  Ade Sep 8 '11 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/… –  Vladimir Blaskov Sep 8 '11 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 '11 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 '11 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 '11 at 11:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.