0

Hi I've been trying to create a local web dev environment in my home folder. My local LAMP is running fine, and I tried this tutorial to develop without the hassle of the permissions in var/www http://ubuntuserverguide.com/2012/10/how-to-enable-and-configure-apache2-userdir-module-in-ubuntu-server-12-04.html

I'm getting a 403 forbidden error when trying to access it like so:

http://localhost/~asdf/

Please advise.

user126440
  • 167
  • 1
  • 2
  • 10

1 Answers1

0

technically the best place to put your web files is in /var/www//... But, if you create a virtual host in your machine and put some IP in /etc/hosts/ to point some "name". You can do that.

Virtual hosts:

cp -p /etc/apache/sites-avaliable/000-default.conf /etc/apache/sites-avaliable/myname.conf

sudo nano /etc/apache/sites-avaliable/myname.conf

edit the line:

serverName myname  

<Directory /var/www/myname/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

Save it, and run:

sudo a2ensite myname.conf  
sudo service apache2 reload  

Give some ip:

sudo nano /etc/hosts
127.0.0.1     myname

Save it and now go to browser:

http://myname/  

Now it's ok! :)