Recovering from WordPress permalinks hack

September 11, 2009

We have seen quite a few blogs hacked because WordPress was NOT updated on a timely manner. If you are seeing strange links in URL with eval… functions your blog was 0000wned…sorry :(

Use phpmyadmin or shell mysql command to replace some bad stuff:

update wp_options set option_value=” where option_name=’_transient_rewrite_rules’;

select * from wp_options where option_name=’permalink_structure’;

Check the above SQL select and see if you have any strange functions or code in wp_options field. Replace as required, for example:

update wp_options set option_value=’/%year%/%monthnum%/%postname%/‘ where option_name=’permalink_structure‘;

Increase gpg file encryption security using AES256

April 2, 2009

In order to increase backup files or sensitive information using gpg you should specify gpg using AES256 cipher algo. AES256 will use 256 bit key, it’s open encryption algorithm and it’s been approved by the NSA for top secret information.

Add to the gpg the following switch:

–cipher-algo=AES256

The full command line to encrypt file using gpg with AES256 key:

gpg –cipher-algo=AES256 -c file.tgz

It’s quite of bit of typing every time and I prefer to set-up alias

alias gpg=’gpg –cipher-algo=AES256′

you can add it to your ~/.bashrc or any other profile file that is executed when you login into the system. The alias syntax may change if you are using different bash.

Encrypt your backup files for top security using GPG

February 7, 2009

Remember that you should have backups for your servers or web site. If a disaster strikes you can restore the data quickly and easily – you should keep the backup files SAFE, because backup usually includes system configuration, users, passwords and various other very important data. And by safe we mean that none except you can access it. We usually keep backup files on a remote server(s) to make sure no data backups are kept in one physical location.

For extra security we do encrypt backup files using gpg (Gnu Privacy Guard) a Linux command line software in our case. Gpg provides very high security level and encryption.

You can encrypt file using GPG:

gpg -c filename.tar

<enter password 2 x times>

If you are running gpg command first time a key may be generated before you can enter the password.

File unencryption can be done by:

gpg -c filename.tar.gpg

There you go :)

For folks who want to encrypt backup files or any other files using automated scripts use the following command:

echo PASSWORD_HERE | gpg –passphrase-fd 0 -c FILENAME_HERE

WordPress architecture for high load blogs

December 27, 2008

At LinuxAdmin we have worked hard to develop and use high-performance open source software for reliable WordPress blog hosting. We have spent years managing Linux boxes and have seen small blogs reach millions of unique monthly visitors that we host.

Budget is one of the major factors for every business or even a private person. This is why we use low cost servers and set-up in load balancing environment for high-availability and horizontal scalability.

For WordPress blogs we suggest starting with a dedicated server that will host web content and MySQL database as well. When load increases you can start using more advanced techniques and tuning like local caching, using content delivery networks, super fast web servers for serving static content and other methods.

However, the biggest performance gains are to split MySQL server from Web server, thus, you will have a dedicated box for Web server and MySQL database.

Next is to split static content from dynamic content (PHP) – there are many super fast web servers that will serve images, file downloads and other static content at super fast speeds and using low resources. Some examples: Nginx, Cherokee, Lighttpd, Thttpd and many others.

Remember to use local caching plugins like supercache, some sites experience very good performance boosts using eaccelerator and other PHP caches. You should test out what works best for you.

You can also do memory-caching based on memcached. Pretty cool way to use server memory to store code blocks, like front page, feeds etc.

We will go more in depth in our next blog posts, but if you are searching for a good Linux server management company that can handle and tune WordPress blogs you should consider Linux Admin. Remember, we pay attention to every server and do a lot of custom work – customization, tuning, performance benchmarking, peak monitoring and other tasks to make sure you server performs at it’s best!

Remote backup service security

November 30, 2008

One of the most important factors choosing a remote backup service is security. Imagine when you are trying to restore a system from a backup, but there is no backup – the backup files were deleted by a hacker.

This may happen with anyone and you can never be sure your data is 100% safe. Well you can if you disconnect the server or device holding your backup data (we do not review physical aspects here) and it can’t be accessed remotely.

Over 80% of online backup services provide you a backup space were you can upload your data using FTP, rsync, SCP or any other method. You are initiating the connection with a specific software or a script. Now when your server or workstation is compromised a hacker can access the programs or scripts that uploads data to a remote backup service, login there and delete your data.

The best way would be for you to use a backup service company that initiates a data transfer from their remote backup servers (using scp scripts or RSYNC over SSH) – your server doesn’t have a direct access to backup data directory. So when your server is compromissed (hopefully it never happens) no data can be deleted from a backup service because unauthorized person can’t access the remote system.

