• Setup WordPress on Debian 6 Squeeze using Lighttpd and MySQL (LLMP) – Part 2

    Posted on February 11, 2012 by Kyle in Uncategorized.

    Welcome to part 2 of the LLMP setup guide.  This guide assumes you completed the steps of the part 1 section. We last left off ready to install WordPress into our newly created directly.

    We are going to navigate to the directory of our domain name. Make sure to change the code below to be your domain and not the example.com domain:

    cd /var/www/www.example.com/public_html/

    Next, lets go ahead and remove and the index file we used to confirm the vhost file was setup properly:

    rm index.php

    Next, let’s use wget to download the latest version of WordPress

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

    That tar gz file is a zip file for linux.  We will extract it in the public_html folder:

    tar -zvxf latest.tar.gz

    You may have noticed during the extraction process it created a new folder called WordPress and put everythig in it.  This isn’t ideal, so we are going to move all files back a level, to the root public_html folder:

    cd wordpress/
    mv * ../
    rm wordpress -rf

    Now we need to login to MySQL and create a new DB for WordPress to use and a new user for WordPress to connect through.  To do this, I used SequalPro (if you are on a windows machine, there are lots of MySQL connection managers, pick your favorite and get connected) to connect and then logged in with the root username and password.

    Create a new DB (potentially your domain name-wp) and then create a new user and assign them full rights on the wp database only. Record the username and password for use on the WP site.

    Now that we have a DB, let’s navigate to the domain name of your new site. You should notice there is a wordpress page like this one:

    This will help you create our WordPress configuration page. Enter in the values in the guide and then copy the contents of the config file to your clipboard.  We are going to be opening the wp-config.php file and pasting it in. Back in your ssh session, confirm you are still in the public_html folder for your domain.  Then run the following to open the config file:

    nano wp-config.php

    Paste the contents of the clipboard into this file and then save and exit (control O and control X).

    If you reload the website you should now see:

    This gets you setup with your WordPress site allowing you to customize and create from here!

    All that’s left is installing the firewall on the server and then using the WordPress site.  Click on over to Part 3 to see how to install the firewall on your LLMP server.

     

    Post Tagged with , , , , , , , , , ,

9 Responsesso far.

  1. Nick says:

    Thank for this awesome Guide! Is there not a part 3 though?

    Thanks,

    Nick

  2. Chris says:

    As a noob to the pi, this tutorial was awesome, great work, I would love to see a firewall part 3! Is there a management interface that can be a wordpress add-on?!

    • Kyle says:

      Thanks for the comment! I may try to get to the firewall soon, I have it on my server here but didn’t spend the time to write down all the steps.

      • Chris says:

        Kyle,

        thank for the response. Just finished the setup and everything works until I get to trying to enable a custom permalink structure on the wordpress install… I would like to leave index.php off of everything, but wordpress stated the my .htaccess file is not writeable… I ahve tried to come up with an aswer using google to no avail, could you shed some light on what I could do to possible fix this?

        Thank you,
        P.S. i would like to see me blog as domain.com/YYYY/MM/DD/TitleOfBlog

        • Chris says:

          Found it! so after a couple hours of hitting google with a bunch of queries, here is what i found to get “pretty URL’s to work. The reason they dont work is wordpress was really built on Apache and the .htaccess file to get the URL’s to be SEO friendly. I pasted the following at the end of mt /etc/lighttpd/lighttpd.conf file and was able to get pretty permalinks to work:

          url.rewrite = (
          #Exclude some directories from rewriting
          "^/(wp-admin|wp-includes|wp-content|gallery2)/(.*)" => "$0",
          #Exclude Files at the root from rewriting
          "^/(.*)\.(.+)$" => "$0",
          #Handle Permalinks and Feeds
          "^/(.+)/?$" => "/index.php/$1"
          )

          So because lightTPD does not make use of a .htaccess file like apache does, this needs to be defined in the lighttpd.conf file at the very bottom.

  3. Don Porter says:

    Glad I came across this article! I’ve been fighting WordPress installs on my Pi (w/ Lighttpd)for a solid week now. I keep chasing the wrong rabbit every time a tutorial is flawed for some reason, which is often, and search out a new one. I am very close, but I get an “Unable to establish a database connection”. My brain is fried for the night since it has been a long day but, first thing in the morning I’ll be reading and studying everything presented/discussed here closely. Suggestions where to direct my focus first will be appreciated!

Leave a Reply

Your email address will not be published. Required fields are marked *