WordPress/Installation
Line 44: | Line 44: | ||
~$ chown www-data:www-data /var/www/yoursite.com/ | ~$ chown www-data:www-data /var/www/yoursite.com/ | ||
export the downloaded tar to the site directory | export the downloaded tar to the site directory | ||
− | ~$ tar -C /var/www/yoursite.com/ -zxf | + | ~$ tar -C /var/www/yoursite.com/ -zxf wordpress4.0.tar.gz |
+ | this will create a directory called wordpress. If you dont want this and prefer the wordpress files to live in the parent directory, i'd instead do it this way | ||
+ | ~$ tar -C /home/admin/ -zxf wordpress4.0.tar.gz | ||
+ | ~$ sudo cp -r /home/admin/wordpress/* /var/www/yoursite.com/ |
Revision as of 15:48, 4 October 2014
Installation done on a VM running Ubuntu 14.04LTS
Download required packages
On a LAMP setup make sure to download the standard packages
~$ sudo apt-get update && sudo apt-get install -y apache2 mysql-server php5-mysql php5 libapache2-mod-php5 php5-mcrypt
If you already have LAMP installed, all WordPress needs is
~$ sudo apt-get update && sudo apt-get install -y php5-gd libssh2-php
Configure MySQL
login to db
~$ mysql -u root -p
Create mysql wordpress user
~$ mysql> CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'THISpasswordSHOULDbeCHANGED'; ~$ mysql> exit
login as new user to verify account works
~$ mysql -u wordpress -p ~$ mysql> exit
create DB
~$ mysql -u root -p ~$ mysql> CREATE DATABASE wordpress;
verify DB creation
~$ mysql> SHOW DATABASES;
assign rights to wiki user for new database created
~$ mysql> GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost' IDENTIFIED BY 'phpBBuserpassword' WITH GRANT OPTION; ~$ mysql> exit
verify permissions have been granted
~$ mysql -u wordpress -p ~$ mysql> SHOW GRANTS; +------------------------------------------------------------------------------------------------------------------+ | Grants for wordpress@localhost | +------------------------------------------------------------------------------------------------------------------+ | GRANT USAGE ON *.* TO 'wordpress'@'localhost' IDENTIFIED BY PASSWORD '*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' | | GRANT ALL PRIVILEGES ON `wordpress`.* TO 'wordpress'@'localhost' WITH GRANT OPTION | +------------------------------------------------------------------------------------------------------------------+ 2 rows in set (0.00 sec)
Download Wordpress
download the latest version from their latest version URL
~$ wget http://wordpress.org/latest.tar.gz
probably would be a good idea to rename the tarball as it's not very descriptive
~$ $ mv ./latest.tar.gz ./wordpress4.0.tar.gz
As of 10/4/2014 There are no MD5 or GPG verification methods to make sure the copy you've downloaded hasn't been tampered with. Maybe one day the devs of WordPress can join the rest of the Dev community and start taking security seriously.
create your site's directory where wordpress will live. If you're using a subsite design make sure to create the directories in the same path structure.
~$ mkdir /var/www/yoursite.com/
make sure your apache user has appropriate permissions to write to this directory
~$ chown www-data:www-data /var/www/yoursite.com/
export the downloaded tar to the site directory
~$ tar -C /var/www/yoursite.com/ -zxf wordpress4.0.tar.gz
this will create a directory called wordpress. If you dont want this and prefer the wordpress files to live in the parent directory, i'd instead do it this way
~$ tar -C /home/admin/ -zxf wordpress4.0.tar.gz ~$ sudo cp -r /home/admin/wordpress/* /var/www/yoursite.com/