centos7 Apache 网站出现403无法访问
我使用的是centos7,安装Apache 2.4.x,并且还安装了vsftpd,配置了用户 xxx.com
根目录 /var/virtual/xxx.com/public_html,用户目录 /var/virtual/xxx.com
当我设置 /var/virtual/xxx.com/public_html 的所有者为 Apache的时候,可以访问。
但vsftpd无法登录,改为 xxx.com 这个用户,vsftpd可以登录,Apache访问出现403提示。
[root@localhost virtual]# mkdir -p /var/virtual/xxx.com/{public_html,logs,backup}
[root@localhost virtual]# useradd xxx.com -g apache -d /var/virtual/xxx.com
[root@localhost virtual]# chown xxx.com: -R /var/virtual/xxx.com
[root@localhost virtual]# ls -l /var/virtual/xxx.com
total 12
drwxr-xr-x 2 xxx.com apache 4096 Sep 9 00:50 backup
drwxr-xr-x 2 xxx.com apache 4096 Sep 9 00:51 logs
drwxr-xr-x 2 xxx.com apache 4096 Sep 9 09:50 public_html
[root@localhost virtual]# ftp localhost
Trying ::1...
ftp: connect to address ::1Connection refused
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
220 (vsFTPd 3.0.2)
Name (localhost:root): xxx.com
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (127,0,0,1,34,100).
150 Here comes the directory listing.
drwxr-xr-x 2 1000 48 4096 Sep 08 16:50 backup
drwxr-xr-x 2 1000 48 4096 Sep 08 16:51 logs
drwxr-xr-x 2 1000 48 4096 Sep 09 01:50 public_html
226 Directory send OK.
ftp> exit
221 Goodbye.
[root@localhost virtual]#
[root@localhost virtual]# sestatus
SELinux status: disabled
[root@localhost virtual]# uname
Linux
[root@localhost virtual]# uname -a
Linux localhost.localdomain 3.15.4-x86_64-linode45 #1 SMP Mon Jul 7 08:42:36 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost virtual]#
备注
selinux已经关闭
Nemo夜愿
10 years, 3 months ago