linux - 初学服务器设置,网站目录权限一直没弄明白到底应该怎么设置
阿神
阿神 2017-04-17 11:36:45
0
2
726

我安装的是ubuntu server,FTP软件是vsftpd,WEB服务器软件是apache,

假如网站目录是:/var/www ,FTP使用本地账号:ftp_user,apache是:www-data,

应该把网站目录交给哪个用户?我都有试过,总有些问题如没权限访问、FTP不能删除此类问题。

请教正确的处理方式应该是什么,既能正常使用,也能保证安全。

阿神
阿神

闭关修行中......

reply all(2)
阿神

Be sure to use FTP.

Add ftp_user to the www-data group, and then set /var/www to be owned by ftp_user, the group is www-data, and the permissions are 750. For directories that require write permissions for the web server, press g+w.

黄舟

Generally speaking, the permissions of ftp should be consistent with the permissions of apache, for example, both use the www-data user. This can avoid many permission problems, such as ftp being unable to modify or delete files, apache showing 403, etc.
If there is more than one user using ftp to upload, and you want to distinguish between different users, you can put all ftp user accounts and www-data into the same group.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template