6

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.

Håvard Geithus
  • 5,544
  • 7
  • 36
  • 51
chaser
  • 3,107
  • 4
  • 29
  • 34

4 Answers4

12

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
freejosh
  • 11,263
  • 4
  • 33
  • 47
mujaffars
  • 1,395
  • 2
  • 15
  • 35
1

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.

Jon Kartago Lamida
  • 827
  • 1
  • 7
  • 12
  • It's not the permission/security of the folder. I changed the name of the folder to just documents without the brackets and I don't get the forbidden error anymore. Can you think of anything else? I'm using WAMP 2.2 if that's any help. – chaser Mar 25 '13 at 03:28
0

Just in case someone comes across this as I did.

I had permissions problems on the parent folder of the directory I was trying to set as the DocumentRoot.

I found allowing the SYSTEM user Full Control privileges fixed the problem.

adamdama
  • 43
  • 6
0

If you have permission problems (403 denied), and you are using newer WAPMs, e.g.

-wampserver2.5 with

-Apache-2.4.9

-Mysql-5.6.17

-php5.5.12-64b

you may want to check httpd.conf code (ca #240):

    AllowOverride none
    Require all denied

and change it to:

Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all

Also, you may want to: take a look at this

Jeffz
  • 2,075
  • 5
  • 36
  • 51