How To: Install WordPress on Ubuntu server
1. Install minimal Ubuntu server:
This assumes you have already created a basic Ubuntu server in which to install WordPress.
2. Ensure that the server is up to date. You can update the Ubuntu server by connecting through console and typing:
sudo apt-get update
to refresh the packages. You may need to run one or both of the following commands to begin the update/upgrade:
sudo apt-get upgrade
3. install ssh: This will make it much easier to configure remotely using an application such as Putty or any other such utility.
sudo apt-get install openssh-server
4. Install LAMP packages (Linux, Apache, MySQL, PHP)
sudo apt-get install lamp-server^
Choose a password when prompted.
Test to see if the webserver is working by going to the ip address of the server in a browser. You should see “it works!” text
5. Now you are ready to Install WordPress:
**See below for alternate method using file transfers**
From terminal or console type:
c. once that completes type:
sudo tar -xzvf latest.tar.gz
6. Setting up MySQL:
**See below for alternate method using phpMyAdmin**
Login to MySql from console:
mysql -u root -p
(enter password when prompted)
CREATE DATABASE wordpress;
CREATE USER wordpressuser@localhost;
SET PASSWORD FOR wordpressuser@localhost= PASSWORD("password");
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password';
7. Rename and edit wp-config file
a. cd wordpress
c. Rename wp-config-sample.php: sudo mv wp-config-sample.php wp-config.php
d. Edit the file by typing: sudo vi wp-config.php
e. Press “i” to insert text
f. Edit the setting to fit the previous SQL user and Database
g. Press “esc” and type :wq
8. Copy/Move WordPress to the www folder (literal version)
a. cd ..
b. sudo mv wordpress /var/www/
c. cd ..
d. cd ..
e. cd var
f. cd www
h. sudo mv wordpress “your folder name”
9. Setting Up WordPress site
a. In a browser type http://yourIP/foldername/wp-admin/install.php
b. Fill in the fields.
10. You should now have a working WordPress site.
::APPENDIX. some other custom moving of folders
1. Set file permissions
a. Issue a command to grant Apache ownership of the www folder (or a subfolder):
sudo chown -R www-data: /var/www/foldername/
b. Make sure the group is www-data on ‘/var/www:
sudo chgrp www-data /var/www
c. Add users to the group www-data:
sudo usermod -a -G www-data "user"
d. Make ‘/var/www’ writable for the group:
sudo chmod 775 /var/www
e. Set the GID for www-data for all sub-folders:
sudo chmod -R g+s /var/www
f. Your www directory and/or subfolder should look like “drwxrwsr-x” on an ‘ls -l’ output.
You should now be able to SFTP to your server as your user name and upload to ‘/var/www’ with no problems.
4a. Sometimes I then use a combination of putty (ssh) and WinSCP to upload phpmyadmin to the root directory as well as upload site data. From there I use PHPMyAdmin to create database users and databases via GUI.