How To Install WordPress with LAMP on Ubuntu 16.04
How To Install WordPress with LAMP on Ubuntu 16.04
Introduction
In this tutorial, we will show you how to install WordPress with LAMP on Ubuntu 16.04.
Prerequisites
Before starting this tutorial, you should have the following:
- Ubuntu 16.04 installed on your system.
- Root or sudo access to the server.
- LAMP stack installed on your system.
- A domain name or IP address to access your WordPress site.
Step 1 - Create MySQL Database and User
First, you need to create a MySQL database and user for your WordPress installation. You can do this by following the below steps:
- Login to MySQL as root or a user with sufficient privileges.
- Create a new database for your WordPress site using the following command:
- Create a new MySQL user and grant all permissions on the newly created database using the following command:
- Flush the privileges and exit from MySQL using the following command:
CREATE DATABASE wordpress_db;
CREATE USER 'wordpress_user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wordpress_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Step 2 - Download and Configure WordPress
Next, you need to download and configure WordPress by following the below steps:
- Download the latest version of WordPress using the following command:
- Extract the downloaded file using the following command:
- Move the extracted files to the document root of your Apache web server using the following command:
- Rename the WordPress configuration file using the following command:
- Edit the WordPress configuration file using the following command:
- Set the database name, username, and password that you created earlier in Step 1 in the following lines:
- Save and close the file.
cd /tmp && wget -c https://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
sudo mv wordpress /var/www/html/
cd /var/www/html/wordpress
sudo mv wp-config-sample.php wp-config.php
sudo nano wp-config.php
define( 'DB_NAME', 'wordpress_db' );
define( 'DB_USER', 'wordpress_user' );
define( 'DB_PASSWORD', 'password' );
Step 3 - Configure Apache Virtual Host
Комментарии
Отправить комментарий