源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

winxp apache用php建本地虚拟主机的方法

  • 时间:2021-08-05 05:49 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:winxp apache用php建本地虚拟主机的方法
[b]1 在C:\WINDOWS\system32\drivers\etc\hosts[/b] 添加如下代码: 127.0.0.1 localhost 127.0.0.1 x.test.com x.test1.com x.test2.com 注:x.test.com(假设的DNS) [b]2 在E:\WAMP\Apache2.2\conf\extra\httpd-vhosts.conf[/b] 修改内容: NameVirtualHost * <VirtualHost *> ServerAdmin web@xxx.com DocumentRoot E:/WAMP/www ServerName localhost ErrorLog logs/localhost-error_log CustomLog logs/localhost-access_log common </VirtualHost> <VirtualHost *> ServerAdmin web@xxx.com DocumentRoot E:/WAMP/www/app (应用目录) ServerName test.com ServerAlias x.test.com admin.teeume.com ErrorLog logs/x.test.com-error_log CustomLog logs/x.test.com-access_log common </VirtualHost> <VirtualHost *> ServerAdmin web@xxx.com DocumentRoot E:/WAMP/www/app/assets ServerName x.test1.com ErrorLog logs/img.test1.com-error_log CustomLog logs/img.test1.com-access_log common </VirtualHost> #自己建的目录 <VirtualHost *> ServerAdmin web@xxx.com DocumentRoot E:/WAMP/www/test/assets ServerName x.test2.com ErrorLog logs/img.test2.com-error_log CustomLog logs/img.test2.com-access_log common </VirtualHost> ============================ [b]3 检查是否关联php[/b] 在E:\WAMP\Apache2.2\conf 找到httpd.conf 在末尾是否有如下在代码: ############start for php5 LoadModule php5_module E:/WAMP/php5/php5apache2_2.dll PHPIniDir E:/WAMP/php5 AddType application/x-httpd-php .php .phtml .php5 AddType application/x-httpd-php-source .phps #####end for php5 若无则添加上以代码。 [b]4 查找[/b] # Virtual hosts #Include conf/extra/httpd-vhosts.conf [b]改为 [/b]# Virtual hosts Include conf/extra/httpd-vhosts.conf [b]5 查找 [/b]<IfModule dir_module> DirectoryIndex index.html </IfModule> [b]改为 [/b]<IfModule dir_module> DirectoryIndex index.html index.html.var index.php </IfModule> 6 查找 <Directory "E:/WAMP/Apache2.2/htdocs"> 改为 <Directory "E:/WAMP/www"> (www为apache应用目录) 7 查找 DocumentRoot "E:/WAMP/Apache2.2/htdocs" 改为 DocumentRoot "E:/WAMP/www" 8 查找 ServerRoot "E:/XXX/Apache2.2" (apache安装目录) 改为 ServerRoot "E:/WAMP/Apache2.2" (apache服务器目录) 9 x.test.com x.test1.com x.test2.com 分别输入以上三个进行测试
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部