How to install Textpattern CMS in Ubuntu 16.04

To install Textpattern CMS in Ubuntu 16.04

In our preceeding article, we have been briefed about the installation process of Textpattern CMS on OpenSUSE 42.1. In this tutorial, we will be explained about the installation procedure of Textpattern CMS on Ubuntu 16.04. Textpattern is a free open source software for web developers, designers, and bloggers to publish their content with a easy web interface.you can easily create,edit and publish contents on your site. Textpattern CMS is also lightweight as it will only consume very little space in memory and disk. It contains features like conversion of plain text to XHTML code, tag-based template system, built-in site statistics and seperation of content from presentation.

Pre-Requisite

To start with the installation procedure of Textpattern, you need to have LAMP stack installed in your system. Along with the required PHP modules such as (php php-mysql php-curl php-gd php-json php-opcache php-xml php-mcrypt)

Installation procedure

First download the Textpattern CMS package from the following link https://textpattern.com/start/. Now extract the downloaded package using unzip command.

root@linuxhelp:/home/user# cd Downloads/
root@linuxhelp:/home/user/Downloads# ll
total 1628
drwxr-xr-x  2 user user    4096 Oct 12 19:50 ./
drwxr-xr-x 16 user user    4096 Oct 12 19:49 ../
-rw-rw-r--  1 user user 1657031 Oct 12 19:50 textpattern-4.6.2.zip
root@linuxhelp:/home/user/Downloads# unzip textpattern-4.6.2.zip
Archive:  textpattern-4.6.2.zip
   creating: textpattern-4.6.2/
  inflating: textpattern-4.6.2/.htaccess  
  inflating: textpattern-4.6.2/css.php  
&hellip 
&hellip 
&hellip 
  inflating: textpattern-4.6.2/textpattern/vendors/Textpattern/Validator/TrueConstraint.php  
  inflating: textpattern-4.6.2/textpattern/vendors/Textpattern/Validator/Validator.php  
  inflating: textpattern-4.6.2/textpattern/vendors/Txp.php

Move the extracted package to /var/www/html/ directory path.

root@linuxhelp:/home/user/Downloads# mv textpattern-4.6.2 /var/www/html/

Change the ownership for the recently moved directory by running the following command.

root@linuxhelp:/home/user/Downloads# chown -R www-data:www-data /var/www/html/

Next copy the textpattern-4.6.2 contents to /var/www/html/ directory.

root@linuxhelp:/home/user/Downloads# cd /var/www/html/textpattern-4.6.2/
root@linuxhelp:/var/www/html/textpattern-4.6.2# cp -a * ..

Configure the MySQL database for Textpattern CMS by logging it to MySQL service. Create a database and user with all privileges granted to the user.

root@linuxhelp:/var/www/html# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with   or g.
Your MySQL connection id is 7
Server version: 5.7.19-0ubuntu0.16.04.1 (Ubuntu)
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ' help '  or ' h'  for help. Type ' c'  to clear the current input statement.

mysql>  CREATE DATABASE textpattern 
Query OK, 1 row affected (0.22 sec)

mysql>  CREATE USER ' textuser' @' localhost'  IDENTIFIED BY ' password'  
Query OK, 0 rows affected (0.90 sec)

mysql>  GRANT ALL PRIVILEGES ON `textpattern`.* TO ' textuser' @' localhost'  
Query OK, 0 rows affected (0.01 sec)

mysql>  flush privileges 
Query OK, 0 rows affected (0.47 sec)

mysql>  exit
Bye

Create the textpattern.conf in sites-available directory and create soft link for the file in sites-enabled directory

root@linuxhelp:/var/www/html# touch /etc/apache2/sites-available/textpattern.conf
root@linuxhelp:/var/www/html# ln -s /etc/apache2/sites-available/textpattern.conf /etc/apache2/sites-enabled/textpattern.conf

Next configure the Apache virtual host directory named textpattern.conf for Textpattern CMS using nano editor. Now add the following content in the file and save it.

root@linuxhelp:/var/www/html# nano /etc/apache2/sites-available/textpattern.conf

< VirtualHost *:80> 
DocumentRoot " /var/www/html/textpattern" 
< Directory " /var/www/html/" > 
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
< /Directory> 
ErrorLog /var/log/apache2/linuxhelp1-error_log
CustomLog /var/log/apache2/linuxhelp1-access_log common
< /VirtualHost> 

Restart the Apache web server by executing the following command.

root@linuxhelp:/var/www/html# systemctl restart apache2

Switch over to the web browser and navigate to http://192.168.7.201/textpattern. The Textpattern CMS installer appears on the screen.

Enter the required database details to the textpattern CMS and click next.

A configuration file named config.php is prompted to the user to enter into the Textpattern directory.

Open the terminal and add the above configuration file content in the file. Save and exit the file.

root@linuxhelp:/var/www/html/textpattern# nano config.php 
< ?php
$txpcfg[' db' ] = ' textdb'  
$txpcfg[' user' ] = ' user'  
$txpcfg[' pass' ] = ' 1'  
$txpcfg[' host' ] = ' localhost'  
$txpcfg[' table_prefix' ] = ' '  
$txpcfg[' txpath' ] = ' /var/www/html/textpattern'  
$txpcfg[' dbcharset' ] = ' utf8'  
?> 

Enter the user details for the CMS and click next

The installation is now complete. click log in now option to finish the installation.

The Textpattern login page appears on the screen. Enter the required admin details and click log in option.

The admin page of Textpattern appears on the screen. Add the contents of the website in this page.

After entering the contents in the file. Click Publish option to publish the contents in the website.

Thus concludes the installation procedure of Textpattern CMS in Ubuntu 16.04.

FAQ
Q
What is the current stable version?
A
The current stable version is 1.0.4
Q
I want to install textpattern cms on centos?please help me?
A
follow this link, https://www.linuxhelp.com/how-to-install-textpattern-cms-in-centos/
Q
the php-Version: 5-STABLE-STANDARD, 5.2.17 I see, this have a save preference. Maybe this is the problem? I can go to a higher php-Version, should i do it?
A
Yes, you need 5.3 at least, and the higher the better.
Q
is that the problem? no php.ini-file my other txp-websites are all works without the php.ini-file.
A
I think txp does not need php.ini, but php itself does. You should ask your provider how to switch php version.
Q
How to entry to the host file?
A
Follow the steps as below, # /etc /hosts