Solved

LINUX CENTOS + APACHE

Posted on 2016-11-25
9
69 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
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 83

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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 83

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 26

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 77

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 77

Accepted Solution

by:
arnold earned 500 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to rebuild XFS volume from LV 19 89
ftp to port 21 4 53
000webhost.com default error log 1 39
how to print sub line with  sed /awk /perl in bash file 11 47
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

789 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