记录一下lampp配置域名目录的过程。

来源:互联网 发布:qq三国js四象搭配 编辑:程序博客网 时间:2024/06/06 01:01

1.修改hosts文件:/etc/hosts

127.0.0.1 xxx.yyy.zzz

2.进入到 lampp/etc目录。

sudo gedit httpd.conf

搜索 “Include conf/extra/httpd-vhosts.conf”,确保前面没有 # 注释符

搜索 "<Directory />"

变成:

<Directory />
#    AllowOverride none
#    Require all denied
Order allow,deny  
Allow from all  
</Directory>

这一步不做处理,后面生成的自定义目录,访问xxx.yyy.zzz,很有可能是403。除非你的目录是在/lampp/htdocs中。

3.进入到lampp/etc/extra:

sudo gedit httpd-vhosts.conf

1.注释掉不用的VirtualHost

2.添加如下

NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/home/user/php/yyy"
ServerName xxx.yyy.zzz
</VirtualHost>

<Directory "/home/user/php/yyy">
#Options FollowSymLinks
#AllowOverride None
Order deny,allow
Allow from all
</Directory>

<VirtualHost *:80>
DocumentRoot "/opt/lampp/htdocs/"
ServerName localhost
</VirtualHost>


完事重启apache


0 0
原创粉丝点击