分享

Linux版phpstudy配置多域名站点自定义路径

 昵称39846743 2017-04-10

现在有多个网站需要在Linux服务器上配置,选择了phpstudy,下面介绍多站点的配置方法:

phpstudy add | del | list                    添加虚拟主机 | 删除虚拟主机 | 查看虚拟主机列表

[root@VM_128_12_centos ~]# phpstudy add
 (Please input domains such as:www.phpstudy.net):www.linuxsight.com

Successfully create www.linuxsight.com vhost
 ################### information about your website ######################
 The DocumentRoot:/phpstudy/www/www.linuxsight.com

phpstudy会默认在/phpstudy/www/建立目录,但有时候我们并不想放在这里,我们想映射到其它地方。方法如下:

找到 /phpstudy/server/httpd/conf/vhosts 目录下

www.linuxsight.com.conf  文件  修改红色区域,改为你想要的路径

如下:(因为我把另一个硬盘分区挂载到了web目录下,这样即便重装数据也在)
<virtualhost *:80>
ServerName www.linuxsight.com
ServerAlias www.linuxsight.com
DocumentRoot /phpstudy/www/web/www.linuxsight.com
DirectoryIndex index.php index.html
<Directory /phpstudy/www/web/www.linuxsight.com>
Options +Includes +FollowSymLinks -Indexes
AllowOverride All
Order Deny,Allow
Allow from All
</Directory>
</virtualhost>
用同样的方法可以建立其它站点,二级域名也一样。

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多