Apache – Install Apache 2.4.7 on Ubuntu 14.04

apacheUbuntu

I have a following problem.
Install Apache 2.4.7 on Ubuntu.
I created file in directory /etc/apache2/sites-available/

<VirtualHost ooo.net:80>

ServerName ooo.net
ServerAlias www.ooo.net
ServerAdmin webmaster@ooo.net
DocumentRoot /home/user/ooo/

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

in hosts

127.0.0.1   ooo.net
127.0.1.1   pc

I visited ooo.net and saw following result

Forbidden
You don't have permission to access / on this server.
Apache/2.4.7 (Ubuntu) Server at localhost Port 80

What am I doing wrong?

error.log –

[Sat Apr 12 19:30:57.276525 2014] [core:error] [pid 1213:tid 140219565360896] (13)Permission denied: [client 127.0.0.1:37136] AH00035: access to / denied (filesystem path '/home/user/ooo') because search permissions are missing on a component of the path
[Sat Apr 12 19:30:57.539816 2014] [core:error] [pid 1213:tid 140219556968192] (13)Permission denied: [client 127.0.0.1:37136] AH00035: access to /favicon.ico denied (filesystem path '/home/user/ooo') because search permissions are missing on a component of the path

access.log –

127.0.0.1 - - [12/Apr/2014:19:30:57 +0400] "GET / HTTP/1.1" 403 495 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/33.0.1750.152 Chrome/33.0.1750.152 Safari/537.36"
127.0.0.1 - - [12/Apr/2014:19:30:57 +0400] "GET /favicon.ico HTTP/1.1" 403 505 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/33.0.1750.152 Chrome/33.0.1750.152 Safari/537.36"

ls -ltr after first answer –

drwxr-sr-x 2 user www-data   4096 апр.  10 20:41 errors
-rwxr-sr-x 1 user www-data   9062 апр.  10 20:41 about.htm
-rwxr-sr-x 1 user www-data   7116 апр.  10 20:41 admin.htm
-rwxr-sr-x 1 user www-data   2884 апр.  10 20:41 admin_art.inc
-rwxr-sr-x 1 user www-data 367112 апр.  10 20:41 ARIAL.TTF
-rwxr-sr-x 1 user www-data   4767 апр.  10 20:41 admin_d2.inc
-rwxr-sr-x 1 user www-data   2958 апр.  10 20:41 admin_exb.inc
-rwxr-sr-x 1 user www-data   2369 апр.  10 20:41 admin_faq.inc
-rwxr-sr-x 1 user www-data   1846 апр.  10 20:41 admin_fbk.inc
-rwxr-sr-x 1 user www-data   1791 апр.  10 20:41 admin_fbk2.inc
-rwxr-sr-x 1 user www-data   2657 апр.  10 20:41 admin_gbk.inc
-rwxr-sr-x 1 user www-data   3881 апр.  10 20:41 admin_frm.inc
-rwxr-sr-x 1 user www-data   2616 апр.  10 20:41 admin_gbl.inc
-rwxr-sr-x 1 user www-data   8197 апр.  10 20:41 admin_img.inc
-rwxr-sr-x 1 user www-data   7352 апр.  10 20:41 admin_new.inc

Best Answer

The problem relies in the fact that Apache default configuration is a bit more restrictive from 2.4.3 onwards. Directories outside the default Document Root are prohibited by default and have to be enabled explicitly. See: Install Apache web server on Ubuntu 13.10

Basically you should add:

Require all granted

Underneath somewhere under the Directory directive.

Related Topic