I am doing this as a test for bigger deployment. I have Apache running on CentOS5 in a clean VM (just a few tools installed, PHP and such).

If mod_ssl is set to listen on 443 in /etc/httpd/conf.d/ssl.conf the the site at loads just fine.

If I change the listen port to eg. 9443 in ssl.conf and reload httpd the page wont load at - I set the eth0 to be trusted and disabled SElinux in case that was interfering but still no luck.

Am I missing something?

  • I imagine you need to restart httpd when changing the listening port, rather than just reloading it, but perhaps that's what you meant. – Marty Aug 20 '11 at 4:07
  • Sorry when I wrote reload I meant restart by command 'service httpd restart' – Lukasz Aug 21 '11 at 5:21

Make sure you change all references to 443 in you apache configuration. The ssh server is often configured as a virtualhost. You wlll need to change the port it is using as well as changing the listen port. You may need a virtualhost configuration something like (you should adjust for your needs:

<VirtualHost _default_:9443>
    SSLEngine on
    SSLCertificateFile /etc/pki/tls/certs/localhost.crt
    SSLCertificateKeyFile /etc/pki/tls/private/localhost.key

    CustomLog /var/logs/apache/access_ssl.log combined
    ErrorLog /var/logs/apache/error_ssl.log
    LogLevel warn

Use sudo netstat -lnp | grep 443 to see if Apache is listening no the desired port. This version of the command will also list the listening program. To see which ports apache is listening on try the command sudo netstat -lnp | grep apache.

  • I checked all Apache configuration files for number 443 but I cant find anything else. Most of the tutorials I found just say change the listen entry in ssl.conf. – Lukasz Aug 21 '11 at 5:20
  • I have edited the response to provide additional information. – BillThor Aug 21 '11 at 7:13
  • Thanks Bill, I changed the VirtualHost default port to 9443. Also I have ServerName <hostname>:9443 inside VirtualHost section. Thanks for your help. – Lukasz Aug 23 '11 at 21:31

When disabling SE linux did you also make sure to change the FW settings? Last time I checked disabling SELinux did not disable the firewall under centos. so maybe the firewall still has 443 open and not 9443

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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