LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-29-2011, 05:38 AM   #1
dhairya
LQ Newbie
 
Registered: Jul 2011
Location: Ahmedabad
Posts: 11

Rep: Reputation: Disabled
unable to connect to nginx server from other machine


on my machine I have installed nginx server. I am able to access it using http://localhost

But when I try to connect it from other machine using my machine's IP(172.16.10.211) address and port number(80), it fails. It just doesn't connect.
n both the machines, I have made firewalls OFF.
Host machine having linux has selinux disabled and other machine having window's OS has all firewalls OFF.
--------------------------------------------------------------------
[root@localhost ~]# uname -r
2.6.18-238.19.1.el5
---------------------------------------------------------------------

Please help me know the solution to access nginx server from other machine on same LAN.
 
Old 07-29-2011, 08:00 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,910

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Hi,

What gives:
Code:
netstat -tanpl|grep nginx
 
Old 07-29-2011, 08:19 AM   #3
dhairya
LQ Newbie
 
Registered: Jul 2011
Location: Ahmedabad
Posts: 11

Original Poster
Rep: Reputation: Disabled
thanks bathory for quick reply.
here is the output:

[root@localhost ~]# netstat -tanpl|grep nginx
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3660/nginx.conf
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 3660/nginx.conf
 
Old 07-29-2011, 09:00 AM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,910

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Quote:
[root@localhost ~]# netstat -tanpl|grep nginx
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3660/nginx.conf
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 3660/nginx.conf
So nginx is running and listens on all available interfaces and it should answer to connections from other hosts since there is no firewall in between.
What is the exact error you get? Is there anything written in the logs? Can you ping the host running nginx?
 
Old 07-29-2011, 11:04 AM   #5
dhairya
LQ Newbie
 
Registered: Jul 2011
Location: Ahmedabad
Posts: 11

Original Poster
Rep: Reputation: Disabled
Ping -t 172.16.10.211 is able to connect

Browser is unable to connect http://172.16.10.211:80/

where should i search error log?
 
Old 07-29-2011, 11:32 AM   #6
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,910

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Can you connect from the same server running nginx using http://172.16.10.211
If you're running RHEL (or derivatives) and you've installed nginx using yum, the logs should be located under /var/log/nginx. Or you can find their location in nginx.conf (search for the error_log directive)
BTW check if it's SELinux that prevents connecting from remote hosts to your web server.
 
Old 07-31-2011, 11:37 PM   #7
dhairya
LQ Newbie
 
Registered: Jul 2011
Location: Ahmedabad
Posts: 11

Original Poster
Rep: Reputation: Disabled
"Can you connect from the same server running nginx using http://172.16.10.211"

YES. I can open the home page using http://172.16.10.211 from the machine where nginx is installed
-------------------------------------------------------------------------------------------------------------
"If you're running RHEL (or derivatives) and you've installed nginx using yum, the logs should be located under /var/log/nginx. Or you can find their location in nginx.conf (search for the error_log directive)"


Both the files (access.log and error.log) at /var/log/nginx/ are empty.
[root@localhost ~]# ls /var/log/nginx/
access.log access.log.1.gz error.log error.log.1.gz

-------------------------------------------------------------------------------------------------------------
"BTW check if it's SELinux that prevents connecting from remote hosts to your web server."

please see the output
[root@localhost ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted

# SETLOCALDEFS= Check local definition changes
SETLOCALDEFS=0

Last edited by dhairya; 07-31-2011 at 11:41 PM.
 
Old 07-31-2011, 11:50 PM   #8
dhairya
LQ Newbie
 
Registered: Jul 2011
Location: Ahmedabad
Posts: 11

Original Poster
Rep: Reputation: Disabled
I initially just switched of the selinux from
/var/log/nginx/ and making it
SELINUX=disabled

but now I used lokkit command and disabled the security and I could connect.

Thanks a lot.
 
  


Reply

Tags
connect, lan, nginx


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to connect debian Virtual Machine to internet hackersapien Linux - Newbie 2 09-30-2008 10:47 PM
Unable to connect to machine via hostname, DNSs seem ok sarajevo Linux - Networking 2 05-25-2008 01:46 AM
not allowed to connect to mysql server on another machine dsids Linux - Newbie 2 05-26-2006 03:36 PM
Unable to connect SUSE 10 machine to windows network Harry Hamlin Linux - Networking 2 12-17-2005 12:33 AM
Suddenly unable to connect to my web server and my ftp server. HELP! Silly22 Linux - Software 4 05-23-2004 04:42 PM


All times are GMT -5. The time now is 03:37 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration