Archive

Posts Tagged ‘Wordpress’

Revolution2 – Premium Wordpress Theme Collection

January 29th, 2009

I love WordPress, but one thing that it’s not known for is having a really nice default theme.  It is exceptionally plain.  I’ve spent HOURS looking for nice functional themes only to download ones that “seem” nice then suck once you install them and have problems in the code that weren’t present on the screen cap.

Over the course of my journeys through many, many theme sites, I kept running across a developer whose free themes I have used before.

Brian Gardner

Revolution2His free themes are nice, clean and customizable.  The first one I used was the “Revolution Blue” (comes in red and gray too).

I ran across his site again the other day and saw that the “Revolution2″ series is available and he seems to be getting together a nice group of developers and focusing in many different genres of WordPress themes, from general blogs to Real Estate, TV, Office, Photography, etc.  These new themes make WordPress act more like a true CMS system than “just another WordPress blog”.

With a few free plugins and a little effort, these themes can give any WordPress installation a nice facelift.

For the good stuff, there is a cost involved, but the cost is minimal compared to the time I have wasted trying to find a decent design for my site.  Brian also supports the themes on his website forums and if WordPress updates come out that break any of them or has new functionality, he puts out updates.  Also, his response to email is very quick (even last night, while on vacation, he responded to my email :-) ).  So the cost is WELL worth it.

I plan on implementing one of the Revolution2 themes here on iDude over the next few weeks (as time permits).

Cool Stuff, General, Other Blogs, Software, Wordpress , , , , , , , ,

Moving away from Windows & IIS (ASP) to Linux @ SliceHost

July 24th, 2008

I have, for years, been developing web apps and so on using ASP (Classic) on IIS.  It’s a “fine” platform, but I have, over time, become weary of the Microsoft bloat that accompanies running a Windows Server… Especially in a colo/dedicated/VPS environment.

Over the last few months, since my major GoDaddy Windows Dedicated servers got hit by a worm or something, I’ve seriously started learning PHP with MySQL.  I used MySQL quite a bit with ASP and am quite familiar with it, but PHP experience was rather limited.  In the last few weeks, I’ve written a few things and ported a customer’s website over from an ASP CMS I wrote to PHP (still need to finish the CMS in PHP).  The site runs so much faster and I am now able to host it on my new Slice VPS that I setup earlier this month.  In 15 minutes or so, I can have an entire new Slice setup with Apache or Lighttpd and PHP/MySQL and, with a little tweaking and securing, have a server up and serving sites.   Can’t do that with Windows that quickly.

Slice is still running strong and I’m going to do my best to get ALL my ASP sites “ported” over to PHP over the next few months.  I’ve been using ASP/PHP cross reference sites like Design 215 and a few others and have been able to do things very quickly.  The database part was the only part I really needed to find good samples  for, but they aren’t even too hard once you use them a few times.

SliceHost has inspired me to really learn Linux and abandon the Microsoft OS, but there is still one caveat to Linux that I am very disappointed with.  There is not a single (that I’ve found), reasonably priced, multi-domain, domain level administratable email server with a nice webmail interface for users and administrative functions.

I know there are a ton of “pieces” that I can put together to get something like that, like Postfix, EXIM4, Dovecat, etc., but I just simply don’t have the time to wade through the massive pile of config files to get all those pieces working together in a nice secure and highly reliable fashion.

So, I am going to continue moving all my websites over to Linux/Apache/Lighttpd/PHP/MySQL and keep a small (30gb, 768mb RAM) Windows Virtual Dedicated server running with SmarterMail 5.x mail server on it. SmarterMail is probably one of the BEST email servers for a web hosting environment.  It is a snap to setup, backup and move to a new server if needed (Trust me, I know!). I already own an Enterprise license and am just waiting for one last very important domain to move off a temporary dedicated server before I move it to a new Windows VPS to serve the remainder of my customer’s email needs.  SliceHost isn’t a fully “managed” solution, but with the Slice Backup capability, you can have daily and weekly images made and restore to them quickly at anytime in case anything happens…

Mosso is good and is finally rectifying the Compute Cycle issue I mentioned previously,  I may keep them if I can break even with the few sites I still host on there, but their servers aren’t nearly as responsive as a VPS or Dedicated server probably due to the massively clustered setup they run.  I don’t really need individual site scalability… If a site has high requirements, I’ll just stick them on a new slice and charge the customer accordingly.  Most of my sites that would need to scale are Wordpress Blogs and could easily handle being Digg’ed etc, by installing WP-Supercache.

