404 Errors on Apache2 & Ubuntu


Super newbie here! I found a couple of apps I wanted to try out, both using Yii. I uploaded them to an external webserver, configured, and they ran quite nicely! Then I built an Ubuntu box, spent a day installing Apache2, MySQL, and scores of other things. I have maybe done this twice before, but never to support Yii and never than more as hobby interest.

I run the Yii framework requirements page and it comes back all green and happy!

I install the first app in the webroot, just to test it. All goes well, able to run their install script… but then it points the first of many "managed urls" example: /index.php/site/login

And I get a 404 not found.

I then tested the demos in the Yii framework folder and they work fine except hangman and blog, which both produce a 404 when a managed url is the link (such as the letter links in the Hangman app).

All my permissions were set to 755… I even tried 777! I know I am missing something very basic, just too newb to see it. Help me, Obi Wans!

I think you need to configure Apache to allow override for the default site.

So instead of:

AllowOverride None

if should be:

AllowOverride All

In /etc/apache2/enalbled-sites/default.conf

I think.

I had to change that, otherwise the rewrite rules will have no effect even when mod_rewrite is enabled.

I lost an hour yesterday because I forgot to configure it! :P

Hey thanks! I found it and the file was 000-default.

AllowOveride All was how it was set. So, no change there.

Still having these issues. It just seems to me like it’s not processing the “url management”. It has to be something similar to what you mentioned but in a different place.

I have installed 2 other apps on this same webserver (OpenDocMan and Collabtiv) and they work just fine.

But I love the Yii, man… I need the Yii…

Anyone? Anyone? Bueller? Bueller? Bueller?

as the URLs are the problem… its could be that mod_rewrite is not enabled in apache…

Also check that you changed the right line with ‘AllowOverride None’ in your apache config file. I have for the yii config several lines with AllowOverride. Take the one with <Directory /your/yii/webroot>

I seem to have the same problem…

I installed mod_rewrite

and chenged the ‘AllowOverride None’ to ‘all’ as well (in all places related to ‘www’ folder)

but it still shows me the ‘Not Found’ message

Does anyone know what could be the problem?

I have written a guide on how to customize the 404 page in Apache in my blog. I think it might be helpful too for you guys so I am going to paste the guide here.

  1. You have to make sure that you have turned the rewrite module on in apache

You can follow the steps on this post to enable it

  1. Create .htaccess in /var/www or edit it if you already have one

  2. Add the following line in the post


ErrorDocument 404 /the-filename-of-your-customized-404-page

In my case, it is


ErrorDocument 404 /404.php

That’s done!

Please continue if you want to use the 404 page provided by your wordpress theme