How to Install TYPO3 CMS on Rocky Linux 9

TYPO3 is a free and open-source Enterprise-grade content management system. It provides multiple enterprise-level features such as scalable CMS with multisite support, multilingual installations, strong security implementation, blazingly fast, and can be run anywhere.

Using TYPO3 CMS allows you to build flexible and reliable websites. The TYPO3 CMS is backend a vibrant professional community. And by design, the TYPO3 CMS is a pluggable content management system with adaptable and decoupled architecture.

In this guide, you will install TYPO3 CMS - Enterprise-grade Content Management System - on Rocky Linux 9 server. You will set TYPO3 CMS with the httpd web server, MariaDB database, and the latest version of PHP 8.0. This guide includes the implementation of HTTPS via Certbot and Letsencrypt, which will be used to secure TYPE3 deployment.

Prerequisites

First, you must have the following requirements to complete this guide:

  • Once Rocky Linux 9 server - This example uses a Rocky Linux with the hostname 'TYPO3-Rock'.
  • A non-root user with sudo/root privileges.
  • An SELinux running on permissive mode.
  • A domain name pointed to a server IP address - This example uses the domain 'hwdomain.io'.

That's it. When all requirements are ready, you can now start the installation.

Installing httpd Web Server

TYPO3 is an enterprise-grade CMS (Content Management System) and web application written in PHP. It can be run with various types of the web server. In this example, you will install and run TYPE3 CMS with the httpd web server.

Before installing any package, enter the following dnf command to add the EPEL (Extra Package for Enterprise Linux) repository to your system. This repository will be needed later for installing additional packages.

sudo dnf install epel-release

Now run the following dnf command to install the httpd web server. When prompted, input y to confirm and press ENTER to proceed.

sudo dnf install httpd

install httpd

Once httpd installed, enter the following systemctl command utility to start and enable the httpd web server. This will run the httpd web server and enable it to start automatically at system startup.

sudo systemctl start httpd
sudo systemctl enable httpd

Verify the httpd web server status using the systemctl command below. You should receive an output such as 'enabled', which confirms that the httpd service will be run automatically at boot. And the status of the httpd web server is running.

sudo systemctl is-enabled httpd
sudo systemctl status httpd

verify httpd

Before accessing your httpd installation, you must open the HTTP and HTTPS protocols on your Rocky Linux system via firewalld.

Enter the following firewall-cmd command to add both HTTP and HTTPS ports to the firewalld. Then, reload the firewalld to apply the changes.

sudo firewall-cmd --add-service={http,https} --permanent
sudo firewall-cmd --reload

The output 'success' confirms the operation's success. You can now verify the list of firewalld rules via the following command.

sudo firewall-cmd --list-all

In the 'services' section, you should see both HTTP and HTTPS protocols added to the firewalld.

setup firewalld

Now that you have installed the httpd web server and configured firewalld. Next, you will start the MariaDB database server installation.

Installing MariaDB Server

In this section, you will install the MariaDB database server and secure the deployment automatically using the 'mariadb-secure-installation' command.

To start, enter the following dnf command to install the MariaDB database server.

sudo dnf install mariadb-server

Input y when prompted and press ENTER to proceed.

install mariadb

Now start and enable the MariaDB service using the following systemctl command utility. The MariaDB service should now be running and also enabled, which means the MariaDB service will start automatically upon the bootup.

sudo systemctl start mariadb
sudo systemctl enable mariadb

Enter the following systemctl command to verify the MariaDB service and ensure that the service is running and enabled.

sudo systemctl is-enabled mariadb
sudo systemctl status mariadb

An output 'enabled' confirms that the MariaDB server is enabled and will be run automatically upon the system startup. The output 'active (running)' confirms that the MariaDB server is running.

start verify mariadb

Lastly, run the following 'mariadb-secure-installation' command to secure the MariaDB deployment.

sudo mariadb-secure-installation

You will now be asked with the following configurations - You can input y to confirm or n for no.

  • Change authentication to unix_socket? input n.
  • Change the MariaDB root password? input y to confirm, input the new password for your MariaDB server and repeat the password.
  • Disable remote root login? input y to confirm - the root user should not be allowed to connect remotely.
  • Remove anonymous user? input y to confirm.
  • Remove the default database 'test'? input y to confirm and remove the test database.
  • Lastly, input y to reload tables privileges and apply new changes.

When MariaDB deployment is finished, you're ready to create a new database and user for TYPO3 CMS deployment.

Creating MariaDB Database and User

In this section, you will create a new MariaDB database and user that will be used for the TYPO3 CMS installation.

First, log in to the MariaDB shell via the 'mariadb' command below. Input your MariaDB root password and press ENTER.

sudo mariadb -u root -p