Ultimately I plan on hosting all websites and blogs on Ubuntu 8.04 @ SliceHost and email on a Windows VPS @ GoDaddy (for now) until I find a Windows VPS provider as excellent as SliceHost is (hint hint to SliceHost)…

That’s all for now…

If anyone knows of any turn-key type mail servers that are free/inexpensive (< $500) for Linux please leave a comment.

General, Software, Technical, Technology, Ubuntu , , , , , , , , , , , , , , , , , , , ,

Utilizing Akismet Spam Blocker in a PHP Contact Form

May 14th, 2008

I have a contact form on my company’s website that I have had serious problems with in the past… The past being before I implemented Akismet into the code.

Akismet is a service provided by Automattic (the creators of Wordpress) and is an excellent API based spam blocking system. I’ve been using it for quite a while on my blog and rogue spams hardly EVER make it into my comments. Probably somewhere in the neighborhood of only 1-2 out of thousands make it through.

I will post both the basic code for a contact form as well as the Akismet PHP5 Class (from Alex) and the include file I created to utilize the PHP5 Class.

Here is the basic form (named contact.php), with the PHP code on top, that I use.

<?php
if ($_SERVER["REQUEST_METHOD"] == “POST”)
{
include ‘akismet.php’;

$to = “YOUR EMAIL ADDRESS“;
$subject = $_REQUEST["Subject"];
$message = $_REQUEST["Message"].”<BR><BR>”.$_REQUEST["Phone"].”<BR>”.$_REQUEST["URL"];
$from = $_REQUEST["Email"];

$headers = ‘From:’.$from.”\r\n” .
‘X-Mailer: PHP/’ . phpversion() .”\r\n”.
‘Content-type: text/html’.”\r\n”.
‘Date: ‘.date(”r”).”\r\n”;

mail($to, $subject, $message, $headers);

echo “Message Sent!”;
die();
}
?>
<html>
<head>
<title>My Contact Form</title>
</head>
<body>

<form action=”contact.php” method=”POST”>
<table align=”left”>
<tr>
<td align=”right”>Your name:</td>
<td><input name=”Name” type=”text”></td>
</tr>
<tr>
<td align=”right”>Website:</td>
<td><input name=”URL” type=”text”></td>
</tr>
<tr>
<td align=”right”>Your email:</td>
<td><input name=”Email” type=”text”></td>
</tr>
<tr>
<td align=”right”>Subject:</td>
<td><input name=”Subject” type=”text”></td>
</tr>
<tr>
<td align=”right”>Message:</td>
<td><textarea name=”Message” style=”width: 224px; height: 83px”></textarea></td>
</tr>
<tr>
<td align=”right”>Your phone:</td>
<td><input name=”Phone” type=”text”>(Optional)</td>
</tr>

<tr>
<td> </td>
<td><input name=”Submit” type=”submit” value=”submit”></td>
</tr>
</table>
</form>

</body>
</html>

contact.php includes the code I created to use the Akismet PHP5 Class mentioned earlier.

Here is the code for the akismet.php. Be sure to change the $WebsiteURL variable to your website address and $APIKey variable to the API key you already have. If you do not have one, signup for a Wordpress.com account and you can get one free.

<?php
//Akisment PHP5 Class from Alex (http://www.achingbrain.net/stuff/php/akismet)
include ‘Akismet.class.php’;

//ENTER YOUR API KEY ON THE LINE BELOW!
$APIKey = ‘YOUR_API_KEY‘;

//Enter your web site address below. This is used as a parameter in the API call to Akismet…
$WebsiteURL = ‘YOUR_WEBSITE_ADDRESS‘;

//Call to check for valid API Key…
$akismet = new Akismet($WebsiteURL, $APIKey);

//Check to see if your API key is valid, if not, it will tell you so and stop.

if($akismet->isKeyValid()) {}else{echo “Your API key is NOT valid!”;die();}

if ($_SERVER["REQUEST_METHOD"] == “POST”) {

//CHANGE the $_REQUEST items to match your form field input element names

$akismet = new Akismet($WebsiteURL, $APIKey); //
$akismet->setCommentAuthor($_REQUEST["Name"]);
$akismet->setCommentAuthorEmail($_REQUEST["Email"]);
$akismet->setCommentAuthorURL($_REQUEST["URL"]);
$akismet->setCommentContent($_REQUEST["Message"]);
$akismet->setPermalink($_SERVER["HTTP_REFERER"]);

//IF THE MESSAGE IS FOUND TO BE SPAM, A MESSAGE WILL BE DISPLAYED. Customize as needed.

if($akismet->isCommentSpam()) {
echo “For some reason, your message was flagged as a possible SPAM message.”;
die();
}
//IF THE MESSAGE MAKES IT TO THIS POINT, IT IS VALID AND THE SCRIPT THAT CALLED THIS
//FILE WILL CONTINUE PROCESSING THE INPUT ACCORDINGLY…

}
?>

