Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I finally got networking to work, but the only page I can access is 127.0.0.1:8080. If I, for example, attempt to access http://localhost:8080/upload/install/install.php I get the following error:

This webpage is not available The connection to 127.0.0.1 was interrupted.

What should I do to gain access to all files in "/var/www"?

I already tried some things with apache's config files but I guess I messed them up so I apt-get remove apache2 --purge and apt-get install apache2.

I have also installed a complete LAMP server with phpMyAdmin, which I also can't access.

share|improve this question
    
Did you already try localhost/upload/install/install.php ?? It seems that including the port number (8080) in the address won't result in what you wish. –  Geppettvs D'Constanzo Oct 7 '12 at 1:15
    
ADDED: Im sorry, I forgot to add that the ubuntu server is on virtual machine and networking is set up trought port forwarding of vm so when i type 127.0.0.1:8080 i get to servers 10.0.2.15:80. I messed something ub thatswhy I didn't had 403 anymore, I reinstalled the whole server and again, I get 403 Forbidden. How do I get permission to access the server? –  IvarsB Oct 7 '12 at 18:03
    
Guess this is already solved (as indicated by your comment on my answer). A 403 indeed points to a permission problem. Hint for further error codes: List of HTTP status codes –  Izzy Oct 7 '12 at 19:14

1 Answer 1

up vote 0 down vote accepted

The error message rather indicates the server being unable to reach. Are you sure you configured it to listen on port 8080? Check the following things:

  1. check your /etc/apache2/ports.conf what ports you have configured Apache to listen on. It's shown in the line starting with "Listen", and by default points to port 80
  2. run netstat -a -t -n to check for listening services. The column "State" should show "LISTEN" here, and the column "Local Address" has your local services. In this column, the port in use is printed after a colon, so e.g. "*:8080" would indicate there is something listening on port 8080
  3. check your Apache error log file for details. If not configured otherwise, you should find it in /var/log/apache2/error.log

The most likely cause is you set up Apache to listen on port 80 (which is the default), and now try to follow some tutorial which assumes otherwise. It might also involve configuring a virtual host, and you skipped this step (or didn't succeed here).

If, on the other hand, your configuration is to have Apache listen on port 8080, and it is listed by above netstat command properly, it could be some permission problem -- though that normally should be indicated by a different error. Just to make sure you can rule this out:

  1. check what user Apache is running under. This usually is www-data:www-data (i.e. user and group is www-data). Using the command ps -aeo "%p %U %G %x %c" |grep apache you should see all Apache processes, having the user and group in the second and third column.
  2. check directory and file permissions. Either user or group should have at least read and execute on the directories, and read on the files. Having your DOCUMENT_ROOT in /var/www, for example, and accessing an index.html there, the file must be at least readable to Apache's user or group, and /var as well as /var/www should have read and execute permissions given.
share|improve this answer
    
I had to change permissions, found a tutorial to do that - joomla-and-more.com/2009/10/28/…. Thanks everyone! –  IvarsB Oct 7 '12 at 18:41

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.