I installed and set up all the LAMP services, and got it working from the www folder, thing it though I need it to point to a folder in my Dropbox (on the same partition)

I modified the /etc/apache2/sites-enabled/000-default.conf so it now looks like:

<VirtualHost *:80>
    ServerAdmin admin@mysite.com
    ServerName mysite.com
    ServerAlias www.mysite.com *.mysite.com
    DocumentRoot /home/alicia/Dropbox/Programing/PHP/intern-magnet
<Directory />
    Options FollowSymLinks
    AllowOverride None
    <Directory /home/alicia/Dropbox/Programing/PHP/intern-magnet/>
Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel info

    CustomLog /var/log/apache2/access.log common
    ServerSignature On

I also modified the permissions of the new root directory at every level making it drxr-xr-x / 755 The namei -m command outputed the following for the new root directory, which all looks fine to me:

drwxr-xr-x /
 drwxr-xr-x home
 drwxr-xr-x alicia
 drwxr-xr-x Dropbox
 drwxr-xr-x Programing
 drwxr-xr-x PHP
 drwxr-xr-x intern-magnet

The last few entries in the /var/log/apache2/error.log read:

[Sun Dec 21 13:38:09.265113 2014] [authz_core:error] [pid 8096] [client] AH01630: client denied by server configuration: /home/alicia/Dropbox/Programing/PHP/intern-magnet/favicon.ico
[Sun Dec 21 13:38:16.115896 2014] [authz_core:error] [pid 8097] [client] AH01630: client denied by server configuration: /home/alicia/Dropbox/Programing/PHP/intern-magnet/css
[Sun Dec 21 13:38:16.232509 2014] [authz_core:error] [pid 8097] [client] AH01630: client denied by server configuration: /home/alicia/Dropbox/Programing/PHP/intern-magnet/favicon.ico
[Sun Dec 21 13:38:22.717367 2014] [authz_core:error] [pid 8102] [client] AH01630: client denied by server configuration: /home/alicia/Dropbox/Programing/PHP/intern-magnet/favicon.ico

Oh yeah, and I am running Ubuntu GNOME 14.10

So basically it has not got permission, but WHY?! I have spent all day and most of last night trying to figure this out, I've gone through loads of tutorials, still can't see what I'm missing.

Any ideas or help would be much appreciated, thanks in advance :)

I have read some similar questions to this on askubuntu but none of the solutions workes, so I guess this is a different problem and therefore not a duplicate

  • It is a permissions problem. You are not really following best practices here and I advise you either move your files to /var/www/html (where they belong frankly) or enable home directories. Tons of ways of doing both, see askubuntu.com/questions/19898/… or similar. – Panther Dec 21 '14 at 20:21
  • If you are using Apache 2.4, you need to change Allow and Deny rule. Try first part of this answer. – Lety Dec 21 '14 at 20:25

It appears that you're running Apache 2.4; they changed the auth module between 2.2. and 2.4.

<Directory /home/alicia/Dropbox/Programing/PHP/intern-magnet/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    # Remove Apache 2.2 access controls
    #Order allow,deny
    #allow from all

    # Add Apache 2.4 access controls
    Require all granted

Other thoughts to consider: generally it is considered "best practice" to house your personal web development projects in ~/public_html, enable the usedir module a2enmod userdir, allow PHP to execute code there, and finally call the URL by browsing to http://localhost/~alicia/intern-magnet

Specific steps if you're interested in this tangent:

sudo a2enmod userdir
sudo $EDITOR /etc/apache2/mods-enabled/php5.conf
# Comment out lines "<IfModule mod_userdir.c> ... </IfModule>"
# This re-allows executing PHP code by users of your workstation, (presumably only you).
mkdir ~/public_html
ln -s ~/Dropbox/Programing/PHP/intern-magnet ~/public_html/intern-magnet
sudo service apache2 restart
# Develop and Profit!

Additional projects you start simply need their code linked to inside ~/public_html just like the above ln -s command, then browse to /~alicia/PROJECT_NAME_HERE!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.