?
Solved

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

Posted on 2005-04-11
23
Medium Priority
?
258 Views
Last Modified: 2013-12-06
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!
0
Comment
Question by:foreverdita
  • 14
  • 6
  • 3
23 Comments
 

Author Comment

by:foreverdita
ID: 13754311
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
 

Author Comment

by:foreverdita
ID: 13754322
I can also putty into the server.
0
 

Author Comment

by:foreverdita
ID: 13754351
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Expert Comment

by:manav_mathur
ID: 13755296
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
 
LVL 16

Expert Comment

by:JammyPak
ID: 13756142
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
 

Author Comment

by:foreverdita
ID: 13764316

#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
 

Author Comment

by:foreverdita
ID: 13764377
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
 
LVL 16

Expert Comment

by:JammyPak
ID: 13764477
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
 

Author Comment

by:foreverdita
ID: 13764567
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
 

Author Comment

by:foreverdita
ID: 13764578
httpd -t gives me nothing:  

[root@65-42-106-8 ~]# httpd -t
[root@65-42-106-8 ~]#
0
 

Author Comment

by:foreverdita
ID: 13764586
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
 
LVL 16

Expert Comment

by:JammyPak
ID: 13764832
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
 

Author Comment

by:foreverdita
ID: 13765008
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
 
LVL 16

Expert Comment

by:manav_mathur
ID: 13765046
It seems your port 80 is closed.
Can you post the output of

grep "^Listen" /etc/httpd/conf/httpd.conf
0
 

Author Comment

by:foreverdita
ID: 13765085
Listen *:80


is the output I get
0
 

Author Comment

by:foreverdita
ID: 13765102
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
 
LVL 16

Expert Comment

by:manav_mathur
ID: 13765510
Does your router have a setup which blocks request from outside world??
0
 

Author Comment

by:foreverdita
ID: 13765616
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
 
LVL 16

Accepted Solution

by:
JammyPak earned 2000 total points
ID: 13766051
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
 

Author Comment

by:foreverdita
ID: 13766454
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
 
LVL 16

Expert Comment

by:JammyPak
ID: 13766645
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
 

Author Comment

by:foreverdita
ID: 13766775
Thank you for this solution.  Amazing that you knew that and I thank you thank you thank you!
0
 
LVL 16

Expert Comment

by:JammyPak
ID: 13766915
thanks, but IPtables is pretty common, so watch out for it!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…
Suggested Courses
Course of the Month15 days, 4 hours left to enroll

840 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