?
Solved

LINUX CENTOS + APACHE

Posted on 2016-11-25
9
Medium Priority
?
80 Views
Last Modified: 2016-11-26
I just installed CENTOS 7 connected via SSH and installed apache like this:

yum -y install httpd

everything seems to be fine as when I run this command I can see that the apache is running

service httpd status

If I open the GUI via console, I run Firefox and the default apache home page comes up

but this is for a server and the users are going to connect over the LAN.

From a client computer in the same LAN I can ...
connect via SSH
ping the server
and it works.

but when I open firefox in the client computer and try to go to the Server IP it comes back with the error the site can't be reached.

I'm sure this has to be a very simple config but I don't know what is wrong, please help.

Thanks.
0
Comment
Question by:cargex
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 41902035
You probably haven't opened port 80 in the firewall for external connections.
0
 
LVL 2

Expert Comment

by:Uwe Degenhardt
ID: 41902045
Did you try to clear the browser cache ? Have you tried another browser ? The same result ?
0
 

Author Comment

by:cargex
ID: 41902049
Dave,
I concur it could be the LINUX firewall.
I can disable the firewall on this server since it is going to be used internally only.

It's been a while since the last time I touched a LINUX server, so I did the following.

iptables stop
chkconfig iptables off

Unfortunately the problem persists.

Can you please suggest specific commands to solve the issue?
0
10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 41902054
Without access to the server to check things, all I can suggest is restarting the server to see if it changes.  You can check the 'Listen' line in the 'httpd.conf' file to see if it is restricted to a particular IP address.  If you change anything in 'httpd.conf', you must restart Apache because that file only is read when Apache starts.
0
 
LVL 28

Expert Comment

by:Dr. Klahn
ID: 41902090
Try doing a manual connect using telnet and see what the server has to say, if anything.  Substitute the appropriate values for the IP address and the domain name.

telnet 192.168.0.200 80
GET / HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)

Open in new window


Then press Enter twice.  The server should respond with something like this:

HTTP/1.1 200 OK
Date: Wed, 21 Oct 2016 11:08:05 GMT    <-- optional
Server: Apache/2.2.36    <-- optional
Connection: close
Content-Type: text/html

Open in new window


If the server responds locally but doesn't respond to this basic test over the LAN, then there's an issue with the port configuration.
0
 
LVL 79

Expert Comment

by:arnold
ID: 41902438
Cents 7 uses firewalld.
Check httpd.conf to make sure it is not bound to localhost only
In the shell run netstat -an | grep ':80'
If it has 0.0.0.0:80 or *:80 listen this means it is bound to all available interfaces/ips
If it has 127.0.0.1:80 this means it is bound to localhost only

In httpd.conf search for listen and comment it out.
Presumably you did edit httpd.conf setting servername, etc. or was yum install httpd the only command you ran?
0
 

Author Comment

by:cargex
ID: 41902467
Hi Arnold,
I'm not familiar with the Apache installation.
So far only yum install httpd.

I have to connect to a remote site to make the changes, it will be greatly appreciated if you can list here all the changes needed after yum install httpd.

That way I can connect once to do all fixes.

Thanks
0
 
LVL 79

Accepted Solution

by:
arnold earned 2000 total points
ID: 41902511
There are variations.
Run netstat -an to see whether the default is bound to localhost
Ifconfig -a to see the IPs
First thing check whether you use firewalld since iptables off did not resolve the issue.
chkconfig --list | grep -i firewall
service firewalld stop
Or better to add the rule
Firewalld-cmd --zone=public --add-service=80
Within /etc/httpd/httpd.conf
Look for LISTEN if should be commented out.

....
0
 

Author Closing Comment

by:cargex
ID: 41902638
Thank you very much Arnold.
The firewalld part did the trick.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secureā€¦
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month11 days, 9 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question