Love The Way I Work

WordPress on Debian Linux

in Blogging/Debian/Linux/Tutorial/Wordpress by

This tutorial is how to install WordPress on Debian Linux. Installing WordPress on Debian? What for? Are there many easy ways to install WordPress on our server (Web hosting)? Eventually, We don’t need to know what distro that our server use or what operating system is. You right.

I have a “special” condition here. I need to install WordPress on my own Debian server for testing purpose. If You like me, play around with WordPress as a developer (perhaps you create your own theme or plugin), you should have your own server in your local PC on LAN.

You can use your own server to test your own WordPress theme or plugin before you release it. You can upload and test your theme or plugin directly on your remote server of course, but if you have a little problem with Internet connection (just like me), it is so hard way 😀

These are my little steps to built my WordPress theme or plugin:

  1. Built on my local PC
  2. Upload to my local server
  3. Testing my work and make sure works propertly
  4. Upload to my remote server
  5. Testing again in the “real” condition
  6. Make sure I have no problem with my work
  7. Sharing my work

Let’s start to install WorPress on Debian

Installing http server on Debian

You can see my tutorial how to install http server on Debian, Installing HTTP Server on Debian.

Installing MySQL Database

You can see my tutorial how to install MySQL Database Server on Debian.

Download WordPress

You can download WordPress from their official website.

Upload your WordPress archieve into your debian server

You can use any ftp tools to upload your WordPress archieve into your server.

Extract your WordPress archieve into your server directory

tar zxvf wordpress-x.x.x.tar.gz --directory=/var/www/

Using MySQL

Create a database for WordPress on your web server, as well as a MySQL user who has all privileges for accessing and modifying it.

mysql -u ''adminusername'' -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 6 to server
version: 4.0.24_Debian-10sarge1-log

Type 'help;' or 'h' for help. Type 'c' to clear the buffer.

mysql> CREATE DATABASE ''wordpress'';
Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON *.* TO 'wordpress'@'localhost' 
      -> IDENTIFIED BY 'wordpresspassword' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
  
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)

mysql> EXIT
Bye

In the above:

  • adminusername will typically be root, unless you have another high-privileged account set up.
  • wordpress or blog are good values for databasename.
  • wordpress is a good value for wordpressusername.
  • hostname will usually be localhost. If you don’t know what this value should be, check with your system administrator. If you are the system administrator, figure out what this value should be.
  • password should be a difficult-to-guess password, ideally containing a combination of upper- and lower-case letters, numbers, and symbols.

Write down the values you used for databasename, wordpressusername, hostname, and password.

Configure your WordPress setting

Rename the wp-config-sample.php file to wp-config.php. Open and edit wp-config.php file

// ** MySQL settings ** //
define('DB_NAME', 'wordpress');
define('DB_USER', 'wordpress');
define('DB_PASSWORD', 'wordpresspassword');
define('DB_HOST', 'localhost');

Run the Install Script

Using your favorite web browser, visit wp-admin/install.php within the directory into which you just installed WordPress on your web site. For example: point your browser to http://yourserver/wordpress/wp-admin/install.php.

Preview your WordPress

Point your browser to http://yourserver/wordpress.

Well done! You have your own WordPress on Your Debian Server.

😀 Gud lak

73 Comments

  1. I like you style of tutorial. I’m an absolute beginner when it comes to linux/debian/ubuntu so obviously I have some questions like:
    Will this tutorial word for a newer version of Ubuntu Server like 6.10?

    Also, pertaining to your tutorial, I am unsure of what I’m supposed to do when you use a quotation mark (‘ or “). Are we’re supposed to leave the string untouched, or does that indicate that we’re supposed to supply our own personal information? Then, are we to leave the quotes or remove them?

    For example, when I see:

    // ** MySQL settings ** //
    define(‘DB_NAME’, ‘wordpress’);
    define(‘DB_USER’, ‘wordpress’);
    define(‘DB_PASSWORD’, ‘wordpresspassword’);
    define(‘DB_HOST’, ‘localhost’);

    am I supposed to enter my personal information, for lets say, ‘localhost’? Should I leave the quotes?

  2. Great tutorial! But I got all the way to the end successfully, and then ran into a problem. When I tried to import my Movable Type posts from my old blog (the address above–I’m playing with WordPress on my local server before trying it for real on my hosting service), I got the following message.

    Unable to create directory /var/www/blog/wp-content/uploads/2007/01. Is its parent directory writable by the server?

    I am a complete newbie to Ubuntu (two days old), and although I was able to figure out how to use mysql from the command line, I don’t know where to start with this problem.

    Any pointers you can give me would be much appreciated.

    Thanks!

  3. Hi dave, welcome to Ubuntu 😉 You should change wp-content permission. For deployment you can try this command:

    cd /var/www/blog
    sudo chown -Rf www-data: wp-content

    or you can try this:
    cd /var/www/blog
    sudo chmod -Rf 777 wp-content

    Gud lak!

  4. When I try to upload images I get this error: Unable to create directory /var/www/blog/wp-content/uploads/2007/07. Is its parent directory writable by the server?

    How can I do? I know I should change wp-content permission, but how?

  5. // ** MySQL settings ** //
    define(’DB_NAME’, ‘wordpress’);
    define(’DB_USER’, ‘wordpress’);
    define(’DB_PASSWORD’, ‘wordpresspassword’);
    define(’DB_HOST’, ‘localhost’);

    localhost or your host ip or servername

  6. I’m trying to install WordPress on a remote server machine, but when I open a php file into my browser from the server, appears only the code. I’ve MySQL installed and runned, and I ran the creation database too. So, in every case, only the code appears on screen, for every php file. What’s wrong?

  7. I solved, php was installed but not activated in file configuration (I uncommented some strings).
    Thanks anyway.

  8. Thanks a lot, mate, too bad I found your tutorial after I spent 5+ hours trying to make LAMP work on my Hardy Heron… Finally I managed to get it rolling – and found your page while searching for a solution for the chmod thingie. Thanks a lot!

  9. ???????? 🙂 ? ???? ? ???? ????????? ???????????, ???? ? ?? ?? ???? ????? 😉 ?????? ?????????? ???? ????? ???????? ?????? ?????. ???????? ??????? ??????, ??? ??????.

    ??????? 🙂 ????? ???????

  10. […] wordpress on debian linux – this tutorial is how to install wordpress on debian linux. installing wordpress on debian? what for? are there many easy ways to install wordpress on our server (web hosting)? eventually, we don’t need to know what distro that our … […]

Leave a Reply

Your email address will not be published.

*

Latest from Blogging

Placeholder

Web Hosting

Web hosting is one type of Internet Hosting service which makes the
Go to Top