Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 255
  • Last Modified:

Problems Connecting to Apache Server (Suspect problem with my IP setup)

Here is my setup: Running VMWare, have a RedHat 7.1 (2.4.2) installation running, server mode, just recently downloaded apache and installed it and such.  I am pretty new to the linux enviro, but I think apache is all set up correctly.  I can view the test page by using 'lynx localhost'.  I set up eth0 for a static IP, the configuration file will be pasted below.  It is set up like this because my firewall is portforwarding to this static IP, I dont know if it would have worked before I messed with the IP configuration, I didnt try it.


I read something about inetd I think it is?  The daemon that handles all the connections and such.  I tried looking to see if the conf file was where this tutorial said it was, but it didnt exist at all...

I can ping the address, I get a response, but strangely enough I can't telnet to port 80, or 8080 on the address.
Also, anybody know how I can get apache to autostart everytime the server restarts?  I'm sure there must be some sort of script somewhere.

Thanks for any help... Jim
  • 2
1 Solution

inetd was now replaced by xinetd (extended inetd). By default the telnet, ftp and all xinetd based serices are disbled in RHL 7.1 (7.1 to 8.0). you want to enable it by editing the file "/etc/xinetd.d/telnet". Follow the following steps,

   1. open /etc/xined.d/telnet file with any editor
   2. change "disable=yes" to "disable=no" in that file
   3. save the file
   4. restart the xinetd service by the command "service xinetd restart"
   5. Now the telnet is enabled and you can easily telnet in to your machine (dont specify port number to run telnet).

To start apache whil booting
  1. run the command "ntsysv"
  2. its a text based tool, check in the "http" option.
  3. click -OK-
  4. restart your computer

its will be OKAY...


There is no problem in your IP Configuration

I don't think halcyon wanted to enable the telnet daemon, but he was testing to see if apache was able to accept a connection (other than from localhost).

You don't want to enable telnet, its very insecure.  SSH should've been installed by default, and is probably already running.

about getting services to start at boot.  This seems to be confusing for most new users, personally I don't think ntsysv is not a usefull tool at all.  To the best of my knowledge, you can not ADD a service with the tool, you can only manage services that are already configured.

To do this you need init.d script. It that contains the proper commands to start and stop your service. I think there is a basic start/stop script in the apache docs.(if not, email me, i'll send you one).  

You use a program called "chkconfig" to add, remove, and control the services that start during boot, etc.

in order for chkconfig to work, you need two or more commented lines added to the begining of the script. The first line tells chkconfig what runlevels the service should be started in by default, as well as the start  and stop priority levels. If the service should not, by default, be started in any runlevels, a - should be used in place of the runlevels list.  The second line contains a description for the service, and may be extended across multiple lines with backslash continuation.

       For example, random.init has these three lines:
       # chkconfig: 2345 20 80
       # description: Saves and restores system entropy \
       #           pool for higher quality random number g
This  says that the random script should be started in levels 2, 3, 4, and 5, that its start priority should be 20, and that its stop priority should be 80.  You should be able to figure out what the description says; the \ causes the line to be continued.  The extra space in front of the line is ignored.

taken from chkconfig man files. type "man chkconfig" for more info.  I've never had a problem getting app's to start/stop at boot time using the method above..

I think the reason you can't connect to apache is because your running iptables, or ipchains, and port 80 is NOT allowed.  if your on 7.1, your most likely running ipchains. to temporaraly disable ipchains type "/etc/init.d/ipchains off"

goto whereever you installed apache and start it.. usually "/usr/local/apache/bin/apachectl start"

you should now be able to telnet to port 80, and also connect via browser to your machine via IP address.

if you can't apache isn't configured correctly.
halcyon985Author Commented:
<temporaraly disable ipchains type "/etc/init.d/ipchains off" >

This was exactly it, the command was stop, not off... but its all good, it told me my mess up when I typed it.  I appreciate all your help, and thanks for answering the question thoroughly... it helped a lot!!



Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now