Home / How To / How to install Textpattern CMS on CentOS 8

How to install Textpattern CMS on CentOS 8

Textpattern is a free and open PHP content management system. It's fairly easy, fast and easy to use while providing decent customizability through themes and plugins. In this guide we will install the Textpattern on a new CentOS 8 system.


  • A new CentOS 8 system where you have access to the root user or any user with sudo privileges.
  • A registered domain name points to your server.

If you are logged in as a sudo user, switch to root for this setting:

  sudo su -

Set $ VISUAL environment variable to a text editor according to your wishes. For example, to use nano:

  echo "export VISUAL = nano" >> ~ / .bash_profile
. ~ / .Bash_profile

Step 1
: Install required software

First update your system:

  dnf update -y

Then install wget, tar, Apache, PHP, the necessary PHP extensions, MariaDB and SELinux management tools:

  dnf install -y wget takes httpd mariadb server php php-xml php-mysqli php-json php-mbstring php-zip php-zlib policycoreutils-python-utils

Make sure the Apache and MariaDB services are enabled and running:

  systemctl enable - now httpd.service mariadb.service

Since the CentOS 8 layers do not include certbot, we will use a script, certbot-auto to install it. Download and install certbot-auto as follows:

  wget https://dl.eff.org/certbot-auto
etc. certbot-auto / usr / local / bin / certbot-auto
chmod 0755 / usr / local / bin / certbot-auto

Then use the following command to install certbot:

  certbot-auto - install-only

Enter & # 39; y & # 39; when dnf is prompted to install dependencies.

Restart the Apache service:

  systemctl restart httpd.service

Step 2: The Textpattern CMS Installation

Copy the download link (in .tar.gz format) for the latest version of the textpattern from their Github releases and download it to your server using the wget as per the following:

  wget https://github.com/textpattern/textpattern/releases/download/4.7.3/textpattern-4.7.3.tar.gz

Then extract the archive and move the contents to the web directory:

  tar -xzf textpattern * .tar.gz
rm -f textpattern * .tar.gz
etc. textpattern * / var / www / html / textpattern

For Textpattern to work properly, it requires write access to certain directories. To grant this access, give the Apache system user ownership of the entire directory:

  chown -R apache: apache / var / www / html / textpattern

And use the following commands to tag the directory structure with the correct SELinux context:

  semanage fcontext -a-t httpd_sys_content_t "/var/www/html/textpattern(/.*)?"
semanage fcontext -a-t httpd_sys_rw_content_t "/var/www/html/textpattern/themes(/.*)?"
semanage fcontext -a-t httpd_sys_rw_content_t "/var/www/html/textpattern/images(/.*)?"
semanage fcontext -a-t httpd_sys_rw_content_t "/var/www/html/textpattern/files(/.*)?"
reset -Rv / var / www / html

Step 3: Database setup

Start running mysql_secure_installation to perform basic security improvements:


Answer the questions that appear below and be sure to select a secure root user password:

  Enter the current root password (set for none): 
Setting root password? [Y/n] y
New password: your_password
Enter new password: your_password
Delete anonymous users? [Y/n] y
Remove root login remotely? [Y/n] y
Delete the test database and access it? [Y/n] y
Reload privilege tables now? [Y/n] y

Then we create a database and users to use by Textpattern. Log in to the MySQL shell using:

  mysql -u root -p

Enter your root password and then issue the following statements. Be sure to replace textpattern_user_password with the correct password.

  MariaDB [(none)]> CREATE DATABASE textpattern_db;
MariaDB [(none)]> CREATE USERS textpattern_user IDENTIFIED BY & # 39; textpattern_user_password & # 39 ;;
MariaDB [(none)]> SUPPORT ALL PRIVILEGES ON textpattern_db. * TO textpattern_user;
MariaDB [(none)]>  q

Step 4: Apache Configuration

First enable HTTP and HTTPS traffic through host's firewall:

  firewall cmd - add-service http - add-service https --permanent
firewall cmd - reload

Then create a new virtual host for your Textpattern site:

  $ VISUAL /etc/httpd/conf.d/textpattern.conf

And enter the following configuration by replacing your_domain with your domain name.

DocumentRoot "/ var / www / html / textpattern"
Server_your_domain name

AllowOverride All

Save and Exit, then load the new configuration:

  systemctl reload httpd.service 

To obtain an SSL certificate for your domain and configure Apache to use HTTPS, issue the following command: [19659006] certbot-auto –apache -d "your_domain" -m "[emailĀ protected]" – redirect

This command performs a number of tasks:

  • Obtain a certificate for your domain (saved under / etc / letsencrypt / your_domain / ).
  • Create an Apache configuration file named textpattern-le-ssl.conf .
  • Edit textpattern.conf to redirect all HTTP requests to HTTPS.

Step 5: Textpattern CMS Configuration

Your Textpattern installation should now be available but not configured yet. Browse to https: // your_domain / textpattern / setup / to start the web installer. After selecting a language, enter database information:

  • MySQL username: textpattern_user
  • MySQL password: Enter the password selected for textpattern_user in step 2.
  • MySQL server: localhost
  • MySQL database: textpattern_db
  • Table prefix: leave this field blank

The installer will check the database references you entered before generates the corresponding configuration. Create the required file:

  $ VISUAL /var/www/html/textpattern/textpattern/config.php

Paste the generated configuration, save the file and exit. Proceed to the next step in the Web Installer, where you will be asked to enter CMS administrator account information and site configuration. When this is done, remove directory :

  rm -rf / var / www / html / textpattern / textpattern / setup

Your Textpattern site is now ready for use.

More information

Source link