D
D
difficultnicknameforcommu2015-11-25 04:12:52
linux
difficultnicknameforcommu, 2015-11-25 04:12:52

How to change apache working folder?

There is an Ubuntu 14.04.3 LTS server running apache. I'm trying to change the home folder of sites.
I create a config file like this:

<VirtualHost *:80>
        DocumentRoot "/web/site1/public_html/www/"
        ServerName "test1.ru"
        ErrorLog /web/site1/error_log
        CustomLog /web/site1/access_log combined
       	AssignUserId site1 site1
</VirtualHost>

The /web directory itself has the following content:
drwxr-xr-- 4 site1 site1 4096 Nov 24 19:18 site1
I register hosts on the local machine, I try to go to test1.ru, and in response I get an error:
You don't have permission to access / on this server.
I do not understand what is the error, where are the wrong rights?
I did everything according to the instructions: habrahabr.ru/post/92107

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2015-11-25
@Stalker_RED

Check if the path is correct and if the user under which the server is running (most likely www-data) has access to this directory.

L
link_irk, 2015-11-25
@link_irk

Try adding a directive

<Directory /web/site1/public_html/www/>
  AllowOverride All
</Directory>

To make it look like this:
<VirtualHost *:80>
        DocumentRoot "/web/site1/public_html/www/"
        ServerName "test1.ru"
        ErrorLog /web/site1/error_log
        CustomLog /web/site1/access_log combined
       	AssignUserId site1 site1
        <Directory /web/site1/public_html/www/>
         	AllowOverride All
       	</Directory>
</VirtualHost>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question