1

I am facing a peculiar problem with apache2 running on debian 8. I followed a couple of tutorials to install it and everything worked great. The problem is that i have partitioned the disk as 9gb for the system files, 1gb swap and 30gb for the home folder so I wanted to move the www folder from it's current location (/var/www) to home(/home/www). I found more than a few guides on how to do that, some saying that i should change the lines in apache2.conf from this:

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

to this:

<Directory /home/paul/www/>
  Options Indexes FollowSymLinks
  AllowOverride All
  Order deny,allow
    Allow from all
</Directory>

As well as the documentRoot

Others suggested using the 000-default.conf file located in the /etc/apache2/sites-available folder and change the default folder from /var/www to /home/paul/www.

I did both and the folder was seen but not accessible, so i used the quick solution and use chroot 777. After that apache redirected me back to /var/www. All settings point to /home/paul/www and the www folder has full read write permission. In fact neither the apache.conf nor 000-sites-available has any reference of /var/www so why does apache keep pointing me there? Is there something i missed?

p.s i did updates and upgrades multiple times as well as restarted the apache service and the entire pc.

PaulB
  • 1,554
  • 2
  • 16
  • 34

2 Answers2

0

you need to change the ownership of files to allow apache there please try

chown -R www-data /home/paul/www/

however if you set a particion for your paul www why not mount the partition in /var/www

or you can create a symlink

ln -s /home/paul/www /var/www/paulsite

then edit your apache conf accordingly.

Regarding the edited file I recomend you use the 000-default better. in fact i would use that as a skeletone. and create a new file for your site then enable that site.

jstuartmilne
  • 4,398
  • 1
  • 20
  • 30
  • I already did your first suggestion. The folder www and all it's contents have full read write permissions. I will try the symlink suggestion which looks very promising. – PaulB Nov 18 '15 at 10:35
  • could you post your /etc/fstab to check how you are mounting the partition? – jstuartmilne Nov 18 '15 at 10:50
  • nevermind. I got it with a different method. Thank you for your help though. – PaulB Nov 18 '15 at 18:15
0

Ok so with a little research i realized that what i was trieing to do was not the best practice at all! (Thanx for the heads up Sudakatux). I found the solution in askubuntu for anyone interested.

Instead of trieing to change the mechanics of apache i enabled the userdir module and set up public_html in my home folder with 755 permissions. I use a redirection script from the initial location to the various locations on my home directory. Works just fine!

Community
  • 1
  • 1
PaulB
  • 1,554
  • 2
  • 16
  • 34