0

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.

6
  • 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, 2011 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? Jun 22, 2011 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, 2011 at 9:28
  • It's enough on your instance, but there could be something upstream that's blocking the requests. Who's your provider? Jun 22, 2011 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, 2011 at 10:20

3 Answers 3

1

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.

1
  • 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, 2011 at 10:35
0

Run lokkit and open the relevant ports.

0

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.

1
  • 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, 2011 at 8:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .