Nginx Configuration for Textpattern

0

Textpattern is an elegant CMS. It is a free open source software that allows web developers, designers, and bloggers to publish their content within a clean and easy interface.

One especially good thing about Textpattern is the fact that developers and designers have the ability to control all aspects of the XHTML and CSS from the same admin interface, without any need to open the code in an external area.

Main features

  • Convert plain text into valid XHTML
  • Upload and organize files and images via web browser
  • Password protected articles
  • Flexibility to work for corporate or personal websites
  • Unlimited page layouts and styling
  • Built in Anti-spam comment system
  • Clean Friendly URLs for SEO

To follow this tutorial, you should already have Nginx and php-fpm running on your box.

Textpattern Nginx configuration

To configure Nginx for Textpattern, work with:

nano -w /etc/nginx/conf.d/yoursite.com.conf

Paste this configuration inside:

### yoursite.com

server {
log_not_found off;
error_log  logs/yoursite.com-error_log warn;

        listen       80;
        server_name  yoursite.com www.yoursite.com;
        root   /var/www/html/yoursite.com;
       	index  index.php index.html index.htm;

        location ~* \.(gif|jpg|jpeg|png|ico|wmv|3gp|avi|mpg|mpeg|mp4|flv|mp3|mid|js|css|wml|swf)$ {
                expires max;
                add_header Pragma public;
                add_header Cache-Control "public, must-revalidate, proxy-revalidate";
        }

        location / {
                # Needed for SEO Friendly URLs
                try_files $uri $uri/ /index.php?$args;
        }

	# php-fpm configuration
        location ~ \.php$ {
            try_files $uri =404;
            fastcgi_pass   unix:/tmp/php5-fpm.sock;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
            fastcgi_buffer_size 128k;
            fastcgi_buffers 256 4k;
            fastcgi_busy_buffers_size 256k;
            fastcgi_temp_file_write_size 256k;
        }
}

Remember this is just an example. You need to replace yoursite.com with your real website domain name. Then, check your php-fpm configuration and the root path of your site to match the actual settings that you have configured.

Textpattern installation

Move to your site’s root path and download Textpattern:

cd /var/www/html/yoursite.com
wget http://textpattern.com/latest.zip
unzip latest.zip
mv textpattern*/* ./

Now, launch http://www.yoursite.com/ from the web browser and start the installation process. Within minutes, you should have Textpattern working live from your Nginx server.

Conclusion

If you’re a web designer or developer, Textpattern may be the best alternative to other CMS like WordPress. The easy installation and integration with popular web servers like Nginx makes it a good choice for all who are looking for a rock solid CMS to manage all of their content.

Have you tested Textpattern, yet? What do you think?


You might also like More from author