Wordpress Install - Ubuntu 22.04
Wordpress is an open source software you can download to create a beautiful website or blog to host on your own server. Here are the instructions to assist in installing Wordpress using Apache, PHP and MariaDB.
Install Apache
1
sudo apt install apache2 -y
Enable Apache and Check Status
1
2
sudo systemctl enable apache2
systemctl status apache2
Install PHP
1
sudo apt install -y php php-{common,mysql,xml,xmlrpc,curl,gd,imagick,cli,dev,imap,mbstring,opcache,soap,zip,intl}
Install MariaDB, Start and Secure
1
2
3
sudo apt install mariadb-server mariadb-client -y
sudo systemctl enable --now mariadb
sudo mysql_secure_installation
Add Database for Wordpress
1
sudo mysql -u root -p
1
2
3
4
5
CREATE DATABASE wordpress_db;
CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'your_PASSWORD';
GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wp_user'@'localhost';
FLUSH PRIVILEGES;
exit;
Download and Install Wordpress Latest
1
2
3
4
5
6
sudo apt install wget unzip -y
wget https://wordpress.org/latest.zip
sudo unzip latest.zip
sudo mv wordpress/ /var/www/html/
sudo chown www-data:www-data -R /var/www/html/wordpress/
sudo chmod -R 755 /var/www/html/wordpress/
Configure Apache
1
sudo nano /etc/apache2/sites-available/wordpress.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/wordpress
ServerName example.com
ServerAlias www.example.com
<Directory /var/www/html/wordpress/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Enable Website
1
2
3
4
sudo a2ensite wordpress.conf
sudo a2enmod rewrite
sudo a2dissite 000-default.conf
sudo systemctl restart apache2
This post is licensed under
CC BY 4.0
by the author.