Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to install LAMP on a server and I'm doing this remotely.

These are what I did so far:

1) ssh admin@address.net [Ubuntu 12.10 server]
2) sudo apt-get install lamp-server^

The installation seems successful, but I CAN'T access http://address.net/
I'm sure apache2 is running.
Also, I've checked the /var/www/ folder and there, exists an index.html file.
So I'm expecting a "It works!" page at least upon accessing http://address.net/ on my browser.

Did I miss to configure something?

Thanks so much.

share|improve this question

migrated from stackoverflow.com Dec 20 '12 at 7:00

This question came from our site for professional and enthusiast programmers.

    
Be more specific on "can't access". What does your browser say? e.g. Connection refused, Connection timed out, Connection reset. What do Apache logs say? Any firewall running (check iptables -L -n -v). –  gertvdijk Dec 20 '12 at 9:40
    
Thanks for the response. The error I'm getting is: Oops! Google Chrome could not connect to address.net. ALSO I've checked the apache2 access.log and it's EMPTY. Maybe a firewall is blocking the connection to the apache server? –  Mae B Dec 20 '12 at 12:41
1  
Resolved this. It's a firewall issue. Just enabled port 80 on firewall. Thanks again! –  Mae B Dec 20 '12 at 15:29

2 Answers 2

Please check with lsof |grep LISTEN (you may have to install lsof via apt-get) if there are apache processes on port 80/http. If not, check ps aux |grep apache if it runs. If not, try to start it with /etc/init.d/apache2 start and check with lsof again if it runs.

Also make sure that the apache2 process can access the /var/www folder. Check if there are log files for apache. They should be in an apache subfolder of /var.

Explanation:

In reply to your comment on your question:

Could you take a look into /etc/apache2/sites-enabled? There should be at least one file in there. If not, look into /etc/apache2/sites-available, there must be at least one file. If there is use a2ensite filename to enable it. Also check if there is a /etc/apache2/httpd.confand if it exists, what is in it.

share|improve this answer
    
Thanks for your response. Will look into this. –  Mae B Dec 20 '12 at 13:08
    
Resolved this. It's a firewall issue. Just enabled port 80 on firewall. Thanks again! –  Mae B Dec 20 '12 at 15:29
    
@user933925 great, you may want to add how you solved it and the way how you found out about it as an answer to your question and mark that as the answer. That way other people with the same problem can use your description to solve the problem for them, too. –  Steffen Winkler Dec 21 '12 at 8:37
    
First,I used lsof -i command to check for the internet sockets currently opened.I saw that only ssh was open.No httpd running. $lsof -i COMMAND PID USER FD.. ssh 9200 admin …. I checked firewall status and noticed only port 22 is enabled. $sudo ufw status Status: active To Action From -- ------ ---- 22 ALLOW Anywhere 22 ALLOW Anywhere (v6) So I enabled port 80 using this command $sudo ufw allow 80 Restarted apache, and tried address.net again. It worked! –  Mae B Dec 21 '12 at 11:26
    
@user933925 copy and paste that as a new answer to your question and then mark your answer as solved. –  Steffen Winkler Dec 21 '12 at 12:46
up vote 0 down vote accepted

First, I used lsof -i command to check for the internet sockets currently opened.

$lsof -i
COMMAND PID USER FD.....
ssh 9200 admin ….....

I saw that only ssh was open. No httpd running.
I checked firewall status and noticed only port 22 was enabled.

$sudo ufw status

Status: active
To Action From
-- ------ ----
22 ALLOW Anywhere
22 ALLOW Anywhere (v6)

So I enabled port 80 using this command:
$sudo ufw allow 80

Restarted apache, and tried address.net again. It worked!

share|improve this answer

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.