Resolves detailed methods for writing virtual directories to php in apache

  • 2020-06-19 09:54:52
  • OfStack

Step 1. First open the httpd.conf file in AppServ\ Apache2.2 \conf. Find it inside:
LoadModule rewrite_module modules/ mod_rewrite.so, drop the "#" before it.
Step 2. Find: Include conf/extra/ httpd-vhosts.conf Remove the "#" in front of him. (Critical)
And then you find:
< Directory / >
Options FollowSymLinks ExecCGI Indexes
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
< /Directory >
Change it to:
< Directory / >
Options FollowSymLinks ExecCGI Indexes
AllowOverride All
Order deny,allow
Deny from all
Satisfy all
< /Directory >
But step 2, step 1, seems to be ok during my setup. So I think it depends.
Step 3. Again, it is found in this file:
DocumentRoot "E:/AppServ/www/", change it to the path we want to display by default. Such as:
DocumentRoot "E: / AppServ/www/www/".
Try to make:
< Directory "E:/AppServ/www/" > Also changed to:
< Directory "E:/AppServ/www/www/" > .
Step 3 also seems unnecessary. Well, I don't understand this. During my setup. It seems like sometimes it's right not to set this. Sometimes it doesn't seem right not to set this. It depends. It's better to set it.
Step 4: Save the file. Then go to AppServ\ Apache2.2 \conf\extra and open the httpd-ES87en.conf file:
Put inside:
< 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 is changed to:
< 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 >
Configure as many of these virtual directories as you can.
And save it.
Step 5: Find the hosts file in C:\WINDOWS\system32\drivers\etc and open:
Add:
127.0.0.1 localhostes
Multiple virtual names can be specified such as:
127.0.0.1 localhostes local.
Save.
That's it.
Restart apache. Mine is appserv. I restart. Then write in the browser:
http: / / localhostes. Try enter.
That's interesting. If it doesn't look good to you. Replace localhostes with:
?
Isn't that cool?

Related articles: