Parse the detailed method of writing virtual directories to PHP in Apache _php tips
Source: Internet
Author: User
Step 1: First open the httpd.conf file inside the appserv\apache2.2\conf. Find in the inside:
LoadModule Rewrite_module modules/mod_rewrite.so This line, remove the "#" in front of him.
Step 2: Include conf/extra/httpd-vhosts.conf to remove the "#" in front of him. (Very critical)
And then find it again:
<directory/>
Options followsymlinks execcgi Indexes
AllowOverride None
Order Deny,allow
Deny from all
Satisfy All
</Directory>
Change it to read:
<directory/>
Options followsymlinks execcgi Indexes
AllowOverride All
Order Deny,allow
Deny from all
Satisfy All
</Directory>
But step 2 does not seem to be set during my setup. So I think it depends on the situation.
Step 3, or in this file, find:
DocumentRoot "e:/appserv/www/" and change it to the path we want to display by default. Such as:
DocumentRoot "e:/appserv/www/www/".
you will also: <directory "e:/appserv/www/" > also changed to:
<directory "e:/appserv/www/www/" >.
Step 3 seems to have no need to set up. Alas, I do not understand this. In the course of my setup. It seems that sometimes it is right to not set this. It seems like sometimes it's not right to set this. Let's see what happens. It's better to set it up.
Step 4: Save the file. And then to the Appserv\apache2.2\conf\extra inside the httpd-vhost.conf file opens:
Will be inside the:
<virtualhost *:80>
ServerAdmin webmaster@dummy-host2.x
DocumentRoot "c:/apache2.2/docs/dummy-host2.x"
ServerName dummy-host2.x
ErrorLog "Logs/dummy-host2.x-error.log"
Customlog "Logs/dummy-host2.x-access.log" common
</VirtualHost>
This configuration should read: <virtualhost *:80>
ServerAdmin webmaster@dummy-host2.x
DocumentRoot "E:\AppServ\www\www"
ServerName localhostes
ErrorLog "Logs/dummy-host2.x-error.log"
Customlog "Logs/dummy-host2.x-access.log" common
</VirtualHost>
How many of these virtual directories are configured.
and then save.
Step 5: Find the Hosts file inside the C:\WINDOWS\SYSTEM32\DRIVERS\ETC, open:
On the last side, add:
127.0.0.1 localhostes
You can specify multiple virtual names such as:
127.0.0.1 Localhostes Local.
Save.
Done.
Restart Apache. Mine is Appserv. I reboot. Then write in the browser:
Http://localhostes. Try the carriage return.
It's interesting. If you don't feel good. Just replace the localhostes with:
It?
Is it cool?
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.