{"id":209,"date":"2007-09-22T17:50:31","date_gmt":"2007-09-23T01:50:31","guid":{"rendered":"http:\/\/www.evardsson.com\/blog\/2007\/09\/22\/gentoo-apache-22-update-and-403-errors\/"},"modified":"2007-09-23T14:59:38","modified_gmt":"2007-09-23T22:59:38","slug":"gentoo-apache-22-update-and-403-errors","status":"publish","type":"post","link":"https:\/\/www.evardsson.com\/blog\/2007\/09\/22\/gentoo-apache-22-update-and-403-errors\/","title":{"rendered":"Gentoo Apache 2.2 update and 403 errors"},"content":{"rendered":"<p>After upgrading my entire system, moving from Apache 2.0.x to 2.2.6 I ran into an interesting problem (actually, a couple.) Some of the configurations have moved, and things that used to be in the Gentoo dist httpd.conf have been broken out into config files in the \/etc\/apache2\/modules.d\/ directory. So, copying my old vhosts file in was not a good idea. And doing a merge of the old and new httpd.conf files was also a mistake. Once I figured out that I had the Listen 80 directive in one file and Listen 192.168.1.10:80 in another I understood why it failed to start. So, I fixed all the configs to match the new setup, and tried again. It started up just fine, and seemed okay, until I tried to connect. I kept getting 403 errors.<\/p>\n<p>I went through the standard checks, checking the file permissions, .htaccess settings, and so on, to no avail. A quick Google search pointed me to the <a href=\"http:\/\/victortrac.com\/gentoo_upgrade_to_apache2-2\">fix from Victor Trac<\/a>. He found the offending bit in the new broken out config in \/etc\/apache2\/modules.d\/00_default_settings.conf where it contains:<\/p>\n<pre>&lt;Directory \/&gt;<\/pre>\n<pre>        Options FollowSymLinks\r\n        AllowOverride None\r\n<strong>        Order deny,allow<\/strong>\r\n<strong>        Deny from all<\/strong>\r\n&lt;\/Directory&gt;<\/pre>\n<p>The fix is either to change that to Allow from all and define Deny where needed in each virtual host or to override it in every virtual host. Since I tend to set up my hosts with the idea that the server allows everything and it is up to the host to deny where needed I chose the first option, reloaded Apache and everything is sweet again.<\/p>\n<p><span style=\"display: block; background-color: yellow\">Edit:<\/span><\/p>\n<p>I found I was having an error with the RewriteRules after switching from Apache 2.0.x to 2.2.x &#8211; I found the fix on the Gentoo forums, which required adding an extra RewriteCond line in the .htaccess file.<\/p>\n<p>The old .htaccess: and the new:<\/p>\n<pre># BEGIN WordPress\r\n&lt;IfModule mod_rewrite.c&gt;\r\nRewriteEngine On\r\nRewriteBase \/blog\r\nRewriteCond %{REQUEST_FILENAME} !-f\r\nRewriteCond %{REQUEST_FILENAME} !-d\r\nRewriteRule . \/blog\/index.php [L]\r\n&lt;\/IfModule&gt;\r\n# END WordPress<\/pre>\n<p>and the new:<\/p>\n<pre># BEGIN WordPress\r\n&lt;IfModule mod_rewrite.c&gt;\r\nRewriteEngine On\r\nRewriteBase \/blog\r\nRewriteCond %{REQUEST_FILENAME} !-f\r\nRewriteCond %{REQUEST_FILENAME} !-d\r\n<strong>RewriteCond $1 !&#92;.php$<\/strong>\r\nRewriteRule . \/blog\/index.php [L]\r\n&lt;\/IfModule&gt;\r\n# END WordPress<\/pre>\n<p>Technorati Tags: <a href=\"http:\/\/technorati.com\/tag\/Apache%202.2\" class=\"performancingtags\" rel=\"tag\">Apache 2.2<\/a>, <a href=\"http:\/\/technorati.com\/tag\/403\" class=\"performancingtags\" rel=\"tag\">403<\/a>, <a href=\"http:\/\/technorati.com\/tag\/Gentoo\" class=\"performancingtags\" rel=\"tag\">Gentoo<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>After upgrading my entire system, moving from Apache 2.0.x to 2.2.6 I ran into an interesting problem (actually, a couple.) Some of the configurations have moved, and things that used to be in the Gentoo &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[25,23],"tags":[162,160],"class_list":["post-209","post","type-post","status-publish","format-standard","hentry","category-apache","category-gentoo","tag-apache","tag-gentoo"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pxT7i-3n","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.evardsson.com\/blog\/wp-json\/wp\/v2\/posts\/209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.evardsson.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.evardsson.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.evardsson.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.evardsson.com\/blog\/wp-json\/wp\/v2\/comments?post=209"}],"version-history":[{"count":0,"href":"https:\/\/www.evardsson.com\/blog\/wp-json\/wp\/v2\/posts\/209\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.evardsson.com\/blog\/wp-json\/wp\/v2\/media?parent=209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.evardsson.com\/blog\/wp-json\/wp\/v2\/categories?post=209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.evardsson.com\/blog\/wp-json\/wp\/v2\/tags?post=209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}