Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the root directory in WAMP

Tags:

wampserver

I'm looking to change the root directory to point the directory to the following location:

C:\Documents and Settings\User\My Documents[documents]\wamp

I know that I have to change the apache http.conf file in the following lines

DocumentRoot "c:/Documents and Settings/User/My Documents/[documents]/"

However, it seems that the square brackets besides [documents] are causing the Forbidden Error to be displayed:

Forbidden

You don't have permission to access /login/ on this server.

Is there any way to use square brackets in the directory tree? [documents] is named for a particular purpose, and it needs to stay that way. Otherwise, I will need to do alot of recoding.

What are the rules if any when pointing to a directory tree?

Thanks in advance.

like image 234
chaser Avatar asked Mar 18 '13 08:03

chaser


2 Answers

I was getting same forbidden error (In windows machine for wamp), after lot of r & d I found that there is need to change default virtual host in httpd-vhosts.conf file which is present in:

C:\wamp\bin\apache\Apache2.2.17\conf\extra  

(change directory c:/wamp/www to what you want)

From :

ServerAdmin webmaster@localhost  
DocumentRoot “c:/wamp/www”  
ServerName localhost  
ErrorLog “logs/localhost-error.log”  
CustomLog “logs/localhost-access.log” common  

To:

ServerAdmin webmaster@localhost
DocumentRoot “E:/wamp/www”
ServerName localhost
ErrorLog “logs/localhost-error.log”
CustomLog “logs/localhost-access.log” common
like image 132
mujaffars Avatar answered Sep 24 '22 07:09

mujaffars


Right click your folder, select properties, then go to security tab. Edit proper permission for that folder so that apache user can have permission to access that folder.

I have tested that scenario in my system and DocumentRoot folder with bracket inside the name can work without problem.

like image 31
Jon Kartago Lamida Avatar answered Sep 21 '22 07:09

Jon Kartago Lamida