Now run the following MariaDB queries to create a new database and user. In this example, you will create a new database 'typo3db' with the user 'typo3'. Be sure to change the password in the following queries, and be sure to use the 'utf8mb4' as the default character set for your database.

CREATE DATABASE typo3db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON typo3db.* to typo3@localhost IDENTIFIED BY 'typo3password';
FLUSH PRIVILEGES;

create databae and user

Next, verify the list of available users on MariaDB using the following query. You should see the new user 'typo3' added and available on your MariaDB server.

SELECT USER,host FROM mysql.user;

verify user

Lastly, verify the privileges for the MariaDB user 'typo3' using the following query. You should see the user 'typo3' has all privileges to the database 'typo3db'.

SHOW GRANTS FOR typo3@localhost;

show user grants

Now type quit to log out from the MariaDB shell.

With this, you have now finished the MariaDB database configuration for the TYPO3 CMS installation. Move to the next step to start PHP installation.

Installing PHP 8.0

TYPO3 CMS is mainly written in PHP, and at the time of this writing, the latest version of TYPO3 CMS supports PHP 8.x packages. In this section, you will install PHP 8.0, which is available by default on the Rocky Linux 9 repository.

Enter the following dnf command to install PHP 8.0 packages. When prompted, input y to confirm and press ENTER to proceed.

sudo dnf install php php-common php-mysqlnd php-gd php-curl php-json php-intl php-bcmath php-zip php-apcu php-mbstring php-fileinfo php-xml php-soap

install php

Once PHP is installed, open the config file '/etc/php.ini' using the following nano editor command.

sudo nano /etc/php.ini

Change the default php.ini configurations with the following lines.

memory_limit = 512M
max_execution_time = 300
max_input_vars = 2000

date.timezone = Europe/Stockholm

post_max_size = 30M
upload_max_filesize = 30M

Save and exit the file '/etc/php.ini' when finished.

Now run the following systemctl command utility to restart the httpd service and apply the new changes that you have made to the 'php.ini' file.

sudo systemctl restart httpd

You can also verify the current PHP version via the 'php' command below. You should receive an output that PHP 8.0 is installed on your system.

php --version

verify php

Now you've installed PHP 8.0 packages and configured the php.ini file. In the next step, you will install Composer - dependencies manager for PHP - that will be used for installing PHP dependencies of TYPO3 CMS.

Installing Composer

Composer is an application-level PHP dependencies manager. It can be installed manually via the official installer script, or you can install it via the EPEL repository.

Enter the following dnf command to install Composer from the EPEL repository. When prompted, input y to confirm and press ENTER to proceed.

sudo dnf install composer

install composer

Once Composer is installed, enter the following command to verify the Composer version.

sudo -u apache composer -V

The output below confirms that Composer v2.5.1 is installed on your Rocky Linux system.

verify composer

With the Composer installed, next to the next step is to install Certbot which will be used for generating SSL/TLS certificates from Letsencrypt.

Installing Certbot

Certbot is a command-line tool for generating SSL/TLS certificates from Letsencrypt. For RHEL-based distributions, you can install Certbot from the EPEL repository.

Enter the following dnf command to install the 'certbot' and 'python3-certbot-apache' packages to your system. Input y when prompted and press ENTER to proceed.

sudo dnf install certbot python3-certbot-apache

install certbot

Once installation is finished, run the following command to verify your installation.

which certbot
certbot --version

The binary path of the 'certbot' command is available at '/bin/certbot'. And the version of certbot that you've installed is v2.1.0.

verify certbot

With the composer and certbot installed, you're ready to install TYPO3 CMS.

Downloading TYPO3 CMS Source Code

In this section, you will set up the target installation directory and TYPO3 CMS source code download.

Enter the following command to create a new directory '/var/www/typo3'. This will be used as the root installation directory of TYPO3 CMS.

mkdir -p /var/www/typo3

Change the ownership of the '/var/www/typo3' directory to the user and group 'apache'. Also, you must ensure that the owner of this directory can read and write into it. With this, you will give access to the TYPO3 CMS source code to the httpd web server that runs by default with an 'apache' user.

sudo chown -R apache:apache /var/www/typo3
sudo chmod u+rw /var/www/typo3

Now go to the '/var/www/typo3' directory and download the TYPO3 CMS source code using the following composer command.

cd /var/www/typo3
sudo -u apache composer create-project typo3/cms-base-distribution:^11 .

Output:

download source code

Once the TYPO3 CMS source code is downloaded, enter the following command to verify the list of files and directories on the '/var/www/typo3' directory.

ls -lah /var/www/typo3

The output below confirms that the TYPO3 CMS source code is downloaded. Also, you must ensure the ownership of TYPO3 CMS source code is the user and group 'apache'.

verify source code