Click here to download a ZIP of the three files used in this example.

If you have any questions, leave a comment here and I’ll do my best to answer in a timely manner…

Cool Stuff, Software, Technical, Technology, Wordpress , , , , ,

My first look at Ubuntu 8.04 LTS as a Desktop and Server

April 28th, 2008

Last week, after much waiting by myself, Ubuntu 8.04 LTS came out. Before the release, I didn’t have the time to really mess around much with the BETAs or the last Release Candidate, but the morning it was released, torrenting commenced and went to work.

Got home, burned it to a CD and installed it on my primary Windows workstation (running Vista) using the Wubi Installer.

For those of you not familiar with Wubi, here is the blurb from their website:

“Wubi is an officially supported Ubuntu installer for Windows users that can bring you to the Linux world with a single click. Wubi allows you to install and uninstall Ubuntu as any other Windows application, in a simple and safe way. Are you curious about Linux and Ubuntu? Trying them out has never been easier!”

So basically, you can install Ubuntu into C:\ubuntu then when rebooting your machine, you will have another option to boot to besides Windows… The Wubi Installer by default only created a 12gb “container” for the Ubuntu installation. If you plan on actively using Ubuntu under Wubi, make it as large as you can do without, space wise, in Windows. It can get a bit geeky to add more space to the Wubi side after the fact. I didn’t realize it at the time and went with the 12gb, but then I wanted to run XP inside a Virtual Machine, which didn’t leave me much space left. I ended up Googling around and found a method to create a second Wubi disk and copy over your /home/ folder to it and changing your fstab to use it. So I had the 12gb for system stuff and another separate 25gb /home/ disk image.

The best thing about Wubi is that it allows you to test out Ubuntu on your machine without wiping out anything, no re-partitioning, no real impact on your system at all. You do take a slight performance hit since you are running this off a file on the NTFS file system, but the hit isn’t anywhere near as much as running it from VMWare, which doesn’t help if you are looking to see if Ubuntu is truly compatible with your hardware.

First Install as Desktop

Here are my basic system specs of my first install:

Lenovo something…
AMD 64 X2 3800+
2048mb RAM
250gb HDD
nVidia GeForce 8600GT XFX XXX w/ 256mb RAM
22″ Samsung wide screen @ 1680×1050
19″ Samsung @ 1280×1024

The installation was a breeze and all I had to do was set my network information to get online (I don’t use DHCP on my router).

The nVidia “restricted” driver took a few minutes to download and install due to the mass deluge of downloaders hitting Ubuntu’s (and mirror) servers. Response time for all APT-GET queries were a bit slow over the weekend. It calmed down some on Sunday and I was able to get things done quickly.

Setting up the Beryl/XGL effects were easy once the aforementioned driver was enabled, but Ubuntu leaves out the “advanced” configuration options for the effects. Again, googling around, I was able to find the “apt-get” commands to get those utilities installed.

Probably the longest thing to get working was the true dual display.

Just after installing Ubuntu, both monitors had the same output. After installing the nVidia drivers, the secondary screen dropped out, but there was no explanation for it and no setting in the display properties would bring it back. Googling mentioned a program called “nvidia-settings” which I ran and after much tinkering was able to get a solid xorg.conf created to have the 22″ monitor primary and the 19″ as a secondary span to the first.

Needing to work a lot in the Windows world, I keep a Raw XP VM Machine around that is patched (mostly) and ready to unzip and load to install the few Windows based utilities I need like Adobe Photoshop (doesn’t work well under Wine) and Microsoft Expressions/Visual Studio. Installing VMWare Player took a bit of hacking around, but installed fine. I used the secondary monitor to full screen XP while keeping Ubuntu on the primary.

Overall, things are MUCH better under 8.04 than any of the previous Ubuntus in my opinion. Googling around for things was key for me. Be sure to include “8.04″ in your search queries to limit the number of older pages from being returned. Some of those instructions are way out of date with 8.04.

Later this week, I am going to try my “dad test” on Ubuntu to see if he can handle it, I did install it on his machine, but had trouble getting his Wireless to connect to one of my many access points (He lives across the street with a WiFi repeater in his office). I think the driver is just flaky.

Might end up just putting an Ethernet bridge on his PC so it’ll just use his ethernet port which looked fine.

Second Install as Server

