WordPress is a powerful, free and open-source, highly pluggable and customizable CMS that is being used by millions around the world to run blogs and fully functional websites. WordPress has seen incredible adoption and is a great choice for getting a website up and running quickly. After setup, almost all administration can be done through the web frontend.
Install WordPress on Ubuntu
1) Open a terminal window and issue the following commands to Install the entire LAMP stack:
# apt-get update && apt-get upgrade
# apt-get install lamp-server^
2) Install the necessary PHP modules:
# apt-get install php7.0 php7.0-mysql libapache2-mod-php7.0 php7.0-cli php7.0-cgi php7.0-gd
3) Create a WordPress database:
- Log in to the MySQL command line as the root user:
# mysql -u root -p
- Create the WordPress database:
# CREATE DATABASE wordpress;
- Create a user and grant them privileges for the newly created WordPress database, replacing wpuser and password with the username and password that wish to use:
# CREATE USER ‘wpuser’ IDENTIFIED BY ‘password’;
# GRANT ALL PRIVILEGES ON wordpress.* TO ‘wpuser’;
- Exit MySQL:
1) Create a directory called src under website’s directory to store fresh copies of WordPress’s source files.
# sudo mkdir /var/www/html/example.com/src/
# cd /var/www/html/example.com/src/
2) Set the web server’s user, www-data, as the owner of the site’s home directory:
# chown -R www-data:www-data /var/www/html/example.com/
3) Install the latest version of WordPress and extract it:
# sudo -u www-data tar -xvf latest.tar.gz
4) Rename latest.tar.gz as wordpress followed by the date to store a backup of the original source files:
# mv latest.tar.gz wordpress-`date “+%Y-%m-%d”`.tar.gz
5) Create a public_html directory to be the root directory for WordPress. Move the WordPress files to your public_html folder:
# mkdir /var/www/html/example.com/public_html/
# mv wordpress/* ../public_html/
6) Change web server ownership of the public_html folder:
# chown -R www-data:www-data /var/www/html/example.com/public_html
7) WordPress will test the credentials and if authentication is successful, prompt you to Run the install.
8) Fill out the administration information and click Install WordPress.