在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>
#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>