0

I've almost completed automating the installation and configuration of apache2 across our infrastructure, but am hung up on an intermittent issue where apache does not restart when I ask it to.

I'm installing apache via AMT get; copying across files including ports.conf, apache2.conf and the default site; then calling within my script:

...
/etc/init.d/apache2 restart
...

I'm expecting apache to be listening on 443 ONLY when all's said and done, but it's intermittently still bound to port 80. Does anyone have any ideas as to how I can guarantee the restart?

1
  • Should we guess that you didn't configure it to listen on port 443? Should we guess something else? You only say that it doesn't work. And I can tell you it works for me that way.
    – mailq
    Nov 8, 2011 at 23:04

2 Answers 2

0

You'll likely need to open up the apache2 init script and find out how it's doing the restart. Older init scripts might stop, sleep, then start. You may need to write in a loop where you sleep, then check to see if it's still running before starting again.

0

1) You can always Leave Port 80 open from apache2 config and block it with iptables

iptables -A INPUT -p tcp -m tcp --dport 80 -j DROP

2) You can bind 80 to localhost.

You must log in to answer this question.

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