Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

you don't have permission to access [custom alias] on this server

can anyone help with a following issue: I am using wamp to run projects in my chrome browser. after adding a newAlias which points to my project directory c:/dev/myProject I am getting Forbidden message: you don't have permission to access /newAlias on this server. I can access default Aliases such as phpmyadmin, webgrind... but i cannot access my own. I am using WampServer Version 2.5 64bit on Win 8.1 64bit located in c:/wamp. I tried basic stuff from the net but with no luck. Any suggestions?

Edit: content of newAlias:

Alias /bs1/ "c:/_DEV_/git/NewProject/www/" 

<Directory "c:/_DEV_/git/NewProject/www/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order allow,deny
    Allow from all
</Directory>
like image 686
fasola81 Avatar asked Oct 02 '14 22:10

fasola81


People also ask

How do you fix you don't have permission to access phpmyadmin on this server?

Change the file content of c:\wamp\alias\phpmyadmin. conf to the following. You should remember to set the Allow Directive to allow it from your local machine for security purposes. The directive Allow from all is insecure and should be limited to your local machine.


2 Answers

for allow permission for your server & wamp you require 3 steps please ensure these 3 things after that you can access your site from other network with ip address e.g http://192.168.1.1/yoursitefoldername (192.168.1.1 is you computer or vps ip address "yoursitefoldername" is folder name of your site which should be in your wamp->www folder)

1.

first of all Port 80 and 443 must be allow for both TCP and UDP packets. To do this, create 2 inbound rules for TPC and UDP on Windows Firewall for port 80 and 443. (or you can disable your whole firewall for testing but permanent solution if allow inbound rule)

2.

If you are using WAMPServer 3 See bottom of answer

For WAMPServer versions <= 2.5

You need to change the security setting on Apache to allow access from anywhere else, so edit your httpd.conf file.

Change this section from :

#   onlineoffline tag - don't remove
     Order Deny,Allow
     Deny from all
     Allow from 127.0.0.1
     Allow from ::1
     Allow from localhost

To :

#   onlineoffline tag - don't remove
    Order Allow,Deny
      Allow from all

if "Allow from all" line not work for your then use "Require all granted" then it will work for you.

WAMPServer 3 has a different method

In version 3 and > of WAMPServer there is a Virtual Hosts pre defined for localhost so dont amend the httpd.conf file at all, leave it as you found it.

Using the menus, edit the httpd-vhosts.conf file.

enter image description here

It should look like this :

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot D:/wamp/www
    <Directory  "D:/wamp/www/">
        Options +Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>

Amend it to

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot D:/wamp/www
    <Directory  "D:/wamp/www/">
        Options +Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Hopefully you will have created a Virtual Host for your project and not be using the wamp\www folder for your site. In that case leave the localhost definition alone and make the change only to your Virtual Host.

3. Dont forget to restart All Services of Wamp or Apache after making this change

like image 148
Hassan Saeed Avatar answered Jan 06 '23 01:01

Hassan Saeed


I've updated WAMP from 2.2.22 to 2.4.9 and found that new aliases didn't work (same error message as yours).

Checking the default aliases like phpmyadmin, I've found this:

Alias /phpmyadmin "c:/wamp/apps/phpmyadmin4.1.14/"

# to give access to phpmyadmin from outside 
# replace the lines
#
# Require local
#
# by
#
# Require all granted
#

<Directory "c:/wamp/apps/phpmyadmin4.1.14/">
   Options Indexes FollowSymLinks MultiViews
   AllowOverride all
  <IfDefine APACHE24>
    Require local
  </IfDefine>
  <IfDefine !APACHE24>
    Order Deny,Allow
      Deny from all
      Allow from localhost ::1 127.0.0.1
    </IfDefine>
  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360
</Directory>

If you see the contents of the file you'll notice the <IfDefine APACHE24> and <IfDefine !APACHE24> conditionals. So I've changed my alias .conf file from:

Alias /svn "c:/work/website-svn/" 

<Directory "c:/work/website-svn/">
    Options Indexes FollowSymLinks MultiViews

    AllowOverride all
    Order allow,deny
    Allow from all

</Directory>

to:

Alias /svn "c:/work/website-svn/" 

<Directory "c:/work/website-svn/">
    Options Indexes FollowSymLinks MultiViews

    Require local

</Directory>

That solved my problem, I hope it solves yours.

like image 23
Gonzalingui Avatar answered Jan 06 '23 03:01

Gonzalingui