I have followed this tutorial to configure http apache server:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/chap-Managing_Confined_Services-The_Apache_HTTP_Server.html
When I connected using
telnet localhost 12345
GET / HTTP/1.0
I got an error
HTTP/1.1 403 Forbidden
and the default html of apache was listed below too.
I tried to configure the
/etc/httpd/conf/httpd.conf
adding
<Directory "/var/www/html">
Order allow,deny
Allow from all
Require all granted
</Directory>
and also ran
chmod -R o+x /var/www/html
and I'm still getting the same error. How do I proceed?
Do you have a file called index.html inside /var/www/html/ directory?
I would also suggest to check access and error logs files under /var/log/httpd directory
Related
I'm new to apache.
I'm trying to create an alias to my project folder which is in home/Documents/Projects/blog directory.
I added this to httpd configs:
Alias /blog "/home/ehsan/Documents/Projects/blog/ui/dist"
<Directory "/home/ehsan/Documents/Projects/blog/ui/dist">
DirectoryIndex index.html
AllowOverride All
Options FollowSymlinks
Require all granted
</Directory>
I did this also:
sudo chmod -R 775 /home/ehsan/Documents/Projects/leitner/ui/dist
but I get "403 Access forbidden!" error.
I did the same thing for phpmyadmin and it works.
I read somewhere that apache should have access to all the higher level directories. is that true?
apache version: 2.4.41 (Unix)
os: manjaro 18
I think you can make apache the owner of the folder which it's gonna make changes in it.
Try this:
head to your project directory as below
cd /home/ehsan/Documents/Projects/leitner
and then :
chown -R www-data:www-data ui/
if there was any error going on, send the log of apache here would be helpful
Hi I'm getting 403 error while im accessing my live site through the browser. It was working fine last day. I'm not sure why this error is coming. I have searched a lot about it. These are the solutions I have tried:
I have changed my httpd.conf file's configurations from default to :
<Directory />
#Options FollowSymLinks
Options Indexes FollowSymLinks Includes
AllowOverride All
Order deny,allow
Allow from all
</Directory>
Changed the permission for /var/www/html directory from default to 777
and few more things. But nothing worked. I am not sure what is going wrong.
My server configurations are:
Apache/2.2.29.
AWS EC2 Instance.
This is the Error message shown on browser:
forbidden
You don't have permission to access / on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
This is the Error message from error_logs:
[Thu May 21 14:58:51 2015] [error] [client XXX.XXX.XXX.XXX] Directory index forbidden by Options directive: /var/www/
[Thu May 21 14:58:51 2015] [error] [client XXX.XXX.XXX.XXX] File does not exist: /var/www/error/noindex.html
please let me know in comments if you need anything else. Thanks in advance :)
I was trying to set up vhost for Apache/2.2.29. AWS EC2 Instance.
meet same error .
I solve it by looking the error.log
I need to give 755 to the parent folder
in your error log " File does not exist: /var/www/error/noindex.html"
means you need to have this folder and the file.
what I use is chmod 755 -R /var/www/
You can try following steps:
In httpd.conf file Options -Indexes +FollowSymLinks +MultiViews +Includes
Run on terminal: chown -R apache:apache /var/www/html
Restart Apache
SE Linux sets security context label to every file. If there is an error setting the security context label the system throws forbidden error.
Using "restorecon -v R" along with path name of the file's directory can clear the forbidden error.
The "restorecon" command restores the default security context to the file.
I have installed XAMPP in TahrPup. I need this for a class, but being the only one who runs Linux I can't get help from others in class or the instructor.
I'm getting a 403 Forbidden error accessing 127.0.0.1/phpmyadmin/ and localhost/phpmyadmin, or even just trying to access 127.0.0.1 and localhost.
Version: XAMPP for Linux 5.6.3-0
I did check that Apache and MySQL and stuff is started (running xampp start).
I have tried based on other answers editing httpd-xampp.conf under <LocationMatch ... to say
Order deny,allow
Deny from all
Allow from ::1 127.0.0.0/8
Allow from all
And in httpd.conf it says
<Directory "/opt/lampp/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
... this was already the configuration, and most answers said to change it -to- this, which it already was.
I can post config files if needed. I'm just to the point of not knowing where to start anymore.
As stated here:
Why can't I access Xampp's phpmyadmin on localhost? Access is forbidden.
The lines
Order allow,deny
Allow from all
needed to be removed. Okay.
I am running a CentOS 6 server (on Digital Ocean) which has apache 2.2 installed.
I installed ProFTP and have set up a user called 'rator' with whom I can ftp in to the home directory at /home/rator/
I want this directory to be a working web development environment and have set up a further two sub dirs - dev and stage.
In the dev folder I have cloned my git repo and have ended up with the rather long path:
/home/rator/dev/rator/
I want to set up a vhost to this directory. I have set up my hosts file for rator.dev on my local machine, and have the following in the vhosts section of /etc/httpd/conf/httpd.conf
<VirtualHost *:80>
ServerAdmin me#email.com
DocumentRoot /home/rator/dev/rator
ServerName rator.dev
ErrorLog rator.dev-error_log
CustomLog logs/rator.dev-access_log common
<Directory /home/rator/dev/rator>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
When I try to view this in the browser - I get a 403 error. "You don't have permission to access / on this server."
If I chown apache:apache all of the dirs and files below /home/ then the site becomes visible however, I then cannot log in through ftp as the ftp home dir is then owned by apache and I'm logging in as 'rator'.
I have tried many variants on the Vhosts directory permissions but so far have not been able to solve the access problem.
Does anybody know what the correct vhosts should be here?
Ok, turned out to be pretty dumb....
sudo chmod o+rx /home/rator
Execute and read permissions were not set correctly on the home folder....
I have apache running on port 80. I have also created an additional conf file in conf.d that would open up a second port 8010 with a different directory but I am unable to get to subdirectories now of the document root of 8010
Listen 8010
<VirtualHost ip:8010>
DocumentRoot /var/www/boom
ServerName localhost
ErrorLog logs/dm-error_log
CustomLog logs/dm-access_log common
<Directory /var/www/boom>
AuthName "Protected Area"
AuthType Basic
AuthUserFile /var/www/secure/passwords
Require valid-user
</Directory>
</VirtualHost>
If I try to go to ip:8010/banq I get the following error
Forbidden You don't have permission to access /banq/ on this server.
I tried chmod 777 on banq with no luck
I had this all working great for few years and then lost all backups, had to recreate from scratch. I was able to move conf file from 1 server to another without setting any any chown and minor chmod commands. Is it possible to open all subdirectories of /var/www/boom to anyone who authenticates properly?
Two things I have encountered that could cause a similar error would be:
Apache can't access the document root of where the banq/ directory is found. Have you checked permissions on /var/www/boom? Setting the group to apache or nobody, or making the directory world readable would be a good test.
If there is no directory index in banq/ Apache may prevent you from viewing a directory listing. Try adding either an index.html page to the directory for testing, or add "Options +Indexes" to the config file.