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.
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:
freebsd-update fetch install
pkg updateInstall the necessary tools and utilities:
pkg install -y sudo nano unzip wget bashInstall PHP 7.4 and required extensions:
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-simplexmlEnable and start the PHP-FPM service:
sudo sysrc php_fpm_enable=yes
sudo service php-fpm startCopy the default PHP configuration to the appropriate location:
sudo cp /usr/local/etc/php.ini-production /usr/local/etc/php.iniStep 2: Setting Up the Textpattern Database
Configure MySQL to start on boot and initialize the service:
sudo sysrc mysql_enable="yes"
sudo service mysql-server startAccess the MySQL shell (press Enter if prompted for a password):
sudo mysql -u root -pSet a secure password for the root user. Replace MySecurePassword with your chosen strong password:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MySecurePassword';Create the textpattern database:
CREATE DATABASE textpattern;Establish a new MySQL user textpatternuser and assign a password. Replace SecurePassword accordingly:
CREATE USER 'textpatternuser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'SecurePassword';Grant the user full privileges on the textpattern database:
GRANT ALL ON textpattern.* TO 'textpatternuser'@'localhost' WITH GRANT OPTION;Apply the permission changes:
FLUSH PRIVILEGES;Exit the MySQL command-line interface:
exit;Step 3: Installing Textpattern CMS
Begin by downloading the latest version of Textpattern CMS from the official site:
wget https://textpattern.com/file_download/118/textpattern-4.8.8.zipExtract the contents of the downloaded ZIP archive:
sudo unzip textpattern-4.8.8.zipRemove the original zip file:
sudo rm textpattern-4.8.8.zipCreate the installation directory for Textpattern:
sudo mkdir -p /usr/local/www/apache24/data/textpatternMove the extracted files into the new directory:
sudo mv textpattern-4.8.8/* /usr/local/www/apache24/data/textpatternSet the correct ownership for the directory:
sudo chown -R www:www /usr/local/www/apache24/data/textpatternAdjust the directory permissions:
sudo chmod -R 755 /usr/local/www/apache24/data/textpatternStep 4: Configuring Apache2 for Textpattern
Enable Apache to automatically start when the system boots:
sudo sysrc apache24_enable=yesStart the Apache service:
sudo service apache24 startCreate a configuration file to enable PHP processing in Apache:
sudo nano /usr/local/etc/apache24/modules.d/001_mod-php.confInsert the following code and save the file:
DirectoryIndex index.php index.html
<filesmatch "\.php$"="">
SetHandler application/x-httpd-php
<filesmatch "\.phps$"="">
SetHandler application/x-httpd-php-sourceCreate a virtual host configuration file for Textpattern:
sudo nano /usr/local/etc/apache24/Includes/textpattern.confAdd the following settings to the file and save it:
ServerAdmin admin@example.com
DocumentRoot /usr/local/www/apache24/data/textpattern
ServerName example.com
Options -Indexes +FollowSymLinks
AllowOverride All
Require all grantedVerify the Apache configuration syntax:
sudo apachectl configtestRestart Apache to apply the new configuration:
sudo service apache24 restartStep 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:
sudo nano /usr/local/www/apache24/data/textpattern/textpattern/config.phpInsert the generated configuration code, similar to:
<?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:
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.
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.