在Linux下配置XAMPP和域名服务且修改根目录

在Linux下配置XAMPP和域名服务且修改根目录


示例项目名称:cdiwo

代码根目录:/home/wwwroot/cdiwo


1、修改code目录下面assets和protected权限为读写权限

2、修改hosts文件,打开finder,执行Shift+Command+G,输入/etc/hosts前往hosts文件夹。如果修改提示没有权限,则复制一份到桌面,修改后移回原文件夹即可。

3、修改Apache服务器httpd.conf文件,如果cdiwo程序在/home/wwwroot/cdiwo里面,在配置文件最下面加上:


#注意这里是配置根目录

DocumentRoot /home/wwwroot/cdiwo

<Directory "/home/wwwroot/cdiwo">    

        Options Indexes

        FollowSymLinks

        AllowOverride All

        Order allow,deny

        Allow from all

</Directory>


#这里才是配置程序目录

<VirtualHost *:80>

        DocumentRoot /home/wwwroot/cdiwo
        ServerName www. cdiwo.cc

</VirtualHost>


4、去掉/XAMPP/etc/extra/httpd-xampp.conf中下面的代码:

<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">

        Require local

        ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var

</LocationMatch>


如需转载,请注明出处: https://www.chadou.me/p/80

最新发布