WordPress on Debian 7

NOTE: You must have the LAMP stack installed before installing WordPress.

Create the WordPress database, user, and password

mysql -u root -p


Now, create the database and user for your WordPress installation. You can replace WPdatabase, WPuser, and WPpassword with your own database name, username, and password in the following commands:

CREATE DATABASE wordpressdb;

 

CREATE USER [email protected] IDENTIFIED BY 'WPpassword';

 

GRANT ALL PRIVILEGES ON WPdatabase.* TO [email protected];


Now, flush the privileges and restart the service:

FLUSH PRIVILEGES;

 

exit



Download WordPress

wget http://wordpress.org/latest.tar.gz


Now, extract the compressed file to your home directory:

tar -xzvf latest.tar.gz



Configure WordPress

Begin by copying the sample config file into a new file:

cp ~/wordpress/wp-config-sample.php ~/wordpress/wp-config.php


Now open the file in Nano so that it can be edited:

sudo nano ~/wordpress/wp-config.php


Once you have the wp-config.php file open in Nano, go through it and replace wpdatabase, wpuser and dbpassword with the database name, username and password you created in the first step. Then save your changes and exit Nano.


Move WordPress to the web root and set permissions

Now that WordPress is configured, you will need to move the contents of the WordPress directory to your website's web root directory:

sudo rsync -cvP ~/wordpress/ /var/www/


You will need to change to the web root directory now:

cd /var/www/


Now you must grant ownership of the directory to the Apache user (www-data):

sudo chown www-data:www-data /var/www/* -R


Add the username you created in the first step of this guide to the group. Replace WPuser in the following with the username you created:

sudo usermod -a -G www-data WPuser




Finally, install a necessary module, php-gd:

sudo apt-get install php5-gd




Now complete the WordPress setup now located at http://yourdomain.com/wp-admin/install.php, where 'yourdomain.com' is replaced with your actual domain.

  • 12 Users Found This Useful
Was this answer helpful?

Related Articles

IP rDNS/PTR records

You can configure PTR or Reverse DNS records via the VPS Control Panel under rDNS. The record...

Serial Console

You may wish to use the Serial Console if the SSH console becomes inaccessible. The Serial...

LAMP on CentOS 6

Install Apache Web sudo yum install httpd Edit Apache's httpd.confThe httpd.conf...

LAMP on Debian 7

Install Apache Web sudo apt-get install apache2 Edit Apache's httpd.confThe...

LAMP on Ubuntu 14.04

Install Apache sudo apt-get update sudo apt-get install apache2 Install MySQL...