Now that you've downloaded the TYPO3 CMS source code, you will next create and set up the httpd virtual host configuration that will be used to run TYPO3 CMS.

Setup httpd Virtual Host

In this section, you will create a new httpd virtual host configuration that will be used to run TYPO3 CMS. You'll also generate SSL/TLS certificates from Letsencrypt via the Certbot command.

Before you start, ensure that you have the domain name pointed to your server IP address and an email address that will be used to register to Letsencrypt.

Create a new httpd virtual host config file '/etc/httpd/conf.d/typo3.conf' using the following nano editor command.

sudo nano /etc/httpd/conf.d/typo3.conf

Add the following lines to the file and be sure to change the domain name of the TYPO3 CMS installation.

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /var/www/typo3/public
    ServerName hwdomain.io

    Protocols h2 http/1.1

     <Directory /var/www/typo3/public/>
          Options FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>

     ErrorLog /var/log/httpd/typo3-error.log
     CustomLog /var/log/httpd/typo3-access.log combined
    
     <Directory /var/www/typo3/public/>
            RewriteEngine on
            RewriteBase /
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*) index.php [PT,L]
    </Directory>
</VirtualHost>

Save and exit the file '/etc/httpd/conf.d/typo3.conf' when finished.

Next, run the following command to verify and ensure that you have proper httpd configurations. When successful, you should receive an output such as 'syntax OK'.

sudo apachectl configtest

Now enter the following systemctl command utility to restart the httpd service and apply the changes.

sudo systemctl restart httpd

With this, you have now finished the httpd virtual host configuration for TYPO3 CMS.

Now enter the following certbot command to generate SSL/TLS certificates for your TYPO3 CMS domain name. Also, be sure t change the domain name and email address in the following command.

sudo certbot --apache --agree-tos --no-eff-email  --redirect --hsts --staple-ocsp --email [email protected] -d hwdomain.io

When finished, your SSL/TLS certificates will be available in the '/etc/letsencrypt/live/yourdomain.com/' directory. Also, your httpd virtual host configuration will automatically be configured with SSL certificates and the auto-redirect of HTTP to HTTPS.

With this, you have now finished the configuration of the httpd web server for TYPO3 CMS. You have also generated SSL/TLS certificates for your TYPO3 CMS domain name. You can now access your TYPO3 CMS installation.

Start TYPO3 Installation

Before you begin the TYPO3 CMS installation, you must create a new blank file 'FIRST_INSTALL' in the '/var/www/typo3/public/' directory. This will point out that you are installing the TYPO3 CMS first time on this server.

Enter the following command to create a new file 'FIRST_INSTALL' within the '/var/www/typo3/public/' directory.

sudo -u apache touch /var/www/typo3/public/FIRST_INSTALL

Now open up your web browser and input the domain name of your TYPO3 CMS installation (i.e: https://hwdomain.io/).

The TYPO3 CMS installer will check and verify your system environment on the first page. Ensure that you get the button 'No problems detected, continue with installation', which confirms that your system is ready for TYPO3 CMS installation.

installation start

Now input your details of the MariaDB user that will be used for TYPO3 CMS installation.

setupd atabase

Select the option 'Use an existing empty database' and select the database 'typo3db' in the dropdown menu. Then click Continue.

select database

Now input the username, email address, and password for the TYPO3 CMS admin user. Be sure to use a strong password for this.

Click Continue to proceed.

setup admin

When finished, you should receive an output such as 'Installation Complete'.

Now select the option 'Take me straight to the backend' and click the button 'Open the TYPO3 Backend' to continue.

installation finished

And you will be redirected to the TYPO3 CMS login page. Input your admin user and password, then click Login.

login page typo3 cms

If successful, you should see the TYPO3 CMS administration dashboard.

dashboard typo3 cms

You can verify the details software that you're using for TYPO3 CMS installation by clicking the 'Application Information' menu on the left side of the user profile.

You should see similar details in the following screenshot - At the time of this writing, you have installed TYPO3 CMS v11.5 with httpd/Apache web servers, PHP 8.0, and the MariaDB database server.

verify status installation

Conclusion

In this guide, you have installed an enterprise-grade content management system TYPO3 CMS on a Rocky Linux 9 server. You have installed TYPO3 CMS with the httpd web server, MariaDB database server, and PHP 8.0.

In addition to that, you have also installed Certbot for generating SSL certificates from Letsencrypt. And also secured TYPO3 CMS installation via SSL/TLS certificates and configured auto-redirect from HTTP to HTTPS via Certbot.

With this, you can start your TYPO3 CMS configuration by creating a site record, adding backend users, and adding backend language to enable multi-language. To learn more about TYPO3 CMS, visit TYPO3's official documentation.

Share this page:

0 Comment(s)