Solved

Open port 80 on RHEL 5

Posted on 2009-06-28
3
2,624 Views
Last Modified: 2013-12-15
Hi Experts

Total newbie in fiddling with serverr and was wondering how do I open port 80 on RHEL (launched on Amazon Web Services).
I ran a few codes and mostly got errors:

vi/etc/sysconfig/iptables
-bash: vi/etc/sysconfig/iptables: No such file or directory
/etc/sysconfig/iptables
-bash: /etc/sysconfig/iptables: Permission denied
/etc/services
-bash: /etc/services: Permission denied

Also there's indication that the port is not listening

netstat -tl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 *:ndmp                      *:*                         LISTEN
tcp        0      0 localhost:ipp               *:*                         LISTEN
tcp        0      0 *:ssh                       *:*                         LISTEN

netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:10000               0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN
tcp        0      0 :::22                       :::*                        LISTEN

Regards,

Daniel
0
Comment
Question by:Daniel993
[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
  • 2
3 Comments
 
LVL 30

Accepted Solution

by:
Kerem ERSOY earned 500 total points
ID: 24733222
Hi,

> vi/etc/sysconfig/iptables
> -bash: vi/etc/sysconfig/iptables: No such file or directory

The problem here is you've forgotten to add a space between the command (vi) and the Parameter (filename). Try to launc it such as this:

vi  /etc/sysconfig/iptables


> /etc/sysconfig/iptables
> -bash: /etc/sysconfig/iptables: Permission denied

The problem is the file you're trying to launch is not a shell script so you can not launch it by calling the file directly. In fact the file /etc/sysconfig/iptables is simple a configuation file to the iptables service. Try to launch it :

service iptables start

To query if it is alrady running with a command suche as this:

# iptabes -L


> /etc/services
> -bash: /etc/services: Permission denied

/etc/services is a file that lists the service port numbers. So it was accessed by a service to learn what port it should connect. So you can not laonch the file from the command line like that.

If you want to start apache you need to activate the service first. And then you'll start it with these commands:

chkconfig --list httpd

if it responds by:

httpd           0:off   1:off   2:off   3:off   4:off   5:off   6:off

it means that the service is inactive. Then activate it when the system reboots issue this command:

chkconfig httpd on

now the output of chkconfig  --list httptd should be:
httpd           0:off   1:off   2:on    3:on    4:on    5:on    6:off

Now that we're sure that it is enabled for next reboot we need to launch the service with this command:

service httpd start

Cheers,
K.

0
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 24733233
If you get this when you run apache:

# service httpd start
Starting httpd: httpd: apr_sockaddr_info_get() failed for HOSTNAME
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
                                                           [  OK  ]

It means that the servername is not correctyk set in /etc/hosts then edit it and change this:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost HOSTNAME
::1             localhost6.localdomain6 localhost6

and edit thefile to be such as this:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
x.x.x.x                   HOSTNAME.example.com HOSTNAME
::1             localhost6.localdomain6 localhost6

Where x.x.x.x is your eth interface IP address
HOSTNAME is your actual hostname.




0
 

Author Closing Comment

by:Daniel993
ID: 31597703
Thank you, everything worked exactly the way you indicated.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
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.:
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.

710 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