24 July 2013

How To: Set Up Apache Virtual Hosts on Ubuntu 12.04

Virtual Hosts are used to run more than one domain on a single IP address. This is especially useful to people who need to run several sites on one virtual private server.

1. Create a New Directory where we will keep the new website’s information


sudo mkdir -p /var/www/example.com/public_html

04 July 2013

How To: Recover a MySQL root password

Stop the MySQL server process
# /etc/init.d/mysql stop 

Start again with no grant tables
# mysqld_safe --skip-grant-tables &

Login to MySQL as root.
# mysql -u root
mysql> use mysql;

Set new password
mysql> update user set password=PASSWORD("newrootpassword") where User='root';
mysql> flush privileges;

Exit MySQL and restart MySQL server
mysql> quit
# /etc/init.d/mysql stop
# /etc/init.d/mysql start

Other useful commands: