Apache 404 Not Found error after Ubuntu update - apache

I have had installed separadly since more than one year Apache, Php and MySQL on my Ubuntu 12.04 (LTS). Everything worked perfectly until a couple of days ago my OS did an update and then I get that 404 Not Found error every time that I try to access one of my proyects from my /var/www directory or even the PhpMyAdmin.
I've tried a lot of things to fix this but nothing works. I change the "Allow None" to "All" on the config file, change the IncludeOptional sites-enabled/*.conf, I even reinstalled Apache (I did it properly, first with purge and all that, and then installing the apache).
This is what my error.log file says:
[Sat Feb 18 11:45:32.863856 2014] [core:notice] [pid 4656:tid 140028861409088] AH00094: Command line: '/usr/sbin/apache2'
So, what can be the problem?

I had the same problem and I solved it editing the file "/etc/apache2/sites-available".
I changed the line "DocumentRoot /var/www/html" to "DocumentRoot /var/www" and restarted the service.

Related

No permissions on htaccess file

I'm trying to setup a vagrant box with a lamp stack and was mostly successful. However, now I'm stuck with the error "Server unable to read .htaccess file". My setup is a Centos 7 server with Apache 2.4 and PHP 5.6.
Apparently, this seems to happen a lot as I saw many people ask that question, but here's the thing:
1) All my folders are with 777 permissions
2) AllowOverride all and Require all granted is set on all of my folders
3) Even went so far as to add apache user to root group just to see if it would change something
I basically did everything that was suggested in all of the posts I saw and still, apache can't read the .htaccess file.
In my logs, I see:
[Tue Sep 26 15:20:18.178541 2017] [core:crit] [pid 6491:tid 139938095892224] (13)Permission denied: [client 10.0.2.15:52176] AH00529: /var/www/html/Kalendho/public/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/html/Kalendho/public/' is executable
So I presume apache actually find the file, but for some reason, cannot open it even though it should be able to. So really, any help would be greatly appreciated as I'm currently at my whit's end here.
Thanks in advance
Okay, so apparently, it was an issue with selinux. Here's what I did:
Opened the file /etc/selinux/config and changed the following line:
SELINUX=enforcing
to
SELINUX=disabled
After that, I rebooted my machine and it got rid of the htaccess error.

How to remove "allowmethods:error" entry in apache error_log

I have only allowed GET, POST methods in my apache server. It shows lot of times error like below which is of no use to me. How can I block these errors to come in apache error log
[Mon Aug 22 18:43:27.232168 2016] [allowmethods:error] [pid 19314:tid 139797637039872] [demowebsite.com] [client 224.0.0.0:80] AH01623: client method denied by server configuration: 'PURGE' to /var/www/demowebsite/
I also want to know what is causing it. I am using apache 2.4 + php 5.5 + mod_pagespeed + varnish.
Please help me.
Since you seem to be using Apache 2.4.X
Just by setting:
LogLevel allowmethods:crit
you will be rising the level necessary to log to error log to critical level in that module so they won't show up for errors.

Apache - File does not exist error (file is definitely there) - favicon.ico

I have apache set up as a LAMP server in Linux
In the root /www/ directory, I have a favicon.ico but it never shows in the browser (Chromium, Firefox) and in the apache error.log I get the following error:
[Mon Jul 08 17:32:30 2013] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
I'm not especially bothered with the file not appearing but it is there and I haven't been able to figure out why it's giving me this error.
(Answered in a question edit. Converted to a community wiki answer. See Question with no answers, but issue solved in the comments (or extended in chat) )
The OP wrote:
The favicon was 32x32 which seems to be why. I substituted with a 16x16 favicon.ico file and I no longer get this error.
What I further don't understand is why I would get this at all - presumably some setting as I have an apache server on a hosted website with the same 32x32 favicon but it appears there and there are no errors.

gitorious gives permission denied on fresh bitnami setup , amazon ec2 instance using https

This is a brand new installation of a bitnami gitorius image on EC2, worked fine until i tried to enable https/ssl.
I am sure i have misconfigured apache somehow, however the root document at https://tarantula.anatexis.net loads just fine.
but if one goes to the gitorious app at https://tarantula.anatexis.net/gitorious you get permission denied.
which config file do I edit to allow https traffic to gitorious.
looking at the apache logs, is see this,
[Mon Jun 03 17:25:20 2013] [error] [client 71.17.13.29] Directory index forbidden by Options directive: /opt/bitnami/apache2/htdocs/gitorious/, referer:Https://tarantula.anatexis.net/
Any help would be appreciated, Thanks
Joe
OK, so i fixed it, found the file /opt/bitnami/apache2/conf/extra/httpd-ssl.conf this config file has the document root in it for ssl traffic, the default is wrong and it needs to be changed to
DocumentRoot "/opt/bitnami/apps/gitorious/htdocs/public"
This solved all my issues I believe.

Can't run any file named install.php on localhost due to apache's access_compat

I'm getting a weird problem here.
I have at least 30 localhost WordPress installs made before and every one of them went fine.
Now (after re-installing Win7 and XAMPP) I can't access ANY install.php file (whether it's WPs own, a dummy empty one, etc). Also, it doesn't matter where it's located (wp-admin folder, a random place outside WP, htdocs root folder, etc).
This is not an antivirus or Windows firewall problem.
It seems to be coming from apache itself.
The apache error log says this
[Fri Nov 30 16:46:40.223524 2012] [access_compat:error] [pid 5876:tid 1604] [client ::1:59365] AH01797: client denied by server configuration: D:/xampp/htdocs/vmf05/wp-admin/install.php
Does anyone have a clue on this?
I've went through all the normal steps and haven't found a solution yet.
Also, if I disable the access_compat module, apache won't start.
Thanks in advance for your help.
I can't believe what the problem was!
I moved a .htaccess file that had the WP better security directives to the root of xampp's site as a backup, and forgot to move it back after.
No install.php file ANYWHERE could be accessed since it had the following:
<files install.php>
Order allow,deny
Deny from all
</files>
And, since the file was on the root, it was affecting the whole server.