May 252011
 

WordPress is so far the blog software that I liked most. Tried few others, but this one beats them with easiness and intuitive work. Supports tons of good stuff and is very often updated by the developers team.

I assume you already have latest Apache and MySQL installed. If you don’t, please get the latest packages from Slackware and install them:

su
cd /root
mkdir /temp
cd temp
wget ftp://ftp.slackware.com/pub/slackware/slackware-current/slackware/n/httpd-2.2.17-i486-3.txz
wget ftp://ftp.slackware.com/pub/slackware/slackware-current/slackware/ap/mysql-5.1.56-i486-1.txz
installpkg httpd-2.2.17-i486-3.txz
installpkg mysql-5.1.56-i486-1.txz
cd /etc/rc.d/
chmod +x rc.httpd
chmod +x rc.myslqd
cd ../httpd
echo "Include /etc/httpd/mod_php.conf" >> httpd.conf
sed 's/index.html/index.php/' httpd.conf > httpd.conf.new
mv httpd.conf httpd.conf.old
mv httpd.conf.new httpd.conf 

cd ../rc.d/
./rc.httpd start
./rc.mysqld start
sudo -u mysql mysql_install_db
./rc.mysqld restart

(Edit 01 march 2012) You may also need to edit httpd.conf and enable the php application manually by typing this in the end of file:

AddType application/x-httpd-php .php

(Missed it, and added it thanks to gr1ph for posting it in LinuxQuestions forum).

There, you are set with a web server and a database server. If you are using an old Slackware, I suggest full update to -current. First of all, latest Apache has all the security quirks and perks for a lazy Administrator like me and mod-PHP built-in which can be enabled with 1 command in total. And second – What I’ve learned in the last 10 years of system administration is “Don’t be a victim to exploits of old and obsolete software packages, when you are running your own servers”. The script kiddies never sleep. My own server is scanned for open exploits 10 to 15 times each day.

There was once a bug, that created the directories in /var/lib/mysql with owner root:root. Please check if this is so and make them to mysql:mysql. No databases will be created if you leave them this way and even your root account will not be able to use the mysql. (you may want to have a look at this guide too)

chown -R mysql:mysql /var/lib/mysql

If you know or can do alone all of the above – The WordPress itself in few steps.

su
cd /root/temp
wget http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
cp -R wordpress /srv/httpd/htdocs/

mysql -u root -p
CREATE DATABASE wpbase;
GRANT ALL PRIVILEGES ON wpbase.* TO "wordpressuser"@"localhost"
 IDENTIFIED BY "0neExtremelyCompl3xPassword";
FLUSH PRIVILEGES;
exit

cd /srv/httpd/htdocs/wordpress
mv wp-config-sample.php wp-config.php
mcedit wp-config.php

What we need in this config file? Imagine you did everything I suggested above, the file should look like this:

define('DB_NAME', 'wpbase');
define('DB_USER', 'wordpressuser');
define('DB_PASSWORD', '0neExtremelyCompl3xPassword');
define('DB_HOST', 'localhost');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');

… but of course, I suggest you don’t use the user and password from this howto :) at least I did not.


So, that’s it. Everything in the backend is set and working.

The only thing left is to set WordPress from its wp-admin panel. Start a browser and go to this address http://127.0.0.1/wordpress/wp-admin/install.php
Set the title of your new blog and setup an user and password for login (not necessarily the same as the ones we used above, this will be your web-admin user). When you are done, check http://127.0.0.1/wordpress/index.php your new blog is there.

Login and set various settings as your site name, your design template and so on.

If this whole article is a bit hard and look like gibberish in japanese – try installing it in Windows. It’s not “that hard”.

 Posted by at 4:54 pm

  10 Responses to “How to install WordPress in Slackware Linux”

  1. tar -xzvf word*.tar.gz should be tar -zxf latest.tar.gz
    because of how wget works

    • Joe, both will work with downloaded tarball. Only the last option should always be -f.

      I prefer adding -v to see more output.

      But I see what I missed here :)

      Archive is named latest.tar.gz. Not wordpress.tar.gz.

      Fixing it.

  2. […] I've been following this person's guide to setting up WordPress in Slackware. m0rd0r's guide: http://www.m0rd0r.eu/?p=419 I've started with the default Apache and MySQL that comes with Slackware 13.1. I decided to try […]

  3. This tutorial was missing one thing for me. I had to manually include the line “AddType application/x-httpd-php .php” (without quotes) to the appropriate section of the httpd.conf file in order to get php to function.

    Great info regardless :)

    • Don’t mention it. I followed the forum thread where you posted the question and saw what I missed.

      I will add the missing line in a minute.

      (probably this is fixed in Slackware 13.37, So I suggest you upgradepkg to latest)

  4. Hello. Thanks for the great information here. I installed wordpress on my system using Vector Linux, which is very similar to Slackware. It is working, but I am having problems with the email delivery. For instance, if a user registers, or a user wishes to find out his/her password, he/she will fill in the required information in the log-in window, and be told “Check your e-mail for the confirmation link.” But the email on my system is not sent.

    So, I’m wondering how you have set this up on your system.

    • By default I had sendmail installed in localhost and WordPress used it, so I’ve never installed or configured anything more.

      Have a look if you have sendmail and if you have enabled it. By default it listens to port 25 TCP.

      Use the command “netstat -tupan” in Linux and have a look if the sendmail daemon is listening there. Then have a look if your firewall is not blocking it locally and to outside (“nmap -sS 127.0.0.1 -P0″ for localhost, and same for your real IP address).

      You may need to do search for a good safe sendmail setup.

      GL and HTH.

  5. Hi there. I followed this tutorial on my slackware 13.37. I needed to edit httpd.conf adding index.html in in this line

    DirectoryIndex index.php index.html

    in order to get wordpress working.

    hope it helps

    • index.html is your default page with text “It works!” distributed with Apache package. You actually better delete this file after you install wordpress. It’s harmless but still – not a good idea to keep it.

      You need to change it to index.php in your httpd.conf, so the .php file from the WordPress installation is shown instead of the default .html file.

      After you change it – restart the httpd daemon, so it re-reads the configuration.

      It is explained in the beginning of this article.

      HTH

  6. thanks for the explanation!

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>