1承接上个博客说的,咱们继续扩展
Cd /usr/local/apache2/conf
/usr/local/apache2/conf/extra扩展文件
Vi httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin 1327629137@qq.com
DocomentRoot “/data/webapps/www1”
ServerName www.wugk1.com
<Directory “/data/webapps/www1”>
AllowOverride AllowOverride
Options -Indexes FollowSymLinks
Order allow,deny
Allow from allow
Errorlog logs/error_log
CustomLog logs/access_log commom
<VirtualHost *:80>
ServerAdmin 1327629137@qq.com
DocomentRoot “/data/webapps/www2”
ServerName www.wugk1.com
<Directory “/data/webapps/www2”>
AllowOverride AllowOverride
Options -Indexes FollowSymLinks
Order allow,deny
Allow from allow
Errorlog logs/error_log
CustomLog logs/access_log commom
mkdir -p /data/webapps/{www1,www2}
ll /data/webapps/
2cd C:\Windows\System32\drivers\etc
192.168.118.129 www.wugk1.com
192.168.118.129 www.wugk2.com
3http.conf
下面一行注释
<VirtualHost *:80>
ServerAdmin 31333741@qq.com
DocumentRoot “/data/webapps/www1”
ServerName blog.etiantian.org
ServerAlias etiantian.org
ErrorLog “logs/blog-error_log”
CustomLog “logs/blog-access_log” common
用这个
httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName
Syntax OK
警告
3.1解决上面的Warning问题。修改主配置文件的ServerName配置。
ServerName 127.0.0.1:80
/usr/local/apache2/bin/apachectl -t
Syntax OK
4Forbidden
You don’t have permission to access / on this server.
解决http.conf问题文末加
#vhosts blog
<Directory “/data/webapps/www1”>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
访问http://blog.etiantian.org/
基于ip的以后再研究,这个用的比较多一点