There are probably a million tutorials out there to do this, but as I’m doing it for the second time, I figure that I should probably write it down.
First thing’s first, make sure you’re all updated:
1 |
sudo apt-get update |
Then install lamp
1 |
sudo apt-get install lamp-server^ |
and run through the install process. Make sure you write all of that info down.
Then download wordpress. Assuming they still have their download architecture the same as the time I’m writing this, you can just use this command.
1 |
wget http://www.wordpress.org/latest.tar.gz |
And unzip this file.
1 |
tar -xzvf latest.tar.gz |
You should see a LOT of stuff unzipping.
Then remove the tarball
1 |
rm latest.tar.gz |
Now you need to create a database.
1 2 3 4 5 6 7 |
mysql -u WHATEVER YOUR USERNAME IS -p YOUR PASSWORD mysql> CREATE DATABASE wordpress; mysql> GRANT ALL PRIVILEGES ON wordpress_risp.* to "AUSERNAME"@"localhost" #hit enter and make a new line -> IDENTIFIED BY "password"; FLUSH PRIVILEGES; EXIT |
Write down this information.
Next move your wordpress folder to where it’s going to be seen by the web, in my case /opt/bitnami/wordpress/risp
1 |
mv wordpress /opt/bitnami/wordpress/risp |
rename the file “wp-config-sample.php” to “wp-config.php”
1 |
mv wp-config-sample.php wp-config.php |
edit it using your favorite text editor, in my case vim
1 |
vi wp-config.php |
Follow the instructions in the document to add your MySQL DB stuff that you established earlier.
At this point you’re pretty much done. Navigate you localhost/wp-admin/install.php in your favorite browser to set it all up.
To be able to upload images, you will need to run the following command:
1 |
sudo chown -R 755 www-data:www-data /var/www |
To be able to use custom permalinks within wordpress, we’ll need to make a couple modifications. The first is modify the apahce2 virtual host settings with:
1 |
sudo nano /etc/apache2/sites-enabled/000-default |
Change the /opt/bitnami/wordpress/ settings so AllowOverride None is set to all like so:
We will also need to give the proper permissions of apache to the .htaccess (found in the root directory of your wordpress install, mine is /opt/bitnami/wordpress/) file by running the following commands:
1 2 |
sudo chown -v :www-data /opt/bitnami/wordpress/.htaccess sudo chown -v 664 /opt/bitnami/wordpress/.htaccess |
Note: If the file does not exist, you can create it with:
1 |
sudo nano /opt/bitnami/wordpress/.htaccess |