Forbidden You don't have permission to access /files/ on this server.
Posted by: BarleySinger (122.129.140.---)
Date: August 05, 2015 09:23AM

I've used and setup WAMP before but not an expert. I downloaded WAMPSERVER 2.5, set everything up as it had been on previous versions (with the same directories for my files) and copied in my old (working) versions of configuration for my aliases (all my old files). Normally this works easily, but I have not setup WAMP on WIN7PRO 64 bit before.

I can browse to all of the INCLUDED aliases that COME WITH the new version (phpmyadmin,phpsysinfo, etc)

I can see MY aliases listed when I browse to localhost (and that's good) HOWEVER... I can't browse to any of MY aliases.

I always get a message like this one:

Forbidden

You don't have permission to access /html/ on this server.
Apache/2.4.9 (Win64) PHP/5.5.12 Server at localhost Port 80

As I said, browsing to included aliases like phpmyadmin works fine.

IS there some oddball permissions thing I need to be aware of in WIN7? I am currently (and I know that I should not do this) running under the default login you get when you setup the OS (just in case that makes any difference).

httpd.conf contains this :
------------------------------------
<Directory />
Options FollowSymLinks
AllowOverride None
AllowOverride none
Require all denied
Order deny,allow
Deny from all
Allow from all
</Directory>
------------------------------------

this is the alias file "C:\wamp\alias\comics.conf"

------------------------------------
Alias /comics/ "c:/Files/Graphics/comics/"

<Directory "c:/Files/Graphics/comics/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>
------------------------------------



Edited 1 time(s). Last edit at 08/05/2015 09:47AM by BarleySinger.

Options: ReplyQuote
Re: Forbidden You don't have permission to access /files/ on this server.
Posted by: RiggsFolly (---.as43234.net)
Date: August 05, 2015 10:40AM

Hello Barley,

Well the most likely, I think, is that in Apache 2.4 the syntax for allowing access to a project(alias) changed.
Also you have a bit of a glaring HOLE in your security, so lets cover that first.
Apache 2.2 was `Allow,Deny` etc Apache 2.4 is no `Require ...`

This section is supposed to protect the root and all sub directories of the drive that Apache is configured on. The idea should be, you deny access to everything and then in alias's you allow what is required.
This section is supposed to be the deny access to everything part. So change it to

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied
</Directory>

Now the alias's. So within each alias you then allow access to whatever level this site requires and to whatever directories it requires.
<Directory "c:/Files/Graphics/comics/">
     Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    # allow from this machine
    Require local

    #allow from my local network subnet
    Require ip 192.168.1

    # uncomment next line ONLY if you really want to allow access from any ip in the universe
    #Require all granted

</Directory>

If you look at the Alias for phpMyAdmin in "C:\wamp\alias\phpMyAdmin.conf" you will also see that you can tailor the PHP requirements within the definition for an alias to be specific to that ALias rather than amending the 'php.ini' file.


If this does not do the trick, let me know the results and we can have another try.



NOTE: Can I suggest that you take a look at this document and consider converting your Aliased sites to Virtual Host'ed site. [forum.wampserver.com]

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 1 time(s). Last edit at 08/05/2015 10:41AM by RiggsFolly.

Options: ReplyQuote
Re: Forbidden You don't have permission to access /files/ on this server.
Posted by: BarleySinger (122.129.140.---)
Date: August 06, 2015 08:31AM

First and most importantly - THANK YOU

I went ahead and made the changes you recommended and restarted everything.
There is no difference at all.
I still have proper access to included applications like "phpmyadmin", so THOSE aliases work fine


this is the alias file "C:\wamp\alias\comics.conf"

------------------------------------

Alias /comics/ "c:/Files/graphics/comics/"
<Directory "c:/Files/Graphics/comics/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
# allow from this machine
Require local

#allow from my local network subnet
Require ip 192.168.1

# uncomment next line ONLY if you really want to allow access from any ip in the universe
#Require all granted

</Directory>
------------------------------------

here is the directories portion of "C:\wamp\bin\apache\apache2.4.9\conf\http.conf

(do you need more of this file?)

------------------------------------
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
------------------------------------

Do you need a look at any of my htaccess files?

Once again, thanks for your willingness to help

Options: ReplyQuote
Re: Forbidden You don't have permission to access /files/ on this server.
Posted by: RiggsFolly (---.as43234.net)
Date: August 06, 2015 12:54PM

This may seem trivial but try removing the trailing slash on the Alias line after the Alias name


From
Alias /comics/ "c:/Files/graphics/comics/"
To
Alias /comics "c:/Files/graphics/comics/"

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Forbidden You don't have permission to access /files/ on this server.
Posted by: BarleySinger (122.129.140.---)
Date: August 07, 2015 03:15PM

I got rid of the trailing slash and it went to the page (got an error there, but it went).


Fatal error: Call to undefined function session_register() in C:\Files\graphics\comics\index.php on line 3


Which is there because it is now deprecated (time to change the code)

Options: ReplyQuote
Re: Forbidden You don't have permission to access /files/ on this server.
Posted by: RiggsFolly (---.as43234.net)
Date: August 07, 2015 04:24PM

Oh yea.

They are out there. And most of them a writing bad PHP code apparently!

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Forbidden You don't have permission to access /files/ on this server.
Posted by: Otomatic (Moderator)
Date: August 07, 2015 04:55PM

Hi,

session_register() This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Forbidden You don't have permission to access /files/ on this server.
Posted by: BarleySinger (122.129.140.---)
Date: October 31, 2015 08:28AM

so using session_register() is no more.
I will have to look up what method has replaced it.

Incidentally as a LONG TERM senior IT guy (now disabled) it is considered very bad form (in any language) to completely remove old functions, instead of putting up a "wrapper" to the new method - one with the old name - so you have something that works (mostly) but ALSO throws an exception on the resulting screen, to warn the person what has changed, and what to do about it.

This has been common since the 80s. Not doing so (no wrapper to the new functionality) is just...so sad...I feel like I'm dealing with an IBM360 in COBOL (all over again).

...shame on them...

Options: ReplyQuote


Sorry, only registered users may post in this forum.