apache配置虚拟主机的方法详解

yipeiwu_com6年前PHP代码库
1.apache配置文件中打开vhost的配置
LoadModule vhost_alias_module modules/mod_vhost_alias.so
Include conf/extra/httpd-vhosts.conf

2.extra目录中的httpd-vhosts.conf
里面进行配置,有三个:第一个DocumentRoot,项目的绝对目录,后面以/结尾;第二个是ServerPath,与DocumentRoot一致;第三个是ServerName,自己在浏览器中输入的域名。如:test.123.cn

3.在hosts文件中位域名指向。如:127.0.0.1  test.123.cn

相关文章

fleaphp常用方法分页之Pager使用方法

Pager 分页函数 复制代码 代码如下: /** * 构造函数 * * 如果 $source 参数是一个 TableDataGateway 对象,则 FLEA_Helper_Pager...

asp函数split()对应php函数explode()

<?php //利用 explode 函数分割字符串到数组 $source = "hello1,hello2,hello3,hello4,hello5";//按逗号分离...

php 获取全局变量的代码

复制代码 代码如下: function cleanGlobal($global_array, $arg, $specialchars = true, $default = null) {...

PHP间隔一段时间执行代码的方法

本文实例讲述了PHP间隔一段时间执行代码的方法。分享给大家供大家参考。具体分析如下: PHP如何设置每隔一段时间自动执行某段代码?例如定时生成静态文件之类的,这就需要设置休眠时间,即每隔...

统计PHP目录中的文件数方法

代码示例如下: <?php $folderPath = "upload/"; $countFile = 0; $totalFiles = glob($folderPat...