Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache question 1

Status
Not open for further replies.

Noip

IS-IT--Management
Apr 25, 2002
240
MU
Hi, i'm new to linux and I have actually set a redhat 7.2 box on my network. Everything seems to be OK in the 'Apache configuration' panel but I can't access the default index page from the other computers and on the local machine.

Is the firewall stopping the request from being processed?

Any suggestion will be highly appreciated...
 
What sort of problems are you having, page cannot be displayed, forbidden errors, blank screens? Can you ping the box from the LAN(I'm assuming when you say local machine you mean local area network) Can you telnet into port 80, or any other port on that box that apache is on. Can others outside your LAN access apache on the box, Do you have some ipchains rule blocking it(ipchains -l) Do you have a deny rule in the access.conf or in /etc/hosts.deny for LAN users and port 80. Just some suggestions to check.
 
Is the DirectoryIndex directive set to the name of your index file?


ChrisP
 
Hi guyz

No, I really mean 'local machine'. I think I should be able to obtain my default page by typing on the same linux box.
I can't telnet the port 80 or any other port from other computers on the same lan. I've removed all the rules in ipchains. About access.conf, I don't know. I've checked the index page which seems to be OK (default settings - pointing to the right folder where the index page is.)
For the last reply, I don't know how to start httpd

Thanx for your time
 
It means is Apache started? Try "service httpd start". Do you see a bunch of httpd's in the "ps -ef" output? That means that Apache is running if you do.

If you can only connect to Apache from the server itself and not from other hosts on your network, Apache is probably only listening on the loopback interface. Set it to listen on all interfaces.


ChrisP
 
you can also use /etc/rc.d/init.d/httpd start for certain distro's
 
Redhat 7.2 has a command in its PATH by default that allows you to start and stop apache.
apachectl start (starts httpd)
apachectl stop (stops httpd)

You should also start the system monitor to ensure that httpd is running (or if you used the apachectl; make sure that its running)

Once you ensure that the apache server is up and running, run
netstat -pan

This will show you all of the open ports on your machine. The top of this list shows all tcp and udp ports. If apache is running and listening on port 80 you should see something like this:

tcp 0 0.0.0.0:80 0.0.0.0 Listen
<PID>/httpd

If you got this, then you should be able to browse to your index.htm from any machine on your LAN, assuming that all other network settings are correct, using the
Hope this helps!
 
SgtB, apachectl is only in your path depending on where you installed Apache. If you compiled from source and installed Apache in /usr/local/apache (the default), it is not going to be in yoru $PATH.

A simple &quot;ps -ef&quot; (like stated above) will tell you if Apache is running, but if you really want to use netstat use &quot;netstat -nat&quot; instead. The -p option is going to show a lot of useless garbage that is going to confuse you.


ChrisP

 
Fluid11,
I think the -p option is just my personal preference. I like to use it, and I don't think the output is garbage at all, and I like to see the process that is using the port. I thought this might be helpful for him since this will show what port is open and what process is using it. This way it can &quot;show&quot; him that httpd is in fact listening on port 80. So how about -pnat! =)
Also if you let RH install apache during setup it will put it in your path for you. If you install it after RH installation , then you're right, it depends on installation location. Since this individual is &quot;new to linux&quot; I assumed he installed apached during RH setup.

Just thought I'd clarify my post a little.
 
you can also use: netstat -an | grep :80

That will show all connections and listening sockets on port 80. If its not showing as listening on port 80 you might wanna troubleshoot why. Hope this helps
 
SgtB, I didn't mean to &quot;put down&quot; your post or anything, it just sounded like redundant information that is just going to make things more confusing.

The -p option in netstat shows (a lot) of socket information that you really don't need to see. I've personally never even used the -p option before, as I don't see a need for it. The -at option will show you output of only the ports that the server is listening on, and -n will show you IP addresses in the output, instead of doing reverse lookups for the hostname. The output from -nat usually all fits on the screen and only shows the info you need (at least in this situation), while -p will force you to pipe it to less/more to view all of the sockets.


ChrisP
 
Thnx to all,

I thought that httpd.conf would start by default each time I boot.

fluid11 was right, 'service httpd start' and everything was ok
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top