Archive for the 'Site Info' Category

MySQL phpMyAdmin madness

Saturday, August 7th, 2004

Yesterday I entered into a tarpit of corrupted configuration files and such. What appears to have happened was that my Cpanel install was upgraded and there are some functions on Cpanel which refer back to my .htaccess. At the time, it appeared that my .htaccess file was horribly corrupted, in particular one rewrite rule which affected my wordpress install and upon some editing, voila — I broke links to my older posts. In essence, I still had my front page, but none of the links to my archived posts or comments worked.

Since I had been itching to fix my Wordpress install (some of the files were from my original .72 install), I figured that this would be a good time as any to back up the database and to reinstall Wordpress from scratch. So, that is what I did. There was even a HOWTO on backing up your database using phpMyAdmin on the WordPress FAQ, and I followed those instructions.

The backup went fine, except initially I had some problems opening up the resulting backup file called localhost-sql copy1.zip. If I was to do it again, I would definitely export my database not only in SQL, but also .CSV and .XML, just to be sure. Anyway, I was able to open the resulting .SQL file as text, and all was good. I also inadvertently exported my previous movable type database too, but hey.

By the time I went to bed last night, I had the data but I was banging my head trying to figure out how to restore it within the new database, since I was getting SQL error messages telling me that the database was already created. I knew that, but what was going on?

This morning I found this article on Dev Shed about backing up and restoring MySQL databases complete with explicit instructions and screenshots. It was helpful to see the screenshots, but I was still seeing stupid error messages.

It was only after a few more unfruitful tries of restoring my database did I figure out where my problem was. It appears that my export of the database inserted an unneeded SQL command into the header of the export file.

#
# Database : `my_database`
#
CREATE DATABASE `my_database`;
USE my_database;

And yes, I did realize that the “CREATE DATABASE” statement was incorrect since my database already existed, but I was initially thinking that I needed an INSERT or UPDATE command. I attempted those, no dice.

As best as I figure it, if you are merely trying to upload data into an empty database using the phpMyAdmin SQL tab > “Location of the textfile” option, the SQL statement at the top of your exported text file is redundant and should be omitted.

Bots configured badly

Wednesday, July 28th, 2004

While I was checking my Web site logs last night I noticed another strange “guest” username entry. So armed with my monthly Apache logs and the grep command, I found the offender and it is indeed a badly configured bot.

168.75.177.103
- guest
[25/Jul/2004:05:41:07 -0400]
“GET / HTTP/1.1″ 200 28287
“-”
“Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)”

Searching for the 168.75.177.103 IP address on Google shows that this bot or crawler or whatever it is, has gotten around.

Odd site log entry

Wednesday, July 14th, 2004

Recently, I started finding “username” entries in my Web stats program. At first I feared someone possibly cracked my box, but the mysterious users only visited for a short bit and they only apparently reached my Web server. The only two Web serving programs I have are Apache and WordPress. My Apache install is maintained by my wonderful webhost, while the WordPress install is maintained by me, and I hadn’t approved any other members as of yet. So, after the initial findings, I waited to see if the mysterious log entries would appear again, so I could track them. Here is an entry which recorded a username today.

68.116.223.103 //IP addy
- www.carvir //unknown fields, “www.carvir” recorded as username
[14/Jul/2004:07:31:22 -0400] //date, time
“GET / HTTP/1.0″ //HTTP request
200 23667 //HTTP code, bytes sent
“-” //Referer string
“Mozilla/3.0 (compatible)” //User Agent (this looks like a bot)

I’m not an HTTP expert, but I think after seeing this log entry, that second part where the “- www.carvir” appears is possibly where a username/password is passed along to the server.

Just for kicks here is a normal looking entry for comparison….

[IP addy]
- -
[14/Jul/2004:11:23:17 -0400]
“GET /archives/office-depothewlett-packard-summer-offer-to-recycle-consumer-electonics/ HTTP/1.1″
200 5052
“http://www.mikemcbrideonline.com/blogger.html”
“Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040707 Firefox/0.9.2″

Hi Pablo

Friday, July 2nd, 2004

Due to the clever built-in anti-comment spam features of wordpress, your comment spam advertising your francophonic Web site which euphemistically offers a little bit of everything for everyone was immediately placed into comment moderation (and thusly deleted) because of one simple mistake you committed.

HTH. HAND. You have been IP banned. 66.98.152.93

Returning the favor…

Monday, June 7th, 2004

With the prevalence of spammers now hitting my referrer logs, I’ve decided to “help them out” and “provide more traffic” to their sites. Here are two of the latest jokers, complete with their IPs.

Host: 66.230.218.66
Url: /
Http Code : 403
Date: Jun 07 11:37:28
Http Version: HTTP/1.1″
Size in Bytes: 1009
Referer: [some porn site]
Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .WONKZ)

Host: 66.230.218.67
Url: /
Http Code : 403
Date: Jun 07 11:29:52
Http Version: HTTP/1.1″
Size in Bytes: 1009
Referer: [some porn site]
Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .WONKZ)

I could have merely banned them in the .htaccess file, but I accidentally found out that their source IPs are actually live Web servers (hosting porn of course) and the bot coming from either of the IPs uses the same user agent string. Thusly, some fun with .htaccess….

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} “(compatible; MSIE 6.0; Windows NT 5.1; .WONKZ)” [NC]
RewriteRule /* http://66.230.218.66 [R,L]

FYI, the IP addys belong to a block of numbers from Candid Hosting, which is apparently a Canadian hosting company. I took a quick look at their Terms of Service, and it appears that they allow adult web sites.

Update: I altered the user agent string to be more specific. Just using the .WONKZ string was not effective.

whoops

Sunday, June 6th, 2004

Tonight I found a problem with the index.php template I am using. Originally the header had an a href of this echo statement.

< ?php echo $siteurl; ?>

This echo statement sets the header URL to the present page, which is a pain when one is on a comment page and there is no link *back* to the front page.

I only found this by commenting in a post, then realizing that I couldn’t return to the front page. Anyway….

WordPress!

Sunday, May 30th, 2004

I’m in the process of installing wordpress, so just a few quick notes for y’all.

  • The blog URL will be cleverhack.com rather than cleverhack.com/blog. I’m setting up a redirect to help you guys out.
  • I’ve also set up a redirect for the folks who are reading me via syndication feeds. I really hope that move didn’t screw anybody’s newsreaders up.
  • I’m closing all old comments on the MT install. I’m sure this move will only upset the comment spammers. :-P
  • I won’t remove the old individual posts from the Movable Type install. So, your old linkages to me should be fine.
  • Old date arranged archives like http://www.cleverhack.com/blog/archives/2004_03.html should be deleted.
  • Ok, folks, gotta get to reconfiguring….

    Update 5/31: Still messing around with the look, but thanks to the wonderful Mark over at Mindful Musings who made his clean look template freely available to design incapable people like myself. I will be messing around with the look, but this is a good first start.

    Hello world!

    Sunday, May 30th, 2004

    First Post!