apache problem

hi all,
I can't get my index.html to display on the web browser. Please point it out the reason.

this is what i had done so far:

  1. I have registered a dns name pointing to my public ip (it is done automatic)
  2. my server name is set same as the dns name
  3. I have configured httpd.conf like this
    ServerName http://xsoldier2006.dnsdojo.org // my dns name
    DocumentRoot "/var/www/html" // i place my index.html in /var/www/html
    DirectoryIndex index.html index.html.var
    HostnameLookups off
  4. I have my index.html in the /var/www/html folder

what else should i do? did i miss a step? why it is not on the browser? thanks

What operating system? What does your apache error log say?

The ServerName option does not take 'http://'. Just the hostname of the machine. Generally output from

/bin/hostname

Make sure your /etc/hosts file matches what you put here.

Also, does your ISP block port 80? You can check at Open Port Check Tool .

hi, glen.barber . I am using fedora9. and error_log has this:
"error_log" 7L, 745C
[Fri Oct 24 13:24:51 2008] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Fri Oct 24 13:24:51 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Oct 24 13:24:51 2008] [notice] Digest: generating secret for digest authentication ...
[Fri Oct 24 13:24:51 2008] [notice] Digest: done
[Fri Oct 24 13:24:51 2008] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Fri Oct 24 13:24:51 2008] [notice] mod_python: using mutex_directory /tmp
[Fri Oct 24 13:24:51 2008] [notice] Apache/2.2.9 (Unix) DAV/2 PHP/5.2.6 mod_python/3.3.1 Python/2.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g mod_perl/2.0.3 Perl/v5.10.0 configured -- resuming normal operations

should i disable seLinux??

this is the message generated from Open Port Check Tool
Error: I could not see your service on port (80)
Reason: Connection timed out

so that means port 80 is blocked by my ISP? ..... i'll look into noip.com

Any more suggestion? thanks a lot for the input.

First look if your server is listening to port 80

If your server is placed behind a router/firewall: is port 80 forwarded (destination-NAT) to port 80 on your server?

Run tcpdump on your server to see if any connection is made

While running tcpdump try to make a connection from the internet to your webserver. If there is no output, the webserver is not reachable from the internet caused by portblocking, port-80 not being forwarded or something like that.

If you're in front of the machine, open 127.0.0.1 in your browser. If apache is not running, you will get an error. If you're on the same LAN, open the host's IP in a local client's browser.

This should not be necessary.

No-ip won't help you with port 80 being blocked. At best, you can have apache listen on an alternate port.

Regards.

K2k,

Just to isolate the issue please disable the selinux for the meantime.
If your httpd is running the port 80 is open or any port you configure at your web server.

I don't believe SeLinux to be the problem here. I think he's trying to access his site using his registered domain name, and because port 80 is blocked by his ISP, it is not connecting.

This is why I want him to try to access the page from inside his LAN if possible.

thx for everyone trying to help. okay, this is what i tried out. Instead of working on my linux box (192.xxx.1.5), gateway is 192.xxx.1.1, I tried to host my page with the my laptop(windows xp) 192.xxx.1.10 with wampserver setup. everything worked out. (of course I had to forward port http port 80 with my router for 192.xxx.1.10)

well, if I can host with my xp box with port 80 forwarded, that i should be able to host with my linux box (192.xxx.1.5)with the same port (http)forwarded right? that means 80 is actually not blocked by my ISP right?

another concern, i have been using secure shell to login to my server to do everything i have done. it shouldn't be a problem right? I don't have to configure my httpd and things with my actualy server box right? i ask this is because when i do "lynx 127.0.0.1" it says it cannot connect to the remote host. i mean if i "lynx 127.0.0.1" ,, should it connect the local host instead???"

I am beginning to think this is less of an apache problem, but a sysadmin problem.

You still have not shown us output from your error log for apache after I told you to fix your ServerName directive, nor output from netstat showing that apache is in fact running.

You should also know, regardless of OS but from a networking standpoint, that localhost and 127.0.0.1 are 90% of the time the same thing.

okay, now i think my apache is actually running. but it come to an permission problem. when i tried to access the page on the browser, i get:

Forbidden

You don't have permission to access / on this server.
Apache/2.2.9 (Fedora) Server at xsoldier2006.dnsdojo.org Port 80

any suggestion to help me make through it? thanks

opps, never mine. I got it! thanks everyone tried to help.

solution: chmod 755 /var // if anyone is curious

<html>
<head>
<title>hi</title>
</head>
<body>
<p>this is my first page in Linux</p>
</body>
</html>

Seems to work from my end.
*Note: I intentionally included the source from the page -- I didn't screw up the formatting.

You should only `chmod' the directory Apache is using. Depending on your distribution, it could be '/var/www' or the like. (I assume you're using some Debian variant.)

You also shouldn't need to `chmod' /var/www anyway... It should 'just work' as is. I assume you changed permissions to not need to edit as root.

glen,
hey i really appreciate you keep on helping all the way, thanks. yes I chmod for many directories because I felt (still feeling) so unsecured after checking my secure log. Many people trying to hack in and some actually did hack in. I have my firewall running, installed fail2ban, i really didn't know what else to do besides chmod 700 to files ... (definitely not a right way to do)... so yeah,, i changed my /var chmod 755 and apache works. thanks again for all the posts