Find the answer to your Linux question:
Results 1 to 7 of 7
Hi folks, CentOS 4.4 amd64 httpd.x86_64 2.0.52-28.ent.centos4 I'm building a web server. # /etc/init.d/httpd status Code: httpd (pid 4316 4315 4314 4313 4312 4311 4310 4309 4306) is running... Apache ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru
    Join Date
    Sep 2004
    Posts
    1,787

    Apache 1st page can't be visited


    Hi folks,

    CentOS 4.4 amd64
    httpd.x86_64 2.0.52-28.ent.centos4

    I'm building a web server.

    # /etc/init.d/httpd status
    Code:
    httpd (pid 4316 4315 4314 4313 4312 4311 4310 4309 4306) is running...
    Apache is running.

    # nmap -sT -O localhost
    Code:
    Starting nmap 3.70 ( http://www.insecure.org/nmap/ ) at 2007-04-05 14:50 HKT
    Interesting ports on localhost.localdomain (127.0.0.1):
    (The 1644 ports scanned but not shown below are in state: closed)
    PORT     STATE SERVICE
    21/tcp   open  ftp
    22/tcp   open  ssh
    25/tcp   open  smtp
    53/tcp   open  domain
    80/tcp   open  http
    110/tcp  open  pop3
    111/tcp  open  rpcbind
    143/tcp  open  imap
    443/tcp  open  https
    631/tcp  open  ipp
    884/tcp  open  unknown
    953/tcp  open  rndc
    993/tcp  open  imaps
    995/tcp  open  pop3s
    3306/tcp open  mysql
    6000/tcp open  X11
    Device type: general purpose
    Running: Linux 2.4.X|2.5.X|2.6.X
    OS details: Linux 2.5.25 - 2.6.3 or Gentoo 1.2 Linux 2.4.19 rc1-rc7)
    Uptime 0.101 days (since Thu Apr  5 12:25:01 2007)
    
    Nmap run completed -- 1 IP address (1 host up) scanned in 2.162 seconds
    port 80 is listening.

    # ping -c3 satimis.com
    Code:
    PING satimis.com (220.232.213.178) 56(84) bytes of data.
    64 bytes from 220.232.213.178: icmp_seq=0 ttl=150 time=0.612 ms
    64 bytes from 220.232.213.178: icmp_seq=1 ttl=150 time=0.708 ms
    64 bytes from 220.232.213.178: icmp_seq=2 ttl=150 time=0.701 ms
    
    --- satimis.com ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 2001ms
    rtt min/avg/max/mdev = 0.612/0.673/0.708/0.052 ms, pipe 2
    Ping satimis.com is working


    But the web server can't be visited by outside World with "www.satimis.com" nor IP address on browser
    (remark: I haven't hoisted anything. But at least Apache default page can be visited)

    # hostname
    host.satimis.com

    # hostname -f
    host.satimis.com

    Please advise. TIA


    B.R.
    satimis

  2. #2
    Just Joined!
    Join Date
    Jan 2007
    Posts
    90
    1. you said host is satmis.com and not www.satimis.com
    probably you have to enter http://satimis.com in the browser ?
    2. You did nmap on localhost. This means the server is listening
    on 127.0.0.1. Is the server bound to the 220.232.213.178 interface ?
    check nmap on that ?
    Adding this line
    Listen 220.232.213.178:80
    may help in /etc/httpd/conf/http.conf
    3. Try http://localhost -> This must work

  3. #3
    Linux Engineer adrenaline's Avatar
    Join Date
    Aug 2004
    Location
    Seattle, Washington
    Posts
    1,058
    What is actually seen?

    Is the default page seen? I am sorry if i missed that?

    You may need to change the document root in the .conf file

    Where is your website at on the server.

    I am using an older centos serverk, but by default on my it is in
    /var/www/html/

    If it is in your home directory you will definitely need to change your document root in
    /etc/httpd/conf/httpd.conf
    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

  4. #4
    Linux Guru
    Join Date
    Sep 2004
    Posts
    1,787
    Hi bhaslinux,

    1. you said host is satmis.com and not www.satimis.com
    probably you have to enter http://satimis.com in the browser ?
    Both www.satimis.com and satimis.com can't work on local network as well as on another network.

    2. You did nmap on localhost. This means the server is listening
    on 127.0.0.1. Is the server bound to the 220.232.213.178 interface ?
    check nmap on that ?
    ]# nmap -sT -O 220.232.213.178

    Starting nmap 3.70 ( http://www.insecure.org/nmap/ )
    Code:
    at 2007-04-06 08:27 HKT
    Insufficient responses for TCP sequencing (1), OS detection may be less accurate
    Insufficient responses for TCP sequencing (0), OS detection may be less accurate
    Insufficient responses for TCP sequencing (0), OS detection may be less accurate
    Interesting ports on 220.232.213.178:
    (The 1657 ports scanned but not shown below are in state: closed)
    PORT     STATE    SERVICE
    25/tcp   filtered smtp
    80/tcp   filtered http
    1080/tcp open     socks
    No exact OS matches for host (If you know what OS is running on it, see http://w
    ww.insecure.org/cgi-bin/nmap-submit.cgi).
    TCP/IP fingerprint:
    SInfo(V=3.70%P=x86_64-redhat-linux-gnu%D=4/6%Time=46159415%O=1080%C=1)
    T1(Resp=N)
    T2(Resp=Y%DF=N%W=1000%ACK=S%Flags=AR%Ops=)
    T2(Resp=Y%DF=N%W=400%ACK=S%Flags=AR%Ops=)
    T3(Resp=N)
    T4(Resp=Y%DF=N%W=400%ACK=S%Flags=AR%Ops=)
    T4(Resp=Y%DF=N%W=1000%ACK=S%Flags=AR%Ops=)
    T5(Resp=Y%DF=N%W=C00%ACK=S++%Flags=AR%Ops=)
    T5(Resp=Y%DF=N%W=1000%ACK=S++%Flags=AR%Ops=)
    T5(Resp=Y%DF=N%W=400%ACK=S++%Flags=AR%Ops=)
    T6(Resp=Y%DF=N%W=C00%ACK=S%Flags=AR%Ops=)
    T6(Resp=Y%DF=N%W=800%ACK=S%Flags=AR%Ops=)
    T7(Resp=Y%DF=N%W=800%ACK=S++%Flags=AR%Ops=)
    T7(Resp=Y%DF=N%W=1000%ACK=S++%Flags=AR%Ops=)
    T7(Resp=Y%DF=N%W=400%ACK=S++%Flags=AR%Ops=)
    PU(Resp=N)
    
    Nmap run completed -- 1 IP address (1 host up) scanned in 17.091 seconds
    Ports 25 and 80 opened.

    Just confirmed with ISP on phone Ports 25 and 80 have been forwarded to 192.168.0.10, the IP add of the router.

    # cat /etc/sysconfig/network-scripts/ifcfg-eth0
    Code:
    DEVICE=eth0
    BOOTPROTO=static
    BROADCAST=192.168.0.255
    HWADDR=00:0E:A6:F9:A3:5B
    IPADDR=192.168.0.180
    NETMASK=255.255.255.0
    NETWORK=192.168.0.10
    ONBOOT=yes
    TYPE=Ethernet
    Adding this line
    Listen 220.232.213.178:80
    may help in /etc/httpd/conf/http.conf
    Adding the line at bottom of /etc/httpd/conf/http.conf

    # /etc/init.d/httpd restart
    Code:
    Stopping httpd:                                            [  OK  ]
    Starting httpd: (99)Cannot assign requested address: make_sock: could not bind t
    o address 220.232.213.178:80
    no listening sockets available, shutting down
    Unable to open logs
                                                               [FAILED]
    It failed.

    3. Try http://localhost -> This must work
    It displayed the test page "index.html" which I just created. If deleting the test page, Apache 1st page displayed.

    B.R.
    satimis

  5. #5
    Linux Guru
    Join Date
    Sep 2004
    Posts
    1,787
    Hi adrenaline,

    What is actually seen?

    Is the default page seen? I am sorry if i missed that?

    You may need to change the document root in the .conf file

    Where is your website at on the server.

    I am using an older centos serverk, but by default on my it is in
    /var/www/html/
    Evoking www.satimis.com/satimis.com on browser on local network as well as other network the test-page (/var/www/html/index.html) can't be seen, only a blank page displayed at timeout.

    If it is in your home directory you will definitely need to change your document root in
    /etc/httpd/conf/httpd.conf
    Sorry I don't follow.

    What shall I change on /etc/httpd/conf/httpd.conf

    Tks


    B.R.
    satimis

  6. #6
    Linux Guru
    Join Date
    Sep 2004
    Posts
    1,787

    Solved

    Hi folks,

    Problem solved.

    I made a typo on /etc/sysconfig/network-scripts/ifcfg-eth0
    Code:
    DEVICE=eth0
    BOOTPROTO=static
    BROADCAST=192.168.0.255
    HWADDR=00:0E:A6:F9:A3:5B
    IPADDR=192.168.0.180  (typo)
    NETMASK=255.255.255.0
    NETWORK=192.168.0.10
    ONBOOT=yes
    TYPE=Ethernet
    IPADDR=192.168.0.10 is correct. The fixed IP 220.232.213.178 assigned by ISP is visible to outside World. ISP forwards port 25 and 80 to IP Add 192.168.0.10, the IP on router.

    Now the server can be visisted by outside World with the test page displayed. Tks.


    B.R.
    satimis

  7. #7
    Linux Engineer adrenaline's Avatar
    Join Date
    Aug 2004
    Location
    Seattle, Washington
    Posts
    1,058
    Good Job -nice find
    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

Posting Permissions

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