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
Solved

Open port 80 on RHEL 5

Posted on 2009-06-28
3
2,617 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
  • 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

856 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