How to Install WordPress with LAMP on SUSE Linux Enterprise

Written in PHP, WordPress is one of the most popular and widely used CMS (Content Management Systems). It is free and open-source and is used for creating stunning websites by providing prebuilt feature-rich templates that are easily customizable. As such, you can create cool websites without the need to write any code.

In this guide, we will demonstrate how to install WordPress with LAMP on SUSE Enterprise Server 15.

Prerequisites

Let us now dive in and install WordPress in SUSE Linux.

Step 1. Create a Database for WordPress

WordPress requires a database in which it will install all the installation files and user data. Right off the bat, access your database server

# mysql -u root -p

Then create a database and database user for WordPress installation and grant all privileges to the user on the database.

CREATE DATABASE wordpress_db;
GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wordpress_user' IDENTIFIED BY 'P@ssword321';

Reload the changes and exit.

FLUSH PRIVILEGES;
exit;

Step 2: Download and Configure WordPress

With the database in place, the next step is to download and configure WordPress.

You can download the WordPress tarball file as shown using the wget command.

# wget http://wordpress.org/latest.tar.gz

This downloads a compressed file called latest.tar.gz. Once downloaded, extract it using the tar command as shown.

# tar -xvf latest.tar.gz

This extract the compressed file to a folder called wordpress. Move this folder to the Document root directory.

# mv wordpress/ /srv/www/htdocs/

Next, create a wp-config.php file by copying the wp-config-sample.php file.

# sudo cp /srv/www/htdocs/wordpress/wp-config-sample.php /srv/www/htdocs/wordpress/wp-config.php

Next, access the file and update the database details.

# vim /srv/www/htdocs/wordpress/wp-config.php
Configure WordPress Database Settings
Configure WordPress Database Settings

Save the changes and exit. Next, assign the following permissions.

# chown -R wwwrun:www /srv/www/htdocs/
# chmod 775 -R /srv/www/htdocs/

Step 3. Configure Apache Virtualhost for WordPress

Next, we are going to create a configuration file for WordPress.

# sudo vim /etc/apache2/conf.d/wordpress.conf

Next, paste the following lines of code. Be sure to replace example.com with your own registered domain name.

<virtualhost *:80>
servername example.com
documentroot "/srv/www/htdocs/wordpress/"
<directory "/srv/www/htdocs/">
AllowOverride All
Require all granted
</directory>
</virtualhost>

Save the changes and exit the file. For all the changes to take effect, restart the Apache webserver.

# sudo systemctl restart apache2

Step 4. Complete WordPress Installation from a Web Browser

To complete the installation, open your web browser and browse your server’s IP address or domain name. You will get the welcome page shown. Select your installation and follow the wizard right to the end.

WordPress Installation
WordPress Installation

This wraps up our guide today on the installation of WordPress on SUSE Linux Enterprise Server 15. Your feedback is much welcome.

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

James Kiarie
This is James, a certified Linux administrator and a tech enthusiast who loves keeping in touch with emerging trends in the tech world. When I'm not running commands on the terminal, I'm taking listening to some cool music. taking a casual stroll or watching a nice movie.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.