Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Very basic question inbound.

I'm a CS student and i'm new to server side stuff. I managed to get myself a server in the cloud with a root ssh login and installed LAMP (centOS 5.5) and tomcat5 for running servlets.

So I went through the tutorials and what i knew from head setting up using terminal. Then when I finished the installation, I tried to access it the usual way through my browser from here but its just timing out. yet ping shows a response.

(So 2 machines, one here that im using to view the output and the other in the cloud where the actual machine is located).

Just to clarify, I have started the server.it seems the httpd processes are running fine although their are a bunch of them.

ps -aux |grep httpd

In the config file lets just say my ip is 123.123.123.123 and my dns is myserver.cloud.com

This is what the conf file has:

ServerName myserver.cloud.com canonical name is off. Listen is port 80.

Any ideas on how to open it up to the web so i can view it form here? Response should look like this: http://articles.slicehost.com/2008/2/6/centos-installing-apache-and-php5 (the apache 2 test page)

Thanks in advance to anyone who can point me in the right direction.

share|improve this question
    
I'm a newbie on Linux servers and ran into these same problems recently. Try checking for permissions on your public html folder. That solved mine at the time. –  Cogicero Jun 22 '11 at 9:19
    
Cloud providers typically have some sort of upstream security. The requests might not even be reaching your server. Have you allowed port 80 traffic in to your instance from outside? –  SmallClanger Jun 22 '11 at 9:21
    
@Cogicero I dont think its permissions. I have no problem writing or reading files from that directory as a regular user. I recently emptied it just in case I did something wrong with index.html. This way the usual "It works" message would be displayed. @SmallClanger This is something i hadn't thought of actually. The ip address is responding to ping and I have Listen for port 80 and 8080 (443 was being used another process) I take it Listen isnt enough to forward the traffic then? –  overtone Jun 22 '11 at 9:28
    
It's enough on your instance, but there could be something upstream that's blocking the requests. Who's your provider? –  SmallClanger Jun 22 '11 at 9:57
    
@SmallClanger: GOT IT! it wasnt the cloud provider. It was the OS. Centos has a block on port 80 in iptable. just ran the command to open it and boom. Thanks a bunch for pointing out security as a possibility. I feel stupid for not thinking about it. Last thing, Do i need apache installed as a prequisite to run tomcat6 or is tomcat 6 a server side quite in its own? –  overtone Jun 22 '11 at 10:20

3 Answers 3

up vote 1 down vote accepted

By default CentOS has a firewall enabled so you need to open the port that Apache is listening on. This is usually port 80 so

iptables -I RH-Firewall-1-INPUT -p tcp -m tcp --dport 80 -j ACCEPT

should do the trick. This will allow connections to port 80 of your system. You should have a look at the iptables man page for more information.

share|improve this answer
    
Yeah thats the answer I got but couldn't answer it because my rep was too low. Ill put yours as the answer regardless. –  overtone Jun 22 '11 at 10:35

Run lokkit and open the relevant ports.

share|improve this answer

Usually cloud providers have firewalls installed and you need to open a port from Internet somewhere in providers management interface. Can you name the provider you use - I could be more specific then.

You can obviously first try with lynx or links if you can access the site with your external IP from the box itself. And if you can ping the box from outside world.

share|improve this answer
    
Apologies about that. Its mentioned in the top level question as slicehost. I already opened the necessary ports on the machine which seems to allow it access via web browser but not my hard code. perhaps this would be better suited to stackoverflow as i have another problem now where the connection is being refused in java but not web browsers –  overtone Jun 23 '11 at 8:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.