Example of Config Apache (Xampp) To code other than htdocs

1. Locate to C:\Windows\System32\drivers\etc and open hosts using text editor.
Add line to C:\Windows\System32\drivers\etc\host 
(this file need save to outside this directory due to access forbidden and then replace this file by pasting to this directory)


127.0.0.1 localhost ::1 localhost

127.0.0.1       yii.hd  (this is the example name)

2.Open the main Apache configuration file, httpd.conf, in a text editor. It's in the Apache conf folder. 
If you're using XAMPP, the file is located at xampp setup director \apache\conf\httpd.conf. 
Scroll down to the Supplemental configuration section at the end, 
and locate the following section (around line 500):


#Virtual hosts
#Include conf/extra/httpd-vhosts.conf


Remove the # from the beginning of the second line so the section now looks like this:


#Virtual hosts
Include conf/extra/httpd-vhosts.conf


Save httpd.conf and close it.


3.Add line to httpd-vhost.conf (located at xampp setup director \apache\conf\extra\httpd-vhosts.conf. ),example


<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "E:\YII\basic"
    ServerName yii.hd
</VirtualHost>

4. Add line to httpd.conf files, example list below:
<Directory "E:/YII/basic">
    AllowOverride All
    Options None
    Require all granted
</Directory>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值