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.
Check iptables rules:
To add new rules, edit /etc/sysconfig/iptables:
To restart iptables:
To stop iptables:
For debug use tcpdump:
I just commented the line
and now it is working.
Before doing this, run the command
hostname
and add this name to your/etc/hosts
. Inhttpd.conf
I have the same name on the lineServerName
.I controlled before that no service was using this port :80 in my case.