0

I installed apache and lighttpd in debian 7, apache used port 80 and lighttpd 88, now I install ssl for apache (443) and when i tried to do the same for lighttpd, I got error because 443 is already used by apache.

how can I have the both ssl working? without to disable apache ssl. can I just use another port for lighttpd? are there ports just for https? I tried 445 but it is not working. I tried also to make folder iptables (file rules.v4) bit no success:

SERVER_IP="..."
iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d $SERVER_IP --dport 445 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -s $SERVER_IP --sport 445 -d 0/0 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT

this is what I added in lighttpd:

$SERVER["socket"] == "127.0.0.1:445" {
  ssl.engine = "enable" 
  ssl.pemfile = "/etc/lighttpd/certs/bla.com/server.pem" 
}
  • Why do you have two completely different web servers?! – Michael Hampton Jul 6 '14 at 12:51
0

Of course you can , and have to, have lighttpd listen on a different port from what apache is listening on. At any given time only one process can listen on a combination of "IP:PORT"

by using

$SERVER["socket"] == "127.0.0.1:445"

your lighttpd will only listen on localhost for port 445, so it won't be available from the network unless you do some IPTABLES Destination Nat. If you need lighttpd to be available externally just set it to

$SERVER["socket"] == ":445"

Also once the processes are started try to confirm they are listening on the ports as you expect by running

$ sudo netstat -nlp | egrep -i "apache|httpd"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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