2

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

These are what I did so far:

1) ssh [email protected] [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.

3
  • 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, 2012 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?
    – Cere
    Dec 20, 2012 at 12:41
  • 1
    Resolved this. It's a firewall issue. Just enabled port 80 on firewall. Thanks again!
    – Cere
    Dec 20, 2012 at 15:29

2 Answers 2

1

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.

4
  • Resolved this. It's a firewall issue. Just enabled port 80 on firewall. Thanks again!
    – Cere
    Dec 20, 2012 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.
    – Wiste
    Dec 21, 2012 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!
    – Cere
    Dec 21, 2012 at 11:26
  • @user933925 copy and paste that as a new answer to your question and then mark your answer as solved.
    – Wiste
    Dec 21, 2012 at 12:46
0

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!

You must log in to answer this question.

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