To Modify a directory:
The default file root directory (documentroot) for Apache HTTP Server is:
DocumentRoot "C:/Program Files/apache Software Foundation/apache2.2/htdocs"
The operations for modifying the Apache file root (documentroot) are as follows:
Open it
C:/Program Files/apache Software foundation/apache2.2/conf/httpd.conf
1. Revise
DocumentRoot "C:/Program Files/apache Software Foundation/apache2.2/htdocs"
For
Umentroot "C:/htdocs"
2.
Modify
# This should is changed to whatever your set DocumentRoot to.
#
<directory "C:/Program files/apache Software Foundation/apache2.2/htdocs" >
For
<directory "C:/htdocs" >
Save httpd.conf, restart Apache
setting up a virtual directory
:
Suppose your Apache file root directory is:
C:/htdocs
You want to set a virtual directory, alias (alias) is B, the virtual directory path is c:/htdocs/test
You need to add the following code to the Apache configuration file http.conf:
alias/b/"c:/htdocs/test/"
<directory "C:/htdocs/test" >
Options Indexes followsymlinks (remove Indexes will not show Apache directory list)
AllowOverride None
Order Allow,deny
Allow from all
</Directory>
Then save the configuration file http.conf.
After the Apache Service has been restarted, the virtual directory is in effect.
For example, you write a simple test.php file, and then store it in the C:/htdocs/test directory, and then in the browser to the following address to execute the PHP file.
http://localhost:8080/b/test.php
The actual path to the PHP file is:
c:/htdocs/test/test.php