System Specs:
Dell SC430 Server
Intel Pentium D Dual Core 2.8ghz
1gb RAM
160gb SATA HDD
Integrated Video
17″ Viewsonic LCD

As has been usual with the later Ubuntu builds, Installation was a breeze. This time, I wiped out the parition completely and installed it directly on the box which made it very fast compared to the Wubi install above, which isn’t bad to begin with.

For this installation, I was more server focused, but did not install the “server” version of Ubuntu. I opted to use the same “desktop” version and install all the packages I needed to make it a “server”.

Doing a lot of Wordpress Installations, I chose to get a Virtual host WP environment setup.

I’ve been hearing a lot of good about LighttpD lately and decided to apt-get that instead of Apache2.

LighttpD is a VERY fast alternative to Apache2 (up to 50% faster in some cases). Setting it up was as easy as “apt-get install lighttpd” (After removing Apache2).

# apt-get remove apache2.2-common
# apt-get install lighttpd mysql-server php5-cgi php5-mysql

I also grabbed PHP-CGI and did a little tweaking to get lighttpd to parse the PHP files using FastCGI which was not difficult.

# lighty-enable-mod fastcgi

Had to edit the /etc/lighttpd/conf-enabled/10-fastcgi.conf to get my paths correct.

Googling around gave me the conf file lines I needed for the Virtual host config:

For a single hostname like yourdomain.com

$HTTP["host"] == "yourdomain.com" {
server.document-root = "/your/www/path"
}

for anything.yourdomain.com use this…

$HTTP["host"] =~ "(^|\.)yourdomain\.com$" {
server.document-root = "/your/www/path"
}

Put as many as you need in there. I used a spare domain and pointed *.MyDomain.com over to it and setup a few virtual hosts to test them.

Restart Lighttpd using:

/etc/init.d/lighttpd force-reload

I had a LLMP (Linux, Lighttpd, MySQL, PHP) server setup and ready to go.

Download the latest WP files:

curl http://wordpress.org/latest.tar.gz -o latest.tar.gz

Uncompress them to the virt root of your choice and be sure to chmod the folders correctly so WP can run the setup and create the wp-config.php file.

To make Permalinks (friendly URLs) work, just add this into the lighttpd.conf before (or within) the virtual host directives…

server.error-handler-404 = "/index.php"

This will allow the permalinks to work correctly, mod_rewrite rules are not necessary.

There may be a little more to all this than the above instructions, depending on your configuration. The information provided was to just provide basic guidance.

My plans are to eventually backup all the WP blogs on host on my dedicated server and curl them over to this Ubuntu box, uncompress them, drop and restore the databases and have a mirror of them offsite from the dedicated server in case anything ever happens. This should be easiest enough to do in a few hours in one script file on the server to do the backups and database dumps into one compressed file, then another cron’ed script on the local Ubuntu to curl it down and restore everything. If anything ever goes wrong, just change the DNS for the domains and point them to my local Ubuntu which can be DMZed on my router. :-)

Cool Stuff, Linux, Microsoft, Software, Technology, Ubuntu, Wordpress , , , , , , , , , , , , , , , , , , , , , , , ,

Wordpress 2.5 Image Insertion Problem

April 6th, 2008

I know MANY people have reported problems with the new 2.5 Wordpress, especially in the backend administration portion.

The only problem I’ve personally run into so far is inserting images into a post after uploading it. The upload portion including the new flash uploader works flawlessly for me, then when I hit “Insert” to put it in the post, the “Add an Image” popup would just go blank and sit there forever. I tried various things including disabling all plugins, manually updating the files in the wp-admin and wp-includes folder to no avail.

Here is how I fixed my installation…

I simply reinstalled it using the following steps…

  • Backup blog and database… (ZIPped up blog and MySQL Admin backed up database)
  • Used Wordpress Export to export settings, articles, comments etc. for reimportation after reinstall
  • Clear out the blog web root and delete all content in the database leaving it blank.
  • Dropped new WP 2.5 files into the root and went through the install process for the new blog
  • Reimported the XML file with the settings, articles, etc…
  • Made sure my other settings like Permalinks were still setup correctly
  • Copied over my themes, plugins and uploads folder so I wouldn’t have broken links and reactivated my plugins and theme.

The only thing that I can see that didn’t reimport back over was my blogroll links. To fix this, I went ahead and restored my old database and ran this SQL command… from the commandline.

insert into idude.wp_links select * from idude_OLD.wp_links;

Looks like everything is back up and running for me, and it only took about 10 minutes.

Software, Technical, Technology, Wordpress , , , , , , ,