Linux or Windows platform for hosting

August 10, 2008

Sorry folks, I had finally some time to edit this original junk article and I have came up with a much better version now.

Linux or Windows platform for web hosting? This question is asked many times and let me show you what OS works the best for you.

Linux is free and you should not pay yearly renewal or update fees (a good choice is Centos, Debian, Fedora and others). Suse Enterprise (SLES) and Redhat Enterprise does have licensing costs and/or update subscriptions that cost recurring fees. If you go Windows route you will need to pay for OS and the fees are quite high for web servers. While you can download a lot of free software for Linux, Windows applications tend to cost something.

Many folks prefer to use Linux, Apache, MySQL and PHP (LAMP), indeed, you can run Apache MySQL and PHP on Windows OS as well. Developing PHP applications using MySQL as a database is quick and easy and it doesn’t cost a dime. Of course if you need to run ASP or use MS SQL as a database server you will need to go with Windows OS for your server hardware.

My suggestion is to always use Linux for hosting, unless you need to run Windows specific applications – ASP code, MS SQL as a database back end and other Windows specific software.

Don’t forget that you will need to manage the server and keep up with security patches etc – some people prefer Windows as it’s more user-friendly and easier to update, however it comes with a price.

The Physical Location Of Your Dedicated Server Does Matter! Don’t Make A Mistake!

June 2, 2008

One of the most ignored factors when picking out a dedicated server is the physical location of the server versus the location of your websites visitors. By not choosing a location near the people you are wishing to target you can hurt your sales and popularity of your website. First let’s talk about why the physical location is still a factor and especially important for online e-commerce.

The Internet has gotten a lot faster but it is still limited by the data lines running around the world. A person in Texas requesting a site hosted in Japan is being send data from around the world and thus the page will load slower. As you get closer this is not as noticeable but a page hosted in Texas will still load faster for Texas residents as opposed to those in California. So why is this important? You could be loosing sales and prospective customers if your pages are not loading fast enough.

I live in the United Kingdom and I see this situation every day at work. I work for UK2 and we offer dedicated servers in both the USA and United Kingdom. We get calls from customers who are seeing low conversions on ecommerce store landing pages or showing us complaints from their visitors about slow load time. The problem is they are hosting a store for UK residents in the USA, or a site for US visitors in the UK. The time it is taking data to go back and forth is adding to a slightly delay which can have an effect. One of the many ranking factors for PPC at Google Adwords is the speed your landing page is served. This is why it is key to host your site near the geographic region you are targeting.

So what is the fix? Just keep in mind who your perspective customers are when choosing a location for your dedicated server. If you are targeting the entire United States a location in Chicago or Texas should work great. If you are targeting residents in the UK get a server there. The physical location of a server is still important so please keep it in mind!

Published by BEN (non-staff member)

SUSE Linux Enterprise and OpenSUSE fully supported

April 13, 2008

As of April 2nd, 2008 we are fully supporting SUSE Linux Enterprise and OpenSUSE platforms, including remote server administration, OS tuning, network stack tuning, patching and full maintenance services.

Increasing WP-Cache performance for blogs with heavy commenting

December 29, 2007

Caching is the key to success – the more content you cache, the more visitors on the same hardware you can serve. Many WordPress owners run wp-cache plugin to cache blog pages in files, rather than generating content on the fly – querying MySQL database. If you have a low usage that is fine, but if you have a medium load blog or getting Dugg/Slashdot effect – only tuning, optimization and proper caching will keep your blog up and running.

wp-cache will need to regenerate cache file every time a blog post receives a comment – performance is lost if the post receives heavy commenting. You can hack wp-cache plugin to expire cache for particular page only when cache expire time expires, not with every new comment.

Open the WP plugin directory – wp-cache plugin file: wp-cache-phase2.php

and comment out line:

add_action(‘comment_post’, ‘wp_cache_get_postid_from_comment’, 0);

// add_action(‘comment_post’, ‘wp_cache_get_postid_from_comment’, 0);

And you are set.

Local port range sysctl tuning for high bandwidth Linux servers

September 23, 2007

Most of the Linux distributions specify local port range from 16384 to 65536 and this may be too low for very high bandwidth and busy boxes, let’s say SMTP, Hosting, POP3/Imap and Proxy servers.

You can adjust this setting by editing /etc/sysctl.conf file and replacing the default:

net.ipv4.ip_local_port_range = 16384 65536

with

net.ipv4.ip_local_port_range = 1024 65536