分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 技术分享

PHP 配置虚拟域名访问

发布时间:2023-09-06 01:35责任编辑:赖小花关键词:PHP配置

分以下三个步骤:

1、首页我们得找到host文件、这个文件在c盘中WINDOWS\system32\drivers\etc\hosts

在该文件中插入:

  # localhost name resolution is handled within DNS itself. ?  # ??127.0.0.1 ??????localhost ?  # ??::1 ????????????localhost ?  127.0.0.1 ??????localhost ?  127.0.0.2 ?????www.bobob.com ?  127.0.0.3 ?????www.shakalaka.com 


2、然后咱们得去找httpd.conf文件、这个文件相应位置在您服务器安装的目录下/\apache\conf\httpd.conf ,

   找到 “Include conf/extra/httpd-vhosts.conf  如果前面有# 则需要把它删掉

3、找到httpd-vhosts.conf文件,然后添加以下内容

<VirtualHost *:80> ?????ServerAdmin webmaster@dummy-host2.example.com ?????DocumentRoot "E:/m1905/ems" ?????????????????????//这个为您的项目目录 ?????ServerName www.emswxh.com ??????????????????????//这个为您在host中配置 ?????ErrorLog "logs/dummy-host2.example.com-error.log" ?????CustomLog "logs/dummy-host2.example.com-access.log" common ?</VirtualHost> ?

最后重启服务器就可以了。

原文链接:http://blog.csdn.net/tracywxh/article/details/8456512

 

PHP 配置虚拟域名访问

原文地址:https://www.cnblogs.com/LiberBlog/p/8270428.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved