Apache default page ubuntu 22.04

How To Install WordPress on Ubuntu 22.04 LTS Server

Learn the steps to install WordPress CMS on Ubuntu 22.04 LTS Jammy JellyFish using LAMP Server – Apache, MariaDB and PHP.

If you want to run your blog, you’ll quickly come across WordPress software. What WordPress is and what possibilities it offers, we’ll tell you in this practical tip.

WordPress is the most popular software in the world that allows you to create a website. What makes it special is that you can use an innovative interface.

Its plugin system is an add-on to WordPress. There are thousands of free and paid plugins. Using plugins, you can extend the functionality of your website. We can install, configure and remove plugins through the dashboard. A theme is an outfit, the design of your website. There are thousands of free and paid themes here. We can change the theme with just a few clicks to change the look of your website. Plugins and themes help you build your WordPress site.

WordPress works with almost any website like Private Websites, Blogs, Company Websites, Company Websites, Online Stores and Membership Pages.

Steps to Install WordPress on Ubuntu 22.04 LTS Linux

The steps given in this tutorial can be used for other Ubuntu server versions such as 20.04/18.04. While following this guide, the user should have Ubuntu 22.04 LTS, access to a non-root user with sudo privileges, and the LAMP stack (which will be installed here).

1. Perform Ubuntu 22.04 update

First, run the system update command to ensure that all packages on our system are up to date and that the APT package index cache is in its latest state.

sudo apt update && sudo apt upgrade

2. Install Apache & PHP for WordPress

We need an Apache web server and PHP programming language to set up the WordPress CMS, let’s install them in this step.

sudo apt install apache2

After Apache is installed, enable and start its service.

sudo systemctl enable apache2

Check status:

systemctl status apache2

We can also check the working of the Apache web server by visiting its default page. To do this, open your local system browser that can access the IP address of your Ubuntu 22.04 server with Apache installed.

notes: IP address of the server with your physical address

http://server-ip-address

Install PHP version 8

The default version of PHP can be installed using the standard Ubuntu 22.04 LTS repositories. So, just run the given command to install PHP and required extensions on your system.

sudo apt install -y php php-{common,mysql,xml,xmlrpc,curl,gd,imagick,cli,dev,imap,mbstring,opcache,soap,zip,intl}

To check the version after completing the above command, use:

php -v

3. Install MariaDB or MySQL

We can use MariaDB or MySQL database server on Ubuntu 22.04 to store data generated by WordPress CMS. Here we use MariaDB server.

sudo apt install mariadb-server mariadb-client

Enable, start and check service status:

sudo systemctl enable --now mariadb

Check:

systemctl status mariadb

Ctrl+C quit.

Secure your database installation:

To secure our database instance, run the given command:

sudo mysql_secure_installation

output

The system will ask the given question, with an example answer below:

Enter current password for root (enter for none): Press ENTER
Set root password? [Y/n]: Y
New password: Set-your-new-password
Re-enter new password: Set-your-new-password
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

4. Create a database for WordPress

Log in to your database server using the password you set for its root user.

sudo mysql -u root -p

Follow the command to create a new database.However, don’t forget to replace new user Use whatever name you want to give the database user and in the same way – new database with the name of the database and your password for the password.

CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'your_password';
CREATE DATABASE new_db;
GRANT ALL PRIVILEGES ON new_db.* TO 'new_user'@'localhost';
FLUSH PRIVILEGES;
Exit;

5. Install WordPress on Ubuntu 22.04

The files for setting up WordPress need to be downloaded manually, which we can do using the command terminal. Here are the commands to follow:

sudo apt install wget unzip

Download WordPress:

wget https://wordpress.org/latest.zip

Extracting files:

sudo unzip latest.zip

Move it to the web folder:

sudo mv wordpress/ /var/www/html/

Delete downloaded files to free up space:

sudo rm latest.zip

Change file permissions

sudo chown www-data:www-data -R /var/www/html/wordpress/

sudo chmod -R 755 /var/www/html/wordpress/

6. Configure Apache on Ubuntu 22.04

Next, enable the Apache web server’s module and Vhost configuration file to ensure that it serves the PorcessWire CMS files without any errors.

Create a configuration file for WordPress

sudo nano /etc/apache2/sites-available/wordpress.conf

Copy-paste the following lines:

<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>

Save the file by pressing Ctlr+O, hitting the Enter key, and then exiting using Ctrl+X.

 

Enable virtual host

sudo a2ensite wordpress.conf

Enable rewrite module

sudo a2enmod rewrite

Disable the default Apache test page

sudo a2dissite 000-default.conf

Restart the Apache web server to apply the changes:

sudo systemctl restart apache2

7. WordPress CMS web interface settings

After completing the above steps, open your system browser with access to the server IP address of the system where you have WordPress installed.

and point it as follows:

http://your-server-ip-address

Start setup:

Select the WordPress language you want to use and click continue button.

Choose WordPress language

8. Add database information

Next, click Let's go will create a button wp-config File used to store database details.

Set up Wo profile database

The database we created in this tutorial to store data generated by WordPress, its user and password; add its details in the WordPress setup wizard when asked, then clicksubmit" button.

Add database MariaDB on WordPress

Finally, click "run the install" button.

Running WordPress installation on Ubuntu 22.04 server

9. Create admin user and password

Add the site title you want to give your website, then add the username and password to use with it. After that add the email address and click "Install WordPress".

Create admin user and password

10. Log in to the background

Finally the Admin login page will appear; add the user and password you created.

Access the Admin Dashboard of the WordPress CMS

Wordpress CMS installed on Ubuntu 22.04 jammy linux

Other articles:

How To Install Background CMS on Ubuntu 22.04 Jammy
How To Install Umbraco CMS on Ubuntu 20.04 LTS
Check Internet Speed ​​Using Commands in Ubuntu…
How To Set Up DNS Name Servers on Ubuntu
How to Install WordPress on Lighttpd Web Server - Ubuntu

Leave a Comment

Your email address will not be published.