Page 1 of 1

Changed to apache rewrite now I have nothing!

Posted: Wed Aug 23, 2006 2:03 am
by kaediem
I really have to stop messing with this because I always seem to get into trouble when I do. :cry:

I was changing some settings in the configuration and noticed that I hadn't set the url rewriting to apache mod rewrite like I have in my other blogs so I did that and now when I try to access the blog I get this...
Warning: mysql_connect(): Access denied for user: '389806_surfingle@ip-68-178-232-42.ip.secureserver.net' (Using password: YES) in /home/content/s/u/r/surfinglegends/html/serendipity/include/db/mysql.inc.php on line 251

Warning: mysql_select_db(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/content/s/u/r/surfinglegends/html/serendipity/include/db/mysql.inc.php on line 252

Warning: mysql_select_db(): A link to the server could not be established in /home/content/s/u/r/surfinglegends/html/serendipity/include/db/mysql.inc.php on line 252
DATABASE_ERROR
I'm assuming it has something to do with my .htaccess

This is it...
# BEGIN s9y
ErrorDocument 404 /serendipity/index.php
DirectoryIndex /serendipity/index.php

RewriteEngine On
RewriteBase /serendipity/
RewriteRule ^(archives/([0-9]+)-[0-9a-z\.\_!;,\+\-]+\.html) index.php?/$1 [NC,L,QSA]
RewriteRule ^(authors/([0-9]+)-[0-9a-z\.\_!;,\+\-]+) index.php?/$1 [NC,L,QSA]
RewriteRule ^(feeds/categories/([0-9;]+)-[0-9a-z\.\_!;,\+\-]+\.rss) index.php?/$1 [NC,L,QSA]
RewriteRule ^(feeds/authors/([0-9]+)-[0-9a-z\.\_!;,\+\-]+\.rss) index.php?/$1 [NC,L,QSA]
RewriteRule ^(categories/([0-9;]+)-[0-9a-z\.\_!;,\+\-]+) index.php?/$1 [NC,L,QSA]
RewriteRule ^archives([/A-Za-z0-9]+)\.html index.php?url=/archives/$1.html [NC,L,QSA]
RewriteRule ^([0-9]+)[_\-][0-9a-z_\-]*\.html index.php?url=$1-article.html [L,NC,QSA]
RewriteRule ^feeds/(.*) index.php?url=/feeds/$1 [L,QSA]
RewriteRule ^unsubscribe/(.*)/([0-9]+) index.php?url=/unsubscribe/$1/$2 [L,QSA]
RewriteRule ^approve/(.*)/(.*)/([0-9]+) index.php?url=approve/$1/$2/$3 [L,QSA]
RewriteRule ^delete/(.*)/(.*)/([0-9]+) index.php?url=delete/$1/$2/$3 [L,QSA]
RewriteRule ^(admin|entries)(/.+)? index.php?url=admin/ [L,QSA]
RewriteRule ^archive/? index.php?url=/archive [L,QSA]
RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rss|rdf|rss2|xml) rss.php?file=$1&ext=$2
RewriteRule ^(plugin|plugin)/(.*) index.php?url=$1/$2 [L,QSA]
RewriteRule ^search/(.*) index.php?url=/search/$1 [L,QSA]
RewriteRule ^(serendipity\.css|serendipity_admin\.css) index.php?url=/$1 [L,QSA]
RewriteRule ^index\.(html?|php.+) index.php?url=index.html [L,QSA]
RewriteRule ^htmlarea/(.*) htmlarea/$1 [L,QSA]
RewriteRule (.*\.html?) index.php?url=/$1 [L,QSA]

<Files *.tpl.php>
deny from all
</Files>

<Files *.tpl>
deny from all
</Files>

<Files *.sql>
deny from all
</Files>

<Files *.inc.php>
deny from all
</Files>

<Files *.db>
deny from all
</Files>

# END s9y
Please can someone help me fix this? I really don't want to start over now!

Lisa

Posted: Wed Aug 23, 2006 2:28 am
by mgroeninger
Actually, with that warning about the mysql connection I would suggest you check your serendipity_config_local.inc.php.

It may have been corrupted (or erased), especially if the permissions on it were a little strange.

If you need to rebuild it from scratch here is an example (not mine):

Code: Select all

<?php
        /*
          Serendipity configuration file
          Written on Sun, 23 Apr 2006 17:59:45 +0200
        */

        $serendipity['versionInstalled']  = '1.0';
        $serendipity['dbName']            = 'serendipity';
        $serendipity['dbPrefix']          = 'serendipity_';
        $serendipity['dbHost']            = '127.0.0.1';
        $serendipity['dbUser']            = 'root';
        $serendipity['dbPass']            = 'root_password';
        $serendipity['dbType']            = 'mysql';
        $serendipity['dbPersistent']      = false;

        // End of Serendipity configuration file
        // You can place your own special variables after here:

?> 

Posted: Wed Aug 23, 2006 3:51 am
by kaediem
Thanks Matthew - I tried every variation I could think of but nothing made any difference.

This is what's in mine;
$serendipity['versionInstalled'] = '1.0';
$serendipity['dbName'] = 'user_389806';
$serendipity['dbPrefix'] = 'serendipity_';
$serendipity['dbHost'] = '10.0.11.206';
$serendipity['dbUser'] = '389806_surfingle';
$serendipity['dbPass'] = 'mypassword in clear text';
$serendipity['dbType'] = 'mysql';
$serendipity['dbPersistent'] = false;

Lisa

Posted: Wed Aug 23, 2006 6:12 am
by mgroeninger
That looks fine... maybe I was wrong...

Are you still getting the database connection error?

Posted: Wed Aug 23, 2006 7:42 am
by kaediem
yes, still getting the same error :cry:

Posted: Wed Aug 23, 2006 10:45 am
by garvinhicking
Hi!

That error is definitely related to your mysql database having the wrong password.

Please ask your provider if the MySQL server might be down, or think really hard if your password or servername has changed in the serendipity_config_local.inc.php recently? :)

Best regards,
Garvin

Posted: Wed Aug 23, 2006 3:35 pm
by kaediem
Thanks Garvin -

Actually, the user name isn't the one I log in with so the whole thing might be wrong.

should the name after and before the numbers and _ be my log in name? and if I change that and put the correct password in clear text will that work? I noticed that it's always encrypted in my other blogs.

I know the sql wasn't down last night so it must be the password/username
Lisa

Posted: Wed Aug 23, 2006 3:49 pm
by garvinhicking
Hi!

You must edit your serendipity_config_local.inc.php file and there insert the right DB username and password and database name that you were assigned! You need to enter the cleartext password into that file. Encrypting it is only false security, because the PHP applications needs to decrypt it. And if this app can decrypt it, anyone can decrypt it that has access to this file.

If you cannot write to that file, checkout the "fixperm.php" script mentioned in the FAQ on www.s9y.org?

Best regards,
Garvin

Posted: Wed Aug 23, 2006 7:23 pm
by kaediem
Well, thanks all but it looks like I'm going to have to start over - nothing seems to be working and the only thing I can think of is that somehow the numbers in the dbuser dbname have gotten messed up somehow.

This isn't the first time this has happened to me - I hope it doesn't happen again but if it does I'll make better notes about what I've done

Lisa

Posted: Thu Aug 24, 2006 10:25 am
by garvinhicking
Hi!

That is really weird. Can't you check your actual database user names and passwords and see if they really match? Maybe use a tool like phpMyAdmin and try to login with the same credentials?

Best regards,
Garvin