apache添加多用户

在apache的配置文件httpd.conf里启用多站点功能
#Include conf/extra/httpd-vhosts.conf
把上面这个#去掉

来到主配置文件httpd.conf,找到
User    daemon
Group  daemon
这代表这是apache 启动时使用的默认用户,所以我们创建网站文件夹一定要用 这个用户或你可以换成你喜欢的普通用户
如果你正在 root ,请su - daemon 然后开始创建 (如该用户被设置成禁止登录,则可以root 创建后文件夹后,chown 给daemon)

譬如/var/www8081  就是网站的根目录.本课时使用root创建,然后修改owner

chown -R daemon:daemon www8081




Listen 8081
<Directory "/var/www8081">
 Options FollowSymLinks
 AllowOverride all
 Require all granted
</Directory>


<VirtualHost *:8081>
  #  ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "/var/www8081"
    ServerName localhost:8081
    DirectoryIndex index.php index.html
 #  ServerAlias abc.jthink.com  bb.jtthink.com
 #  ErrorLog "logs/dummy-host.example.com-error_log"
  # CustomLog "logs/dummy-host.example.com-access_log" common
</VirtualHost>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值