"Page Not Found" error ... sometimes.

Permalink
Hi guys,

I have Concrete working now on my local machine. Here are the steps I took:

1. Installed MySQL 5.1.30
2. Installed MySQL Tools
3. Installed Apache 2.2
4. Installed PHP 5.2.8 with GD and MySQL
5. Edited httpd.conf to include index.php as a directory index and to include mod_rewrite
6. Used MySQL Administrator to set up a database and user
7. Copied Concrete into the htdocs folder

I was able to install, and now Concrete is up and running. However, I keep getting a "Page Not Found" error which occurs about 50% of the time.

I haven't seen this problem on pages like login or dashboard, but I do see this problem when more parameters are being passed. For example, the install script or the login script suffers from this problem.

Would anyone know how to fix it?

elyon
View Replies:
elyon replied on at Permalink Reply
elyon
Funny enough, I'm not really having this issue so much today. I hear that Apache will serve up blank pages when the server's overloaded, or just when its having a bad day.
bettse replied on at Permalink Reply
bettse
I'm running Concrete5 (5.1.1) on a vhost (http://c5.ericbetts.org ) and I'm experiencing the same Page Not Found problem. Since this is a shared machine for hosting websites, all the dependencies were already installed. Its a Gentoo box with the following versions:

mysql --version
mysql Ver 14.12 Distrib 5.0.54, for pc-linux-gnu (i686) using readline 5.1

apache 2.2.9

php 5.2.6

Any suggestions as to how to fix this or identify the problem would be greatly appreciated.
frz replied on at Permalink Reply
frz
all the time, or just 50% of the time?

can you get any stats on what the CPU usage and database connections count are on that shared server you're on?

Did I mention we host c5 sites for $15/month and its fast?

-frz
http://getconcrete5.com
bettse replied on at Permalink Reply
bettse
I seem to receive the message frequently when I first visit the site (its only a testbed, so I don't work on it more than once or twice a day), but once I refresh until I get a valid page, I don't encounter the Page Not Found until I try to edit a page, at which point I get it once or twice per action (checking out the file for edit, checking it back in).

CPU load on the box is very low (Load average: 0.05 0.05 0.01) and usually stays that way.
I'm not sure how to get a connection count, my mysqladmin status reports:

Uptime: 6688294 Threads: 9 Questions: 11820420 Slow queries: 1 Opens: 1021782 Flush tables: 1 Open tables: 64 Queries per second avg: 1.767

If you can provide me with the command to get the mysql connection count, I can get that. It sounds like you're hinting that high load or high number of connections could result in Page Not Found as a result of concrete5 not getting that data it needs in time. I wouldn't think that's the case on a box as bored as this one, but I'm willing to try just about anything at this point.

Also, I appreciate the reminder about your hosting, but my server works great for all my needs, save this one.
Jsn replied on at Permalink Reply
Jsn
Last week, when I had 5.1 running in a testbed, there were never any problems with "Page Not Found".

Deleted those files, did a clean install of 5.20RC1 in a new testbed, and shazam: I get "File Note Found" about half the time. It's frustrating, because if I just hit Refresh the page gets served up promptly, every time.

It seems like my home page is especially susceptible to this. Which, of course, makes it difficult to go live with the site! Please enlighten, folks.
frz replied on at Permalink Reply
frz
the intermittent nature of the issue makes me think it has to be a server issue. Can you talk to your host about how many connections they allow to the database?

I know c5 does hit the DB a lot. We've got some caching stuff started in 5.2 that improves that dramatically, but if your mysql connection count is super low and there are other things going on on the box, I could see getting the issues you're getting.
elyon replied on at Permalink Reply
elyon
I just increased the number of connections on my local MySQL server from 100 to 300, and that has seemed to help with this issue. However, in testing, it still cropped up for me ... but not as often or consistently as before. One of the worst offenders seems to be when I change the page type of a page and try to commit the change, or sometimes if I add a custom block with a lot of content and try to commit the change.

I'll try using 5.2 and seeing if that helps.
Jsn replied on at Permalink Reply
Jsn
...at least not for me. For what it's worth, I turned off "pretty URLS", thinking it might have something to do with pathname translations.

Now it's only the homepage that doesn't load! And the old trick of hitting Refresh doesn't work, either.

If I make a hard link to "index.php", that pulls up the home page nicely. But if I just navigate to the webroot, I get
This page contains the following errors:
error on line 28 at column 82: Opening and ending tag mismatch: link line 0 and head
Below is a rendering of the page up to the first error.


Should I be adding something to index.php? Seems like it's just not parsing correctly.
dstew99 replied on at Permalink Reply
dstew99
RewriteEngine On
# Install directory, mine is root
RewriteBase /
# Protect system files
RewriteRule ^(concrete|config) - [F,L]
# Display existing files or directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite others to index.php/URL
RewriteRule .* index.php/$0 [PT,L]


--------------

Also, have you checked to make sure you don't have any leftover index.htm(l), default.htm(l) files that are loaded when nothing is specified?
Jsn replied on at Permalink Reply
Jsn
I appreciate the code, dstew. It didn't work for me directly, but it pointed out my problem.

I have two CMS installs on my testbed site--C5 and Silverstripe. The latter already has rewrite code in the .htaccess file. If I take it out, C5 works fine...but, of course, Silverstripe doesn't.

I'll do the buildout in C5 as it is--not really a big hassle to resolve to index.php myself. When it's ready, I'll scoop out Silverstripe and go live (there's really no comparison between the two: C5 is a far more elegant product).

This does highlight something for people to keep in mind: if C5 is acting wonky, check to see if some residual code from another CMS is still resident in the .htaccess.
Jsn replied on at Permalink Reply
Jsn
Just to be clear, I thought I'd share the easy fix for missing ".php" resolutions like mine.

To recap: right now my public site is being served up by Silverstripe. That CMS requires its own RewriteEngine code in the main .htaccess file. This makes C5 (running in a subdirectory) unable to automatically open "index.php" on the home page.

To get around this, all you need to do is insert a second .htaccess file in the subdirectory (the one C5 is running in). Just add a single line of code:

RewriteEngine off


This keeps the other CMS from interfering.

If you're like me and have tried several different CMS, you might have residual RewriteEngine code in your .htaccess, even if you've deleted the CMSes themselves. Always worth checking.

By the way, you can add the "pretty URLs" code to this .htaccess file (which turns RewriteEngine back on), and it works just fine.
dstew99 replied on at Permalink Reply
dstew99
glad it worked for you.
dmin7b5 replied on at Permalink Reply
I'm having the same issue where I have to refresh the home page to get it to load.