- Apache Permissions
- 2 Answers 2
- Forbidden, you don’t have permission to access this resource
- 1 Answer 1
- WAMP 403 Forbidden message on Windows 7
- 26 Answers 26
- Apache Permissions
- 2 Answers 2
- Unable to run Apache under Windows: An attempt was made to access a socket in a way forbidden by its access permissions
- 4 Answers 4
Apache Permissions
I am having some trouble setting the permissions on an Apache Server (Ubuntu Server 12.04 LTS). I moved the directory to my home directory. I was able to give apache permissions to that directory. But, it didn’t apply to the sub directories.
Is there a way to apply permissions to all the subfolders?
I am fairly new to Ubuntu Server and would appreciate the help.
2 Answers 2
chown -R www-data:www-data /home/
Also you can try what @mjgpy3 suggested
I think what you want is:
This will recursively change permissions from a to every sub directory and file. Be very careful setting the though. is an a number between 000 and 777 specifying mode and is the parent of all files/folders that you want to change the permission of.
UPDATE
To specify you will, as I said above need to provide a 3 digit number, each of which is 0-7 inclusively. Each of these numbers specifies a different group (if you will). The first means current user, the second means a user’s group and the third means the rest of the world. Now, the actual numbers themselves specify which privilege their respective group will be granted; this is done in binary. RWE (read, write and execute) are the available permissions on a file.
So, consider the number 5.
5 in binary is 101, this means that 5 specifies R-E, which means read, not execute and write. As you can see a 1 indicates that a privilege is enabled, whereas a 0 means disabled.
So, here are some common uses and what they mean:
file.txt is now readable, writeable and executable by everyone who may ever come across the file.
A more used example is:
This says that (since 7 is 111 in binary) the owner of the file (that’s probably you) can do anything they want with it, I.E RWE, I.E. read, write and execute. Where those who are not the user may only read and execute it.
Here’s an external source if my explanation did not make sense to you.
Forbidden, you don’t have permission to access this resource
I am trying to create a site called sitb in ubuntu using apach2. I create a html file and saved it in a created siteb folder in var/www but when I load the site it just says Forbidden, you don’t have permission to access this resource. I am not sure why I am getting this because I set the permissions to 755 for siteb
Here is my /etc/apache2/apache2.conf file
1 Answer 1
Your not looking in the right place, although the /etc/apache2/apache2.conf file you pasted is giving you some big clues.
You also didn’t give any information on what the host name is, or where you put the «html file».
Ubuntu uses the debian way of configuring apache2, so the config files for your «virtual-hosts» will be in /etc/apache2/sites-available/
Take a look inside that directory and you should se a file called something like 000-default.conf. Take a look at it.
You can either edit that default file or create a new one for your domain. Assuming you want to create a new virtual host configuration for the domain example.com, you would need to do the following steps. swap out example.com for the name of you domain.
Now you have a config file called /etc/apache2/sites-available/example.com.conf, a web root at /var/www/example.com/public_html and an index.html file in the web root.
Next you need to modify the config file for your domain name (remember swap example.com for your domain name:
The file should end up looking like this:
Once you have made the changes to the config file, you need to enable the virtual host. This involves creating a symlink to your config file in /etc/apache2/sites-enabled/. Apache2 has a helper to do this:
You can also disable the 000-default config if you want:
Now the preparation is finished, you need to restart apache for the changes to take effect:
WAMP 403 Forbidden message on Windows 7
I have installed WAMP version 2.1 on my windows 7 machine. When i browse to localhost in my browser, the WAMP server page is visible.
But when I browse to my IP in my browser, I get the message
403 Forbidden: You don’t have permission to access / on this server.
26 Answers 26
The access to your Apache server is forbidden from addresses other than 127.0.0.1 in httpd.conf (Apache’s config file) :
The same goes for your PHPMyAdmin access, the config file is phpmyadmin.conf :
You can set them to allow connections from all IP addresses like follows :
I found a simpler fix.
Although the icon was green WAMP still needs to be «Put Online» (last item of menu when left-clicking icon).
After that I had access as normal.
For me the inclusion of «Require local» helped to solve Error 403. The alias config file looks like this:
The solution for changing the permissions in the httpd.conf will work if you are OK with providing access to the WAMP server from outside.
If you do not want to do that then all you have to do is tell windows that the «localhost» domain points to 127.0.0.1. You can do that by editing the hosts file in your system directory.
The file is placed at : C:\Windows\System32\drivers\etc\hosts
by default windows 7 ships with :
You have to un-comment the mapping for localhost:
Note: you will not be able to edit the hosts file as its a read-only file. To edit, you have to be the administrator, copy the file to some other location, edit it and then copy it back to the etc directory.
Apache Permissions
I am having some trouble setting the permissions on an Apache Server (Ubuntu Server 12.04 LTS). I moved the directory to my home directory. I was able to give apache permissions to that directory. But, it didn’t apply to the sub directories.
Is there a way to apply permissions to all the subfolders?
I am fairly new to Ubuntu Server and would appreciate the help.
2 Answers 2
chown -R www-data:www-data /home/
Also you can try what @mjgpy3 suggested
I think what you want is:
This will recursively change permissions from a to every sub directory and file. Be very careful setting the though. is an a number between 000 and 777 specifying mode and is the parent of all files/folders that you want to change the permission of.
UPDATE
To specify you will, as I said above need to provide a 3 digit number, each of which is 0-7 inclusively. Each of these numbers specifies a different group (if you will). The first means current user, the second means a user’s group and the third means the rest of the world. Now, the actual numbers themselves specify which privilege their respective group will be granted; this is done in binary. RWE (read, write and execute) are the available permissions on a file.
So, consider the number 5.
5 in binary is 101, this means that 5 specifies R-E, which means read, not execute and write. As you can see a 1 indicates that a privilege is enabled, whereas a 0 means disabled.
So, here are some common uses and what they mean:
file.txt is now readable, writeable and executable by everyone who may ever come across the file.
A more used example is:
This says that (since 7 is 111 in binary) the owner of the file (that’s probably you) can do anything they want with it, I.E RWE, I.E. read, write and execute. Where those who are not the user may only read and execute it.
Here’s an external source if my explanation did not make sense to you.
Unable to run Apache under Windows: An attempt was made to access a socket in a way forbidden by its access permissions
When I am trying to run apache on windows, I receive a following error:
Port 80 is occupied by PID 4
Pid 4 is System .
4 Answers 4
I am not sure who is still struggling with the issue. But for me stopping the iis server helped. Windows server will always give a priority on the port 80 to IIS. Stopping the server helped
It means HTTP port 80 is already in use, same thing can happen for HTTPS 443 also
you can check which program is using this port with some tools like Essentials NetTools
I had had days of following examples and suggestions by other IT Professionals on the internet and most of the suggestions did not work for me and I am guessing that most of you are having the same issue and almost giving up! Well don’t:
This is why: I am using Windows Server 2012 R2, and my xampp server was running nicely until three days a go! I checked everything and did not understand why it would not start! Finally I got it to work by Removing/stopping the site on IIS Bindings.
- Change the Port from 80 to 8080/8081/81 witch ever is good for you.
- Press Win Key + R and run the following command in the dialog box «Inetmgr», this will open up the IIS Manager, Navigate to the Default Website, Click on it, on the right side you will see a column, look for the option Bidings.
- Click on the Binding option and see if the port you’re specifying for the Xampp server is not used? If yes, choose a different port number and make sure this port is not by any chance assigned to IIS.