You don't have permission to access/site on this server.
Posted by: atty179 (---.rpr-spa.it)
Date: May 05, 2014 04:59PM

Hy,
I have installed WAMPServer 2.2

Version of Operating system? ===> Win7 Pro Services Pack1
Version of Wamp Server installed? ===> WampServer 2.2
Version of Apache you are running? ===> apache2.4.2
Version of MySQL you are running? ===> mysql5.5.24
Version of PHP you are running? ===> php5.4.3

What colour is your WampManager icon? ( the in the system tray )
It could be Green, Orange or Red ===> Green

Do you have a HOSTS file? [c:\windows\system32\drivers\etc\hosts] ===> Yes. 127.0.0.1

I have developed a simple application in php.

When I try the application on my client, it works, but when I try from another client gives me this error:

"Forbidden
You don't have permission to access/site on this server."

Can you help me ?

Thanks.

Atty

Options: ReplyQuote
Re: You don't have permission to access/site on this server.
Posted by: RiggsFolly (---.as13285.net)
Date: May 05, 2014 05:14PM

Hi Atty

I assume you mean you can run your site from the PC that has WAMPServer on it but not from another PC on your local network, right?


WampServer is by default configured to be as secure as possible, so Apache is configured so that it will only respond to connections made from the PC that it is running on. ( Not hackable )

If you want to access your site and therefore Apache from another PC you need to make a few chnages to the httpd.conf file. to tel APache that his is allowed.

I assume you have put your site in a subfolder of \wamp\www like \wamp\www\project1

So edit httpd.conf ... use the wampmanager icon menus so that you edit the right file.

Find this section within that file

    #
    # Controls who can get stuff from this server.
    #
#   onlineoffline tag - don't remove
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1 ::1 localhost

And chnage it to

    #
    # Controls who can get stuff from this server.
    #
#   onlineoffline tag - don't remove
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1 ::1 localhost
    Allow from 192.168


The new line 'Allow from 192.168' will tell Apache it is ok to accept connections from any PC on your internal network ( i.e. Inside your router )

---------------------------------------------------------------------------------------------
(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 05/05/2014 05:14PM by RiggsFolly.

Options: ReplyQuote
Re: You don't have permission to access/site on this server.
Posted by: atty179 (---.rpr-spa.it)
Date: May 05, 2014 05:30PM

Riggs, you're too strong.
But you are always online?

I changed the file as you have shown me but still does not work.
The corporate network starts with 10.1.xxx.xxx
I have to change "Allow from 192.168" with "Allow from 10.1"?

thanks
atty

Options: ReplyQuote
Re: You don't have permission to access/site on this server.
Posted by: RiggsFolly (---.as13285.net)
Date: May 05, 2014 05:38PM

Addy

Thats right the change you suggest should work in your situation.

You can also be more specific of you want to be, so you could limit access to 'Allow from 10.1.10' for example if you only want to allow access from that part of your corporate network.

Good luck

---------------------------------------------------------------------------------------------
(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: You don't have permission to access/site on this server.
Posted by: atty179 (---.rpr-spa.it)
Date: May 06, 2014 09:36AM

God morning Riggs,

I changed the httpd.conf file as follows:

"# onlineoffline tag - don't remove

     Order Deny, Allow
     Deny from all
     Allow from 127.0.0.1 :: 1 localhost
     Allow from 10.1.0
"
but now it does not work even from my PC.

Riggs, but what are the commands

"Order Deny, Allow
     Deny from all "??

thanks
atty

Options: ReplyQuote
Re: You don't have permission to access/site on this server.
Posted by: RiggsFolly (---.as13285.net)
Date: May 06, 2014 10:18AM

Order Deny,Allow

This says first process my Deny statement, then process my allow statement.

Deny from all

First deny everything and everybody

Allow from 127.0.0.1 :: 1 localhost
Allow from 10.1.0

Now allow from these specific ip address's and ranges.



When you say it does not work even from you PC, what url are you putting into the browser address?

---------------------------------------------------------------------------------------------
(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: You don't have permission to access/site on this server.
Posted by: atty179 (---.rpr-spa.it)
Date: May 06, 2014 11:38AM

Riggs,

when I try from my PC, I put "localhost/project1" (project1 is the name of the directory c:\wamp\www\project1).

When I try from another PC, I put the my Ip address IPv4 (10.1.0.109/project1).

Now I have restored the original httpd.conf file with these instructions:

" # onlineoffline tag - don't remove

Require local
"
and now it works from my PC with localhost/project1.


If I change the file httpd.conf whit this instructions:

"# onlineoffline tag - don't remove

Order Deny, Allow
Deny from all
Allow from 127.0.0.1 :: 1 localhost
Allow from 10.1.0
"
it does not works.

I don't understand.

Thanks.
atty

Options: ReplyQuote
Re: You don't have permission to access/site on this server.
Posted by: RiggsFolly (---.as13285.net)
Date: May 06, 2014 12:11PM

Ah,

You said you were using WAMPServer 2.2 I missed the Apache 2.4.2, my mistake.


Ok in Apache 2.4 the security syntax changed, the 2.2 syntax should still work if you have

LoadModule access_compat_module modules/mod_access_compat.so

in httpd.conf


But anyway, using Apache 2.4 syntax this

Require local
Require ip 10.1

---------------------------------------------------------------------------------------------
(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: You don't have permission to access/site on this server.
Posted by: atty179 (---.rpr-spa.it)
Date: May 06, 2014 12:25PM

OK.
Now it works.

Thanks Riggs.

Atty

Options: ReplyQuote


Sorry, only registered users may post in this forum.