K
K
kwayne2019-10-02 16:45:26
Apache HTTP Server
kwayne, 2019-10-02 16:45:26

How to set up apache www folder sharing for editing by other developers?

I use Debian, Apache 2.4
On the test server, I need to change /var/www to /srvdata1/www so that other progers can make the necessary changes to files over the network.
All progers sit on Windows.
With the current settings, other users (test) can place their files in the directory, but only pages created by root are viewed in the browser.
Response in browser:
" Forbidden
You don't have permission to access /1/index.htm on this server.
"
My actions...
Created a folder:
mkdir /srvdata1/www
chmod 777 /srvdata1/www
In apache2.conf next. settings:
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
In 000-default.conf (sites-available and sites-enabled):
DocumentRoot /srvdata1/www/
Created user:
useradd test
passwd test 12345
smdbpasswd -a test 12345
Samba settings:

security=user
passdb backend=tdbsam
unix charset=utf- 8
dos charset = cp932
[www]
comment = web content folder
path = /srvdata1/www/
browseable = yes
create mask = 0660
directory mask = 0771
writable = yes
guest ok = no
locking = no
force user = test

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
chupasaurus, 2019-10-02
@chupasaurus

In debian, there is a user and group www-data for this. One-liner to set permissions:

chown -R www-data:www-data /srvdata1/www && usermod -a -G www-data test
( careful: will change the owner in all files ).
And in smb.conf:
[www]
force group = www-data

777 rights can ruin you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question