1

I am running Apache 2.2.17 on Fedora v14. I cannot access the running web server from a browser, and I also have difficulties setting it up to listen on port 443.

The server httpd is running:

[me@host ~]$ sudo ps -U root -u root u | grep httpd
root      6592  0.0  3.4 404620 17552 ?        Ss   10:50   0:00 /usr/sbin/httpd -k graceful

I then stop the service:

[me@host ~]$ sudo apachectl stop

I then set up the Listen directive in /etc/httpd/conf/httpd.conf to listen on ports 80 and 443:

Listen 1.2.3.4:80
Listen 1.2.3.4:443 https

(The IP is not 1.2.3.4 but the actual IP of this host.)

I checked the other Apache conf directives to make sure I have a document folder, that it is accessible by all users, and that it will show a directory listing of the folder, if I do not specify index.html etc.

When attempting to start httpd, I get a configuration error:

[me@host conf]$ sudo apachectl graceful
(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

No other services appear to be running on TCP port 443 (or port 80):

[me@host conf]$ sudo netstat -tulpn | grep 443
[me@host conf]$ sudo netstat -tulpn | grep 80

If I comment out the 443 Listen directive and graceful-restart the httpd service, it starts and is visible in the process list (via ps, as above) but I am still unable to access the host via web browser.

Is there anything I have overlooked in setting up Apache? Thanks for your advice.

2 Answers 2

5

Check iptables rules:

iptables -nv -L

To add new rules, edit /etc/sysconfig/iptables:

...
-A RH-Firewall-1-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
...

To restart iptables:

#service iptables restart

To stop iptables:

#service iptables stop

For debug use tcpdump:

# tcpdump -pn host YOU_IP and not port 22
or
# tcpdump -pn port 443 and icmp
0

I just commented the line

Listen *:80

and now it is working.

Before doing this, run the command hostname and add this name to your /etc/hosts. In httpd.conf I have the same name on the line ServerName.

I controlled before that no service was using this port :80 in my case.

You must log in to answer this question.

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