Unix – Setup HTTPS virtual hosts


SSL is an essential part of creating a secure Apache site. SSL certificates allow you encrypt all the traffic sent to and from your Apache web site to prevent others from viewing all of the traffic. It uses public key cryptography to establish a secure connection. This means that anything encrypted with a public key (the SSL certificate) can only be decrypted with the private key (stored only on the server) and vice versa.

Continue reading

CentOS – Install Nginx And PHP-FPM using yum


In this article, I’m going to show you how to install Nginx with PHP-FPM via yum on CentOS (actually, steps are similar on another operating sytems). Before starting to install Nginx and PHP-FPM, you must uninstall all previous Apache and PHP related RPMs installed on your system or you’ll have to disable Apache or httpd on your system. Login as root and type the following command

Continue reading

Unix – Worst way to disable annoyance from auto execute or startup program


Is there any programs that you don’t want it to be triggered by any reason ? if so, this article will show you how to deal with it.
There’re many ways and tools that help you to disable programs from startup or auto triggered by other applications in Windows enviroment, and they’re efficient!
Using Unix-based systems, you have less choices to do such thing, and sometime you find it hard and confusing. And, if you hate some annoying programs like me, there’s a dirty method that will free you from annoyance :). All you have to do is to remove execute permission for bin file.
Open your termial and execute the following command :

chmod -x /path/to/file

may be you’ll need to use sudo because some programs require root permissions

Magento – Fix integrity constraint violation issue


Sometimes, you face database issues like this ‘integrity constraint violation: 1062 Duplicate entry ‘100000001’ for key’ . if you are not familiar with Magento, may be you will feel blind (like i was), debugging won’t go smoothly as usual.

After studying Magento deeper to its core, i found that Magento numbering system depends on a table called ‘eav_entity_store’. this table stores increment ids of many entities from Magento.

Continue reading

WordPress – reset your admin password using Command line (quick way)

Sometimes, you lose your credential to your wordpress admin dashboard, i guess many of you had this question in mind : what is the quickest way to reset my admin password ?


In WordPress, there is more than one way to set your password. In normal circumstances, you can do it through the WordPress interface. If you forget your password, WordPress has a built in recovery mechanism that uses email.

But on some hosts, especially when email isn’t working right, sometimes you have to take different steps to reset your password. in this article, i’ll show you how to reset you admin password using command line:

1. log in to MySQL

mysql -u root -p

Continue reading

Amazon EC2 common problems – there’s no swap space

Ubuntu EC2 EBS images don’t come with swap space configured (for 11.04 at least). The “regular” instance-type images do have a swap partition, though only 896 MB.


If some process blows up and you don’t have enough memory or a swap space, your server could come to a crawling halt for a good while before the OOM (out of memory) killer kicks in, whereas with swap, it merely gets slow. For that reason, I always like to have swap space around, even with enough RAM.

Continue reading

Password protection for you domain using .htaccess

What You Need
You will be executing commands directly on the web server, and the only way to do that is via SSH. SSH is basically a secure form of telnet, and you can use SSH to do anything you might typically do with telnet. So, you must have a SSH client to connect to the web server via SSH.

You will also need a FTP client if you want to create your .htaccess file on your own system, then upload it to the web server.

The only other thing you need is a web hosting account from Anchor. This would simply be your FTP account information that you received when your service started. To connect via SSH you would just use the same hostname, username, and password as your FTP account Continue reading

How to Protect the wordpress wp-config.php File

The wp-config.php file contains very sensitive information about your WordPress installation, including your database access, table prefix and Secret Keys.

The wp-config.php file is a standard part of your WordPress installation. It defines the configuration settings required to access your MySQL database. If your self-hosting WordPress, there’s no way of getting around not using it.

It’s your job to protect it! You certainly don’t want this file falling into the wrong hands in the event of a server problem. You can protect it by encrypting it’s content when you upload and denying access to it.
Continue reading

Auto update script for pathogen bundles

#vim auto update bundle script
 #author : Atheotsky

#locate self location & move to it
 cd `dirname $0`

#update function
 cd "$1"
 echo "updating $1 ......"
 git pull
 cd ..

#build array of folder under current location
 directories=$(ls -l | egrep '^d' | awk '{print $9}')

#use loop with array
 for directory in $directories; do
 #execute function
 updatePlugins $directory

echo "Update completed!"