Find the answer to your Linux question:
Results 1 to 6 of 6
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2007
    Location
    Vancouver
    Posts
    19

    Post Cannot display web page or access my web server


    Hello,

    I posted earlier stating that I was unable to start my httpd service. That was solved, thanks in part to a reply that prompted me to think along a different path (see previous [SOLVED] post by me).

    I have now started Apache on my Fedora 19 Linux box.

    I tried accessing the index.html page using both Chrome and Internet Explorer 11. Both reported that they can't access or find the page.

    Questions:

    1. How do I determine where Apache is retrieving the index.html page?
    2. How do I determine the version of Apache (httpd) I'm using? I know it's 2.4.x. I just want to know what the ".x" is.



    Let me know if posting my httpd.conf will help in figuring this out.

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,685
    To see the version of apache on fedora, you could use e.g.
    Code:
    rpm -qa |grep http
    I would then check if the daemon runs and on which IP and port it listens
    Code:
    netstat -tunlp
    Next step is to connect to it locally, preferably via curl.
    Browsers lie
    Or to put it in more professional terms:
    Browsers are quite complex, have caching on their own, and especially like to cache 301 redirects even after restarts.
    In contrast, curl will do exactly what you ask it to, in a repeatable way.

    This line should probably return some content, if the apache config allows it:
    Code:
    curl -v http://127.0.0.1
    Followed by a curl to a non-localhost IP

    Going further, you could use curl on a remote machine to your webserver“s IP and trace it with e.g. tcpdump or ngrep.
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Oct 2007
    Location
    Vancouver
    Posts
    19
    Thanks for the info! I've gotten further now, but still not there yet.

    I'm using Apache Server 2.4.7 (httpd-2.4.7.1-fc19-i686). Netstat gives me "tcp 0 0 192.168.1.82:80 0.0.0.0:* LISTEN 30108/httpd", meaning it's listening on it's own IP address. Using curl against the loopback address (127.0.0.1), I get a connectioned refused (as I had expected, since I'm not connecting to localhost). Using curl against th 192.168.1.82 address, I see my default index.html page.

    This means that Apache Server is working, but only from within my server. I used curl on a Linux laptop (Ubuntu Linux, not that it makes any difference) and I received a "Could not connect to host" response. However, I used rlogin to 192.168.1.82 and I was able to connect without a problem.

    Is there something else I'm missing?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    13,225
    Check your SELinux and iptables settings. Since it works within the LAN (your 192.x.x.x address) - from the same host? It should work with the laptop if it is in the same LAN address space. If you are trying to access it from outside your LAN, then you will need to create a tunnel for ports 80 and 443 in your firewall/router to the server.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #5
    Just Joined!
    Join Date
    Oct 2007
    Location
    Vancouver
    Posts
    19
    Thanks for the replies. Mentioning iptables got me further than before. I've attached two screenshots: one of my INPUT chain in iptables, and the other of my results of nmap:
    iptables.jpg

    nnap.PNG

    nmap says port 80 is open but doesn't seem to bind to anything, much less httpd. How would I resolve this?

  7. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    13,225
    If you have SELinux enabled (common for out-of-the-box installations these days) you can try disabling the SELinux services and if that works, then there are means to disable blockage of port 80 when it is enabled. FWIW, it (SELinux) is a good way to help secure your system from hacking.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •