Change of user and directory in Apache
So, I'm trying to change the default user and default doc directory in apache on my Raspberry PI. I've successfully changed the user and group in the /etc/apche2/envvars file, and with that change everything seems to still be fine. The user is a member of the www-data group if that helps. I've then created a new folder in the home/user/ directory, and pointed the /etc/apache2/sites-enabled/000-default.conf file at it. I've put an index.html file in the directory, but when I attempt to browse to the PI, I get a forbidden error. Anyone know what I'm missing? This is the output of ls -l:
Code:
drwxr-xr-x 2 chadianscot chadianscot 4096 Mar 14 15:14 htmldocs The index.html file has the same permissions as the htmldocs folder. |
Hi there, and welcome to LQ.
I don't have access to my Pi right now, but can try and offer general Apache help so long... I assume "chadianscot" is the user you want to run the web server? Can you confirm that your change to the user and group worked, and the server is running as that user? You can do this by looking at the output from: Code:
ps -ef|grep httpd Good luck! |
Hi, yes chadianscot is the user (and group). The output of the
Code:
ps -ef|grep httpd Code:
chadian+ 2911 2822 0 10:07 pts/0 00:00:00 grep --color=auto httpd Code:
client denied by server configuration: /home/chadianscot/htmldocs/ |
Hi again,
Which version of Apache is this? Do you have any allow/deny directives in your /etc/apache2/sites-enabled/000-default.conf file? |
My sites enabled file looks like this
Code:
<VirtualHost *:80> Code:
Server version: Apache/2.4.10 (Raspbian) |
Hi,
I think you're missing an access control directive for the VirtualHost. Adding this should do: Code:
Require all granted |
What file do I add that to?
|
Quote:
Code:
<Directory /home/chadianscot/htmldocs> |
That worked! Thanks so much! I think it's supposed to be
Code:
<Directory "/home/chadianscot/htmldocs"> |
Quote:
You may mark the thread SOLVED Fro "Thread Tools" on top of the page Regards |
All times are GMT -5. The time now is 08:04 AM. |