第一次写博客,那个激动啊,喝口可乐降动先
好了,记录一下自己开启apache虚拟目录的经历
找到apache的配置文件httpd.conf,Centos上面一般是安装目录的conf文件夹里面
ex:/usr/local/apache/conf/httpd.conf
用vi打开httpd.conf:
#vi /usr/local/apache/conf/httpd.conf
利用vi搜索找到:
#Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf
去掉前面的'#'号
保存后退出
进入apache的extra目录:
#cd /usr/local/apache/conf/extra
打开httpd-vhosts.conf:
#vi httpd-vhosts.conf
开发时,可参考以下配置
在httpd-vhosts.conf添加
<VirtualHost *:80>
ServerAdmin xxxxxx@163.com
DocumentRoot "/usr/loca/apache/htdocs"
ServerName www.xxx.com
ServerAlias www.xxx.com
ErrorLog "logs/xxx-error.log"
CustomLog "logs/xxx-access.log" combined
<Directory "/usr/local/apache/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
ServerAdmin 这是管理员邮箱
DocumentRoot 这是网站虚拟路径
ServerName 这是网站地址
ErrorLog 这是网站错误日志
CustomLog 这是网站日志
仅此奉上,欢迎各位指导
Centos下配置Apache的虚拟目录
最新推荐文章于 2023-12-20 19:43:51 发布