Tutorials  /  Linux Basics

Install Textpattern CMS on FreeBSD 13.0 with Apache & PHP

Ccentron Redaktion · July 2025 ·6 min read ·Linux Basics, Tutorial

Textpattern CMS is a free, open-source content management system (CMS) designed using PHP. It is known for its speed, security, and minimalistic approach, ensuring an efficient user experience. Notable features include multi-language support, plugin extendability, built-in features, and a template system based on tags.

This guide details how to set up Textpattern CMS on a FreeBSD 13.0 server.

Requirements

Complete the following initial setup steps:

  • Launch a FreeBSD 13.0 server as a custom image using the Installation Handbook 
  • Connect to your server via SSH.
  • Set up a non-root user with sudo privileges.
VM

Matching infrastructure at centron

No hardware needed to follow along: ccloud³ VMs with full root access start at €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →

Step 1: Installing Essential Packages

Begin by updating the system package repository:

Code
freebsd-update fetch install

pkg update

Install the necessary tools and utilities:

Code
pkg install -y sudo nano unzip wget bash

Install PHP 7.4 and required extensions:

Console
sudo pkg install -y apache24 mysql80-server php74 mod_php74 php74-curl php74-session php74-gd php74-json php74-mbstring php74-xmlrpc php74-gmp php74-curl php74-mysqli php74-intl php74-sqlite3 php74-xml php74-zip php74-zlib php74-pdo php74-pear php74-pdo_mysql php74-filter php74-mysqli php74-zip php74-imap php74-simplexml

Enable and start the PHP-FPM service:

Console
sudo sysrc php_fpm_enable=yes

sudo service php-fpm start

Copy the default PHP configuration to the appropriate location:

Console
sudo cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini

Step 2: Setting Up the Textpattern Database

Configure MySQL to start on boot and initialize the service:

Console
sudo sysrc mysql_enable="yes"

sudo service mysql-server start

Access the MySQL shell (press Enter if prompted for a password):

Console
sudo mysql -u root -p

Set a secure password for the root user. Replace MySecurePassword with your chosen strong password:

Code
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MySecurePassword';

Create the textpattern database:

Code
CREATE DATABASE textpattern;

Establish a new MySQL user textpatternuser and assign a password. Replace SecurePassword accordingly:

Code
CREATE USER 'textpatternuser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'SecurePassword';

Grant the user full privileges on the textpattern database:

Code
GRANT ALL ON textpattern.* TO 'textpatternuser'@'localhost' WITH GRANT OPTION;

Apply the permission changes:

Code
FLUSH PRIVILEGES;

Exit the MySQL command-line interface:

Code
exit;

Step 3: Installing Textpattern CMS

Begin by downloading the latest version of Textpattern CMS from the official site:

Console
wget https://textpattern.com/file_download/118/textpattern-4.8.8.zip

Extract the contents of the downloaded ZIP archive:

Console
sudo unzip textpattern-4.8.8.zip

Remove the original zip file:

Console
sudo rm textpattern-4.8.8.zip

Create the installation directory for Textpattern:

Console
sudo mkdir -p /usr/local/www/apache24/data/textpattern

Move the extracted files into the new directory:

Console
sudo mv textpattern-4.8.8/* /usr/local/www/apache24/data/textpattern

Set the correct ownership for the directory:

Console
sudo chown -R www:www /usr/local/www/apache24/data/textpattern

Adjust the directory permissions:

Console
sudo chmod -R 755 /usr/local/www/apache24/data/textpattern

Step 4: Configuring Apache2 for Textpattern

Enable Apache to automatically start when the system boots:

Console
sudo sysrc apache24_enable=yes

Start the Apache service:

Console
sudo service apache24 start

Create a configuration file to enable PHP processing in Apache:

Console
sudo nano /usr/local/etc/apache24/modules.d/001_mod-php.conf

Insert the following code and save the file:

Code
DirectoryIndex index.php index.html
<filesmatch "\.php$"="">
    SetHandler application/x-httpd-php

<filesmatch "\.phps$"="">
    SetHandler application/x-httpd-php-source

Create a virtual host configuration file for Textpattern:

Console
sudo nano /usr/local/etc/apache24/Includes/textpattern.conf

Add the following settings to the file and save it:

Code
ServerAdmin admin@example.com
DocumentRoot /usr/local/www/apache24/data/textpattern
ServerName example.com


    Options -Indexes +FollowSymLinks
    AllowOverride All
    Require all granted

Verify the Apache configuration syntax:

Console
sudo apachectl configtest

Restart Apache to apply the new configuration:

Console
sudo service apache24 restart

Step 5: Finalizing Textpattern Installation

To launch the web-based setup, open your browser and go to:

http://Server_IP/textpattern/setup/

For example:

http://192.0.2.11/textpattern/setup/

Proceed with the database setup by entering the credentials used during the database creation process.

Once provided, a code snippet will appear. Copy and paste it into a file named config.php using the following command:

Console
sudo nano /usr/local/www/apache24/data/textpattern/textpattern/config.php

Insert the generated configuration code, similar to:

PHP
<?php
    $txpcfg['db'] = 'textpattern';
    $txpcfg['user'] = 'textpatternuser';
    $txpcfg['pass'] = 'SecurePassword';
    $txpcfg['host'] = 'localhost';
    $txpcfg['table_prefix'] = '';
    $txpcfg['txpath'] = '/usr/local/www/apache24/data/textpattern/textpattern';
    $txpcfg['dbcharset'] = 'utf8mb4';
    // For more customization options, please consult config-dist.php file.
?>

Complete the installation by creating an admin account and finalizing any remaining settings. Then, remove the setup directory to enhance security:

Console
sudo rm -rf /usr/local/www/apache24/data/textpattern/textpattern/setup/

Conclusion

You've successfully installed Textpattern CMS on a FreeBSD 13.0 server. For further customization and usage, consult the official documentation.

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Linux Basics
Teilen
Noch offene Fragen?

Our team will help you with your specific setup - in German or English, by people who run the platform themselves.

War dieses Tutorial hilfreich?

Your answer is stored anonymously and helps us improve our tutorials.

Kommentare

No comments yet - be the first to ask a question about this tutorial.

Sign in to comment

Comments are open to centron customers. Sign in to your account to ask a question about this tutorial.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren