Need help setting up Linux Server as web server #1 - remote access

I have a Linux running red hat enterprise.  Right now, the way it is configured, I can get out to the internet with this server, but I cannot get remote access to the server through remote desktop or vnc.  It is not responding.

The server does not sit behind a firewall, and should be accessible by IP address, but it is not right now.

This problem will be a multi-part question worth over 2000 points in the end, so anyone to help can REALLY help me.

The first step is to get the server accessible from the outside remotely, so I can do more setup from a remote area.  Can someone help me get this server online so that it can be accessed remotely?

Thank you!
foreverditaAsked:
Who is Participating?
 
JammyPakCommented:
is the webserver on a public IP or a private IP? (is the router doing NAT?)

also, on the RH box, do "service iptables stop" and then try to telnet or load the webpage again
0
 
foreverditaAuthor Commented:
Also, when I ping the server with IP, I do get a reply.  I just can't access the site through IP or even remote desktop or vnc to it.

0
 
foreverditaAuthor Commented:
I can also putty into the server.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
foreverditaAuthor Commented:
So, if there is a way to check config to make sure internet and apache is connected correctly, I can putty into the site and work that way if someone can guide me.
0
 
manav_mathurCommented:
For simple remote access, you don't require Apache.

For internet access, you need to be running Apache.
first of all,
- you need to see whether Apache is running as a serice or not.
ps -ef | grep -i apache
will tell you that.
0
 
JammyPakCommented:
so you can ping the server and ssh to it...sounds like you're able to access it after all. Did you install and run the vncserver on the machine? Anyway, there's no reason that you can't do all the config using ssh.

since you're running RHEL, the apache process is not called apache, run this instead:
ps -ef | grep httpd

that will tell you it the webserver is running.
if it's not, run:
chkconfig --level 345 httpd on
then:
service httpd start

then try the first command again, and see if httpd is in there.

now you can try to load up the test page in your browser (assuming you haven't loaded a new index.html yet?). the index page should go in /var/www/html, assuming you installed everything and haven't changed the config yet.

check back once you've got the server running....and you should probably install iptables or another firewall to protect your machine as well...
0
 
foreverditaAuthor Commented:

#ps -ef | grep httpd
root      2528     1  0 Mar09 ?        00:00:01 /usr/sbin/httpd
apache   27200  2528  0 Apr10 ?        00:00:00 /usr/sbin/httpd
apache   27201  2528  0 Apr10 ?        00:00:00 /usr/sbin/httpd
apache   27202  2528  0 Apr10 ?        00:00:00 /usr/sbin/httpd
apache   27203  2528  0 Apr10 ?        00:00:00 /usr/sbin/httpd
apache   27204  2528  0 Apr10 ?        00:00:00 /usr/sbin/httpd
apache   27205  2528  0 Apr10 ?        00:00:00 /usr/sbin/httpd
apache   27206  2528  0 Apr10 ?        00:00:00 /usr/sbin/httpd
apache   27207  2528  0 Apr10 ?        00:00:00 /usr/sbin/httpd
root      1517  1484  0 09:35 pts/1    00:00:00 grep httpd
0
 
foreverditaAuthor Commented:
httpd is on, but I still cannot access the server through ip address, even though I can putty into it.

VNC is already installed, but I cannot access it through VNC either.

0
 
JammyPakCommented:
did you try configuring httpd.conf yet? have you put any web content on the server?

if not, you should at least get the default page

2 things I'd try...

1) verify you can get to port 80 on the machine
- you could do 'telnet 80 <ip of the server>' to make sure you can get to it from your system. If it answers, type GET and see if you get any response

2) ssh into the machine
check for lynx or links
'which lynx'
if it's installed on there, do 'lynx <hostname>' and see if it loads the sample web page for you

3) ssh in, and run 'httpd -t' to check for any syntax errors in the httpd.conf file
0
 
foreverditaAuthor Commented:
When I was on the server locally, and typed in the IP address, it gave me my webpage.

But when I try to access it remotely through a web browser, I get an error page "Can't find server".

I cannot telnet into port 80 of the machine.

How do I check for links or lynx?

Sorry I am such a novice at this stuff - I'm used to working with Windows.
0
 
foreverditaAuthor Commented:
httpd -t gives me nothing:  

[root@65-42-106-8 ~]# httpd -t
[root@65-42-106-8 ~]#
0
 
foreverditaAuthor Commented:
C:\Documents and Settings\dita>telnet 80 65.42.106.8
Connecting To 80...Could not open connection to the host, on port 65.42.106.8: Connect failed

This is what I get when I try to telnet to the server from my local machine.

0
 
JammyPakCommented:
sorry, try the telnet like this:
telnet <ipaddress> 80

I had them switched...

re. lynx, type 'which lynx' and it will tell you if it's somewhere in your path. Then try 'which links' as well...they're both similar

0
 
foreverditaAuthor Commented:
RE telnbet - still getting same error.  could not connect.

Obviously something is not configured correctly with the port 80

RE lynx:

lynx is somewhere in my path - under usr/bin

same with links

0
 
manav_mathurCommented:
It seems your port 80 is closed.
Can you post the output of

grep "^Listen" /etc/httpd/conf/httpd.conf
0
 
foreverditaAuthor Commented:
Listen *:80


is the output I get
0
 
foreverditaAuthor Commented:
The basic setup is this, just in case you would need this info to help me get started.

The ISP is SBC.  The server lies behind the Cisco router.  This server can get out to the internet with no problem.  When I was on the actual machine and typed in the ip address at the web browser, I got my main page.  From any server other than the actual server, I cannot access the main page.  It's totally driving me nuts.

0
 
manav_mathurCommented:
Does your router have a setup which blocks request from outside world??
0
 
foreverditaAuthor Commented:
No - the router is strictly the Gateway outside.  No blocks or anything.  We have several other servers running with no problem, including a Red Hat 7.

0
 
foreverditaAuthor Commented:
Yes, when the service iptables is stopped, I can access the server through the ip address.

How brilliant are you????????????

So what does this tell me?  Something is wrong with the IP table?



0
 
JammyPakCommented:
no, IPtables is a firewall...and you're running it :)

You could turn off the firewall (which you have), and then run 'chkconfig --level 345 iptables off' so it won't restart at boot. Or, you can change the rules to allow incoming port 80 to the server. If you run redhat-config-securitylevel (using X Windows) then that's likely the easiest, otherwise the iptables command line can be run over ssh

'iptables -L' will list all of the rules
'iptables -F INPUT' flushes all the incoming rules (so you'd might as well not run it...)

'iptables -D' will let you delete a specific rules, so if you find the one in the INPUT chain that mentions '-p tcp --dport 80' then that's the one you want to delete

0
 
foreverditaAuthor Commented:
Thank you for this solution.  Amazing that you knew that and I thank you thank you thank you!
0
 
JammyPakCommented:
thanks, but IPtables is pretty common, so watch out for it!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.