Find the answer to your Linux question:
Results 1 to 8 of 8
using IP address comes up on the host machine, but when I try to access the web server by URL of same IP address on parallel machine, can't find it. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2012
    Posts
    40

    I can only see my apache server from host machine


    using IP address comes up on the host machine, but when I try to access the web server by URL of same IP address on parallel machine, can't find it. Think it might be the apache/linux permissions? Where do I start?

  2. #2
    Just Joined!
    Join Date
    Aug 2009
    Location
    Mumbai, India
    Posts
    95
    Check the value of Allow from in httpd.conf

    --Syd

  3. #3
    Just Joined!
    Join Date
    Nov 2012
    Posts
    40
    Quote Originally Posted by syd05 View Post
    Check the value of Allow from in httpd.conf

    --Syd
    <Directory "/var/www/html">
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #
    # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    # The Options directive is both complicated and important. Please see
    # core - Apache HTTP Server
    # for more information.

    Options Indexes FollowSymLinks

    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    # Options FileInfo AuthConfig Limit

    AllowOverride All

    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all
    </Directory>

  4. #4
    Just Joined!
    Join Date
    Aug 2009
    Location
    Mumbai, India
    Posts
    95
    In the access_log & error_log grep for the IP from which you are not able to access ? What does it show when you grep for the IP?

    What's the output of below mentioned command assuming port 80 is where apache is listening on

    Code:
    netstat -atn | grep :80
    --Syd
    Last edited by syd05; 12-11-2013 at 06:50 AM. Reason: Correction

  5. #5
    Just Joined!
    Join Date
    Nov 2012
    Posts
    40

    grep logs and netstat

    Quote Originally Posted by syd05 View Post
    In the access_log & error_log grep for the IP from which you are not able to access ? What does it show when you grep for the IP?

    What's the output of below mentioned command assuming port 80 is where apache is listening on

    Code:
    netstat -atn | grep :80
    --Syd
    [shane@potents ~]$ netstat -atn | grep :80
    tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
    [shane@potents ~]$


    and the logs: are empty!!! Even though I connected from localhost (using IP URL)
    [root@potents logs]# drwx------. 2 root root 4096 Dec 11 12:13 .
    drwxr-xr-x. 16 root root 4096 Dec 9 03:08 ..
    -rw-r--r--. 1 root root 0 Dec 9 03:08 access_log
    -rw-r--r--. 1 root root 918 May 21 2013 access_log-20130522
    -rw-r--r--. 1 root root 442 May 30 2013 access_log-20130531
    -rw-r--r--. 1 root root 1182 Jun 3 2013 access_log-20130604
    bash: drwx------.: command not found...
    -rw-r--r--. 1 root root 1318 Dec 11 12:27 access_log-20131209
    -rw-r--r--. 1 root root 0 Dec 9 03:08 error_log
    -rw-r--r--. 1 root root 4807 May 26 2013 error_log-20130526
    -rw-r--r--. 1 root root 2570 Jun 2 2013 error_log-20130602
    -rw-r--r--. 1 root root 2058 Jun 3 2013 error_log-20130609
    -rw-r--r--. 1 root root 1201 Dec 9 00:15 error_log-20131209
    -rw-r--r--. 1 root root 0 Aug 19 2012 ssl_access_log
    -rw-r--r--. 1 root root 0 Dec 9 03:08 ssl_error_log
    -rw-r--r--. 1 root root 630 May 22 2013 ssl_error_log-20130526
    -rw-r--r--. 1 root root 378 May 31 2013 ssl_error_log-20130602
    -rw-r--r--. 1 root root 378 Jun 3 2013 ssl_error_log-20130609
    -rw-r--r--. 1 root root 252 Dec 9 00:03 ssl_error_log-20131209
    -rw-r--r--. 1 root root 0 Aug 19 2012 ssl_request_log
    [root@potents logs]# pwd
    /etc/httpd/logs

    did notice that the user/group is root. Perhaps should be apache or web? how to find the user of httpd process?
    [root@potents httpd]# date
    Wed Dec 11 12:33:07 EST 2013
    [root@potents httpd]#
    Last edited by potentsinfo; 12-11-2013 at 04:25 PM.

  6. #6
    Just Joined!
    Join Date
    Aug 2009
    Location
    Mumbai, India
    Posts
    95
    Hi,

    The permissions of the logs are fine. To check the User of httpd find for string "User " in conf file. On Centos / RHEL / Fedora systems it would be apache (default). Funny that the logs are empty.

    When you try to access the IP of the apache server from other system what error does the browser throw up? Is it just trying to connect. Since you have mentioned that the apache logs are empty, can you do a tcpdump on apache server & access the URL both from your server and client ( replace eth0 with the interface name of ur apache server )

    Code:
    tcpdump -vv -nn -i eth0 port 80
    Might be helpful to look at the entire httpd.conf file. Can you upload that?

    --Syd

  7. #7
    Just Joined!
    Join Date
    Nov 2012
    Posts
    40
    Quote Originally Posted by syd05 View Post
    Hi,

    The permissions of the logs are fine. To check the User of httpd find for string "User " in conf file. On Centos / RHEL / Fedora systems it would be apache (default). Funny that the logs are empty.

    When you try to access the IP of the apache server from other system what error does the browser throw up? Is it just trying to connect. Since you have mentioned that the apache logs are empty, can you do a tcpdump on apache server & access the URL both from your server and client ( replace eth0 with the interface name of ur apache server )

    Code:
    tcpdump -vv -nn -i eth0 port 80
    Might be helpful to look at the entire httpd.conf file. Can you upload that?

    --Syd


    [root@potents shane]# tcpdump -vv -nn -i eth0 port 80
    tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
    16:46:43.304158 IP (tos 0x0, ttl 128, id 19312, offset 0, flags [DF], proto TCP (6), leng th 52)
    10.0.0.4.50860 > 10.0.0.6.80: Flags [S], cksum 0xa1ce (correct), seq 3862227980, win 8192, options [mss 1460,nop,wscale 2,nop,nop,sackOK], length 0
    16:46:46.302993 IP (tos 0x0, ttl 128, id 19314, offset 0, flags [DF], proto TCP (6), leng th 52)
    10.0.0.4.50860 > 10.0.0.6.80: Flags [S], cksum 0xa1ce (correct), seq 3862227980, win 8192, options [mss 1460,nop,wscale 2,nop,nop,sackOK], length 0
    16:46:52.301682 IP (tos 0x0, ttl 128, id 19325, offset 0, flags [DF], proto TCP (6), leng th 4
    10.0.0.4.50860 > 10.0.0.6.80: Flags [S], cksum 0xb5d7 (correct), seq 3862227980, win 8192, options [mss 1460,nop,nop,sackOK], length 0
    16:47:04.302929 IP (tos 0x0, ttl 128, id 19329, offset 0, flags [DF], proto TCP (6), leng th 52)
    10.0.0.4.50861 > 10.0.0.6.80: Flags [S], cksum 0xc8c0 (correct), seq 2310742419, win 8192, options [mss 1460,nop,wscale 2,nop,nop,sackOK], length 0
    16:47:07.300674 IP (tos 0x0, ttl 128, id 19347, offset 0, flags [DF], proto TCP (6), leng th 52)
    10.0.0.4.50861 > 10.0.0.6.80: Flags [S], cksum 0xc8c0 (correct), seq 2310742419, win 8192, options [mss 1460,nop,wscale 2,nop,nop,sackOK], length 0
    16:47:13.300823 IP (tos 0x0, ttl 128, id 19353, offset 0, flags [DF], proto TCP (6), leng th 4
    10.0.0.4.50861 > 10.0.0.6.80: Flags [S], cksum 0xdcc9 (correct), seq 2310742419, win 8192, options [mss 1460,nop,nop,sackOK], length 0

    Browser replies with can't find page, or unable to connect.
    but there is activity on that port 80. (though haven't full interpretation of it).

    I think the conf files are all alright to speed up the process some, since they haven't changed in a year or so. Was when I restarted the machine, maybe the SElinux (security feature) somehow, hadn't used that in a while.

  8. #8
    Just Joined!
    Join Date
    Aug 2009
    Location
    Mumbai, India
    Posts
    95
    Hi,

    Since you have mentioned it was a working setup thats stopped functioning after reboot:

    tcpdump shows the servers receiving request but no response to the client back from server. Hence nothing visible on browser. I've not worked with SELinux, but to rule out if SELinux is causing issues, execute this command:
    Code:
    sestatus
    If the output shows anything like enforcing or so ( update here the output of the command), just try disabling it with the following command
    Code:
    setenforce 0
    Check the last few lines of /var/log/messages & apache logs when you access the host from client

    --Syd

Posting Permissions

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