I have a Mac OSX El Capitan operating system. Since my laptop has limited space, I am trying to set up a local server on my 1TB external hard drive with the url http://media.database/, and that uses PHP. I have set it up the best I know how, but when I go to the page, it says "Forbidden You don't have permission to access /index.php on this server."
I have set apache and host files as best I know how, but I'm still pretty new to this sort of thing. I have listed my updates to those files below and restarted the apache server using sudo apachectl restart, which has gotten me this far. Can someone enlighten me on what I might be missing. All help is greatly appreciated.
/etc/apache2/httpd.conf
<VirtualHost *:80>
ServerName media.database
DocumentRoot "file:///Volumes/DBTARA/media/"
<Directory "file:///Volumes/DBTARA/media/">
DirectoryIndex index.php index.html
AllowOverride all
Options -MultiViews
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
/etc/hosts
127.0.0.1 media.database
/etc/apache2/users/vmbmacintosh.conf
<Directory "file:///Volumes/DBTARA/media/">
AllowOverride All
Options Indexes MultiViews FollowSymLinks
Require all granted
</Directory>
/etc/apache2/httpd.conf
I attempted to add the following DocumentRoot after the one I already have, but that made my other local servers inaccessible and kept the external one as forbidden.:
DocumentRoot "file:///Volumes/DBTARA/media"
<Directory "file:///Volumes/DBTARA/media">
Options FollowSymLinks Multiviews
MultiviewsMatch Any
AllowOverride None
Require all granted
</Directory>
Thanks again in advance for any assistance.
I know this question has been asked a lot of times
I followed Most of the answers in the internet But I still get the same Message
403 Forbidden
You don't have permission to access / on this server.
It is weird that when I access using the same PC to localhost:1234 it runs normally but if I access using my IP address 192.168.0.188:1234
Also which is really weird is that I tried to install WAMP on other PC and without any configuration I could access to that PC.
So I thought it's because McAfee and Firewall so I open port on Widows and McAfee and nothing changed also I turned off Firewall and still nothing change.
Then for no reason I opened port through the Router “port forwarding” and still nothing changed.
I don't think that it's because my configuration in WAMP since I am still able to get this 403 Forbidden Message and also by using other PC without any configuration I could access it.
Both PCs are setup like this:
Windows 8 Pro
WAMP Wampserver: 2.4
Apache Version: 2.4.4
PHP Version: 5.4.12
MySQL Version: 5.6.12
The accessible PC uses Microsoft Security Essentials.
The inaccessible PC uses McAfee Internet Security.
I tried to turn off WAMP and start IIS For Microsoft Server (I works perfectly From any PC) but WAMP is still not not working
I followed these tutorial:
How to Access WAMP Server in LAN or WAN
Install & Setup Virtual Host Guide for WAMP
Install & Setup LAN & Worldwide Access Guide for WAMP
And the Stack Overflow answers here:
Cannot access wamp server on local network
WAMP 403 Forbidden message on Windows 7
If you are using WAMPServer 3 See bottom of answer
For WAMPServer versions <= 2.5
By default Wampserver comes configured as securely as it can, so Apache is set to only allow access from the machine running wamp. Afterall it is supposed to be a development server and not a live server.
Also there was a little error released with WAMPServer 2.4 where it used the old Apache 2.2 syntax instead of the new Apache 2.4 syntax for access rights.
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
Require local
Require ip 192.168.0
The Require local allows access from these ip's 127.0.0.1 & localhost & ::1.
The statement Require ip 192.168.0 will allow you to access the Apache server from any ip on your internal network. Also it will allow access using the server mechines actual ip address from the server machine, as you are trying to do.
WAMPServer 3 has a different method
In version 3 and > of WAMPServer there is a Virtual Hosts pre defined for localhost so you have to make the access privilage amendements in the Virtual Host definition config file
First dont amend the httpd.conf file at all, leave it as you found it.
Using the menus, edit the httpd-vhosts.conf file.
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.
Dont forget to restart Apache after making this change
For Apache 2.4.9
in addition, look at the httpd-vhosts.conf file in C:\wamp\bin\apache\apache2.4.9\conf\extra
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot C:/wamp/www
<Directory "C:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require local
</Directory>
</VirtualHost>
Change to:
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot C:/wamp/www
<Directory "C:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require all granted
</Directory>
</VirtualHost>
changing from "Require local" to "Require all granted" solved the error 403 in my local network
I got this answer from here. and its works for me
Require local
Change to
Require all granted
Order Deny,Allow
Allow from all
To expand on RiggsFolly’s answer—or for anyone who is facing the same issue but is using Apache 2.2 or below—this format should work well:
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 ::1
Allow from localhost
Allow from 192.168
Allow from 10
Satisfy Any
For more details on the format changes for Apache 2.4, the official Upgrading to 2.2 from 2.4 page is pretty clear & concise. Key point being:
The old access control idioms should be replaced by the new
authentication mechanisms, although for compatibility with old
configurations, the new module mod_access_compat is provided.
Which means, system admins around the world don’t necessarily have to panic about changing Apache 2.2 configs to be 2.4 compliant just yet.
For those who may be running WAMP 3.1.4 with Apache 2.4.35 on Windows 10 (64-bit)
If you're having issues with external devices connecting to your localhost, and receiving a 403 Forbidden error, it may be an issue with your httpd.conf and the httpd-vhosts.conf files and the "Require local" line they both have within them.
[Before] httpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local <--- This is the offending line.
</Directory>
</VirtualHost>
[After] httpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
</Directory>
</VirtualHost>
Additionally, you'll need to update your httpd.conf file as follows:
[Before] httpd.conf
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
# onlineoffline tag - don't remove
Require local #<--- This is the offending line.
</Directory>
[After] httpd.conf
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
# onlineoffline tag - don't remove
# Require local
</Directory>
Make sure to restart your WAMP server via (System tray at bottom-right of screen --> left-click WAMP icon --> "Restart all Services").
Then refresh your machine's browser on localhost to ensure you've still got proper connectivity there, and then refresh your other external devices that you were previously attempting to connect.
Disclaimer: If you're in a corporate setting, this is untested from a security perspective; please ensure you're keenly aware of your local development environment's access protocols before implementing any sweeping changes.
looking for solutions for a small challenge
i have my local network (router)
i have debian server on first machine where i have installed a symfony in /var/www/my-symf-app
i changed /etc/site-available
and
/etc/hosts
for my new web site
when i'm trying to reach in a web browser my-symf-app from my debian machine
--> and it works fine
but when I'm using targeting my server from another PC with my ip http://192.168.0.47/coach.dev
i have a situation
and i receive a 404 not found
but when I'm targeting my debian server just with http://192.168.0.47
it works fine, it shows me a index.htm Works find
i have commented code in config.php
for if server something throw error forbidden
could you pls explain me what I'm doing wrong and how can i fix it?
my /etc//sites-available/coach
<VirtualHost *:80>
ServerAdmin webmaster#localhost
ServerName coach.dev
ServerAlias www.coach.dev
DocumentRoot /var/www/coach/web
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/coach/web>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
my /etc/hosts
127.0.0.1 coach.dev
Add on the 2nd computer ip and domainname to hosts.
I mean add ip adress of the server and his domain to host on second computer it should work.
Before I start.. Good day to all! :)
I have problem with my WAMP virtual host.. the other computer on our LAN keeps receiving error forbidden-you-dont-have-permission-to-access-on-this-server..
Below is the current settings I have:
/httpd.conf
#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
Options FollowSymLinks Includes
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "c:/wamp/www"
<Directory "c:/wamp/www">
Options Indexes FollowSymLinks
AllowOverride All
Order Deny,Allow
Allow from all
Allow from 127.0.0.1
Allow from ::1
Allow from localhost
</Directory>
/phpmyadmin.conf
Alias /phpmyadmin "c:/wamp/apps/phpmyadmin4.0.4/"
# to give access to phpmyadmin from outside
# replace the lines
#
# Order Deny,Allow
# Deny from all
# Allow from 127.0.0.1
#
# by
#
# Order Allow,Deny
# Allow from all
#
<Directory "c:/wamp/apps/phpmyadmin4.0.4/">
Options Indexes FollowSymLinks ExecCGI
AllowOverride all
Order Deny,Allow
Allow from all
Allow from 127.0.0.1
Allow from ::1
Allow from localhost
</Directory>
/httpd.vhosts.conf
Listen 127.0.0.1:80
<VirtualHost 127.0.0.1:80>
ServerName www.ecommerce.local
ServerAlias ecommerce.local
DocumentRoot C:/wamp/www/ecommerce
ErrorLog "C:/wamp/www/ecommerce/logs/error.log"
CustomLog "C:/wamp/www/ecommerce/logs/access.log" common
<Directory />
Require all granted
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost 127.0.0.1:80>
ServerName localhost
DocumentRoot C:/wamp/www/
</VirtualHost>
Also...
tried to ping from other computer response is success
tried to turn off firewall for both computer
tried to add everyone in www's folder properties
I have tried other solutions I found but still to no avail.. I can access "http://ecommerce.local" but the other computer on our LAN recieves forbidden-you-dont-have-permission-to-access-on-this-server error..
does it have something to do with our network settings? the other computer is also in the same settings... my ip: 192.168.1.198 and the other computer is 192.168.1.192
Access to Apache has nothing to do with windows access rights on a Windows system. Its all to do with what you tell Apache to allow in.
Also you are using a mixture of Apache 2.2 and Apache 2.4 syntax in most of your access declarations.
Apache 2.2
Allow .....
Apache 2.4
Require .....
Require local - means 127.0.0.1 and localhost and ::1
Require ip - specifies a single ip (192.168.0.10) or a range of ip's (192.168.0)
Apache does not seem to complain yet, but its probably best to stick to the Apache 2.4 syntax.
This first change you made is very dangerous and should be changed to this unless you really wanted to give unlimited access to the servers C:\ drive to anyone that hacks your Apache server.
#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
Options FollowSymLinks Includes
AllowOverride All
Require all denied
</Directory>
Again here use Apache 2.4 syntax and be specific about who you want to allow in.
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "c:/wamp/www"
<Directory "c:/wamp/www">
Options Indexes FollowSymLinks
AllowOverride All
Require local
Require ip 192.168.0
</Directory>
Now to your Virtual Host definitions
You dont need this Listen 127.0.0.1:80
Put the localhost definition first so it becomes the default domain, so if a random or misspelt domain name is used this will load. If that comes from an internet ip then they will get an error as only ip's from within you network are allowed access. This isreally for later when you decide to open up your site to a wider audience.
Also dont specify 127.0.0.1 on the line, you want it to be listen any incoming ip not just this machine.
<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/wamp/www"
<Directory "c:/wamp/www">
Options Indexes FollowSymLinks
AllowOverride All
Require local
## May not want to let people access the wamp page so leave this off if not.
Require ip 192.168.0
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName www.ecommerce.local
ServerAlias ecommerce.local
DocumentRoot "C:/wamp/www/ecommerce"
## not a good idea to have logs visible under the DocumentRoot folder
## should really go in C:\wamp\logs
## But I assume you want developers to have easy access during development
## ErrorLog "C:/wamp/logs/ecommerce_error.log"
## CustomLog "C:/wamp/logs/ecommerce_access.log" common
ErrorLog "C:/wamp/www/ecommerce/logs/error.log"
CustomLog "C:/wamp/www/ecommerce/logs/access.log" common
<Directory />
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require local
Require ip 192.168.0
</Directory>
</VirtualHost>
Now you may want to allow your local developers access to phpMyAdmin. If so you will need to change your C:\wamp\alias\phpmyadmin.conf file as well.
<Directory "c:/wamp/apps/phpmyadmin4.0.4/">
Options Indexes FollowSymLinks ExecCGI
AllowOverride all
Require local
Require ip 192.168.0
</Directory>
Or you could be more specific here and only allow certain ip's to use phpMyAdmin by using something like this
Require ip 192.168.0.10 192.168.0.11 192.168.0.12
Just as a side note. I personally like to move my VistualHosts sites completely out of the C:\wamp\ folder structure. So I would have placed my ecommerce folder somewhere like C:\websites\ecommerce\www\. This keeps any confusion about access rights to a complete minimum and also if I need to upgrade WAMP, my website code is never in any danger when I make a silly typo.
ADDITIONAL INFO:
Now to be able to access your new site as ecommerce.local or www.ecommerce.local you will have to make a chnage to your HOSTS file.
C:\windows\system32\drivers\etc\hosts
On the PC running WAMP add this line:
127.0.0.1 ecommerce.local
On the other PC's do this
192.168.0.10 ecommerce.local
Where 192.168.0.10 is the ip address of the PC running WAMP
Then reboot the PC's or do these 2 commands from a command window started as Administrator
net stop "DNS Client"
net start "DNS Client"
I have already solved my own issue... I have not shared my folder for anyone to view... so what I did is:
Right Click the project folder
On folder options go to sharing tab
Click on advance sharing
advance sharing option will open then tick share this folder
click permissions
permissions option will open then choose whom you would like to share your folder
I chose everyone then below tick full control (*for trial purposes only; recommended tick only Read)
then click ok for all the opened options
Hi Friends previously I am using XAMP Server but when I install joomla Templates it creates alots of error. Now I installed the WAMP, but the issues are:
1. I can access with 127.0.0.1, but I cant access with "localhost".
2 When i access phpmyadmin i get this error.
Forbidden You don't have permission to access /phpmyadmin/ on this server.
Alias /phpmyadmin "c:/wamp/apps/phpmyadmin3.4.5/"
# to give access to phpmyadmin from outside
# replace the lines
#
# Order Deny,Allow
# Deny from all
# Allow from 127.0.0.1
#
# by
#
# Order Allow,Deny
# Allow from all
#
After changing, it will look like this
<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
</Directory>
After this just restart Wamp
Go to C:\wamp\alias. Open the file phpmyadmin.conf and change
<Directory "c:/wamp/apps/phpmyadmin3.5.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
to
<Directory "c:/wamp/apps/phpmyadmin3.5.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
problem solved
Change httpd.conf file as follows:
from
<Directory />
AllowOverride none
Require all denied
</Directory>
to
<Directory />
AllowOverride none
Require all granted
</Directory>
So none of the above stuff worked for me. Except this:
edit httpd.conf,
find the line
Listen 80
and change to
listen 0.0.0.0:80
if you are running windows 8, its got something to do with using ipv6 instead of ipv4
Go to C:\wamp\alias.
Open the file phpmyadmin.conf and add
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from MACHINE_IP
Change in following file \bin\apache\apache2.2.22\conf\httpd.conf
Replace Listen 80 with Listen 0.0.0.0:80
Replace
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
with
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
Replace
onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
with
onlineoffline tag - don't remove
Order Deny,Allow
Allow from all
Allow from 127.0.0.1
in \wamp\alias\phpmyadmin.conf
replace
<Directory "c:/wamp/apps/phpmyadmin3.4.10.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
with
<Directory "c:/wamp/apps/phpmyadmin3.4.10.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
</Directory>
Tested on windows localhost.
Note : Please consider RigsFolly's comment also.
For WampServer 2.2 with Apache 2.4.2 I ended up with:
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require local
To solve this, I opened httpd.conf and changed the following line:
Allow from 127.0.0.1
to:
Allow from 127.0.0.1 ::1
I faced this problem
Forbidden You don't have permission to access /phpmyadmin/ on this server
Some help about this:
First check you installed a fresh wamp or replace the existing one. If it's fresh there is no problem, For done existing installation.
Follow these steps.
Open your wamp\bin\mysql directory
Check if in this folder there is another folder of mysql with different name, if exists delete it.
enter to remain mysql folder and delete files with duplication.
start your wamp server again. Wamp will be working.
just add following line in wamp/alias/phpmyadmin.conf
Allow from ::1
so it will look something like this depending your phpmyadmin version.
<Directory "c:/wamp/apps/phpmyadmin3.5.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
</Directory>
If its possible uninstall wamp then run installation as administrator then change you mysql.conf file like that
<Directory "c:/wamp/apps/phpmyadmin3.5.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Allow,Deny
Allow from all
Allow from all
</Directory>
Not: Before I reinstall as admin the solution above didn't work for me
Change the file content of c:\wamp\alias\phpmyadmin.conf to the following.
<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
</Directory>
Here my WAMP installation is in the c:\wamp folder. Change it according to your installation.
Previously, it was like this:
<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
Restart your Apache server after making these changes.
In your apache config file (../bin/apachex.y.z/cong/httpd.conf)
Just change
< Directory "c:/wamp/www/" >
...
...
"Require local" ===> "Require all granted"
< /Directory >
This allows other pc's to access (to read) your web folder.
I had done below changes for new phpmyadmin4.0.4 in httpd.conf file
<Directory />
AllowOverride none
Require all granted
</Directory>
and phpmyadmin.conf
<Directory "c:/wamp/apps/phpmyadmin4.0.4/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
and restart my server.
None of the above answers worked for me, or where unsafe (as some pointed out, using Allow from all can make your files and data accessible to the outside world).
Open the c:\wamp\alias\phpmyadmin.conf file and change
Allow from 127.0.0.1
to
Allow from 127.0.0.1 ::1
Explanation:
On most computer systems, localhost resolves to the IP address 127.0.0.1, which is the most commonly used IPv4 loopback address, and to the IPv6 loopback address ::1 (source: https://en.wikipedia.org/wiki/Localhost)
The resolution of the name localhost into one or more IP addresses is configured by the following lines in the operating system's hosts file:
127.0.0.1 localhost
::1 localhost
to see your hosts file, go to c:\Windows\System32\drivers\etc\HOSTS
notice the above lines are commented out with the note: # localhost name resolution is handled within DNS itself.
On my machine, on Win7, I also noticed the following:
localhost\phpmyadmin did not work on Chrome, but worked on IE11
127.0.0.1\phpmyadmin worked on Chrome
comment Require local from httpd.conf
"#Require local"