Digital Linx Hosting
VPS, Hybrid, Reseller, Dedicated Hosting
4th
FEB
Installing Wordpress in Debian from scratch
Posted by admin under Debian VPS, Tutorials, VPS
After you have rebuilt your VPS node with one of our Debian OS templates, login via SSH using a ssh client such as putty.
Our Debian templates are quite minimal and very little is currently running, in order to run wordpress we would need to install some applications and services such as; apache, php, mysql and ftp server (optional)
Installing packages with Debian is easy issue the following command to install the above applications and services;
apt-get install apache2 mysql-server-5.0 php5 php5-mysql php5-mcrypt php5-mhash proftpd unzip zip
When prompted press “y” then enter to install everything including their dependencies. A blue window should show in your SSH terminal asking if you wish to run proftpd as a standalone server or initd service, choose standalone.
After the installation is finished your VPS should be running apache, mysql and proftpd.
Now it’s time to configure everything so you can install wordpress.
First lets create an unprivileged user where we will store all website data.
adduser blog
When prompted enter a secure, nonreusable password.
Now lets setup a mysql passwords issue;
mysql
Inside your mysql prompt enter these commads;
use mysql
update user set password=PASSWORD("YOUR_SECURE_NONREUSABLE_PASSWORD") where User='root';
flush privileges;
quit
Now lets test our new mysql root password, issue
mysql -p
When prompted enter the password you just set.
Now lets create a new database and a unprivileged mysql user for our blog to use, inside your mysql prompt enter these commands;
create database wordpress;
grant all privileges on wordpress.* to 'blog'@'localhost' identified by 'YOUR_SECURE_NONREUSABLE_PASSWORD' with grant option;
flush privileges;
quit
OK, now we took care of the mysql stuff, lets move on to apache. In order to not expand the scope of this tutorial I will assume that you have a domain/host pointed at your VPS’s dedicated IP. I will use blog.com as an example in this tutorial.
Issue the following command to create a new apache name based vhost;
nano /etc/apache2/sites-enabled/blog.com.conf
And paste the following content (replace blog.com with your domain, use your right click mouse button to paste text in nano);
NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@blog.com
ServerName blog.com
ServerAlias www.blog.com
DocumentRoot /home/blog/www/
ErrorLog /home/blog/logs/error.log
CustomLog /home/blog/logs/access.log combined
</VirtualHost>
Now lets create those specific directories in blog’s home directory;
su blog
mkdir logs
mkdir www
exit
Now lets restart apache so it will load our custom configuration;
/etc/init.d/apache2 restart
Now we have everything we need to install wordpress;
su blog
cd /home/blog/www
wget wordpress.org/latest.zip
unzip latest.zip
mv wordpress/* .
rm -rf wordpress latest.zip
chmod 777 .
Now point your browser at http://blog.com and begin the easy to follow wordpress installation

The database name we created above was named “wordpress” and the database username was named “blog” with password “YOUR_SECURE_NONREUSABLE_PASSWORD”, leave the values of Database Host and Table prefix as they are (unless you know what you’re doing). Insert those values accordingly and click Submit.
That’s it, your wordpress blog is installed and you can enjoy all the features wordpress can provide.
After you have finished the wordpress configuration wizard (set blog name, email etc) you’d need to clean up a bit, return to your SSH seasion and issue these commands;
exit # so you would be logged in as root
cd /home/blog/www
chmod 755 .
chown blog:blog wp-config.php
chmod 644 wp-config.php
And you’re done, you may also use your username blog to login via ftp to manage your files.
Of course this setup isn’t limited to wordpress only, you may also install any mysql driven web application in a sub directory inside /home/blog/www/
This is a minimal and secure way to host your websites, you may add as many websites as you want repeating these steps
- Create a new system user by issuing adduser username command
- Create a new vhost configuration file in /etc/apache2/sites-enabled/ by issuing nano /etc/apache2/sites-enabled/sitename.com.conf following the template above
- Restarting apache by issuing /etc/init.d/apache2 restart
- Creating a new mysql database and username using the mysql commands provided above
This is a rather copy/paste tutorial, provided that you edit significant parts like domain name, usernames and passwords.
Reader's Comments
Post Meta
-
February 4, 2009 -
Debian VPS, Tutorials, VPS -
3 Comments
-
Comments Feed
Buy:Levitra.Super Active ED Pack.Cialis Professional.Cialis Soft Tabs.Soma.Viagra Soft Tabs.Tramadol.Cialis Super Active+.Propecia.Viagra Super Active+.Viagra Super Force.VPXL.Viagra Professional.Cialis.Zithromax.Viagra.Maxaman….
Buy:Cozaar.Benicar.Seroquel.Lipothin.Female Cialis.Zetia.Ventolin.Aricept.Prozac.Advair.Buspar.Lasix.Wellbutrin SR.Female Pink Viagra.SleepWell.Acomplia.Amoxicillin.Nymphomax.Zocor.Lipitor….
Buy:Super Active ED Pack.Cialis Soft Tabs.Zithromax.Maxaman.Tramadol.Cialis Professional.Cialis Super Active+.VPXL.Soma.Propecia.Viagra Professional.Cialis.Viagra Soft Tabs.Viagra Super Active+.Viagra Super Force.Viagra.Levitra….