基于域名的apache服务器
1承接上個博客說的,咱們繼續(xù)擴(kuò)展
Cd /usr/local/apache2/conf
/usr/local/apache2/conf/extra擴(kuò)展文件
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 “l(fā)ogs/blog-error_log”
CustomLog “l(fā)ogs/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的以后再研究,這個用的比較多一點(diǎn)
總結(jié)
以上是生活随笔為你收集整理的基于域名的apache服务器的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Windows XP操作系统自带工具应用
- 下一篇: 小程序内嵌h5页面分享_微信小程序web