ScaleScaleScaleScale

Tips / Nginx


Nginx Configuration For Concrete5

Concrete5 is a CMS that is becoming pretty popular as a WordPress alternative. It allows you to generate a web page without losing much time and with all of the common functions of the three most popular CMS: Joomla, Drupal and WordPress.

Concrete5 is easy to set up and can be ready to use within a few minutes from its web interface.

Main features of concrete5

  • Compatibility with most modern PHP-MySQL versions.
  • Easy installation and configuration from the web browser.
  • Create and edit content from within the same pages, without going to a separate area (like WP).
  • Complete user management area with editor and admin privileges.
  • Insert and manipulate different types of content, like images, image galleries, comments, text, maps, videos and much more.
  • Full CDN and Cache integration to speed up website response time.

The assumption in this tutorial is that you already have Nginx and PHP-FPM running on your server with socket defined as /tmp/php5-fpm.sock. Tweak as needed if your php-fpm configuration is different.

Concrete5 + Nginx configuration

Running concrete5 on Nginx requires a simple but effective configuration. This example uses nginxtips.com as the main website and /var/www/html/nginxtips.com as the default root directory:

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

Paste this inside:

### nginxtips.com

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

        listen       80;
        server_name  nginxtips.com www.nginxtips.com;
        root   /var/www/html/nginxtips.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 / {
                try_files $uri $uri/ /index.php$request_uri /index.php;
        }

# 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 that this is a basic working example configuration for concrete5 with Nginx + PHP-FPM. You will need to replace nginxtips.com with your own real domain name and tweak the php-fpm or document_root configuration as needed.

Installing Concrete5

Move to your document_root directory, download concrete5 from http://www.concrete5.org/get-started and extract as shown below:

cd /var/www/html/nginxtips.com
wget http://www.concrete5.org/download_file/-/view/79252/
mv index.html concrete5.zip
unzip concrete5.zip
rm concrete5.zip -fv
mv concrete5*/* ./

After that, launch htp://www.yoursite.com/ and the concrete5 installation process will begin. Follow the instructions, connect to your MySQL database and you should be set.

Conclusion

The setup and configuration of concrete5 is very simple. It allows you to have a great alternative to the traditional WordPress CMS with almost all of the same features. If you are tired of dealing with WordPress and all of its troubles, then it’s time to give concrete5 a try. You won’t regret it.

 

Popular search terms:

  • concrete5 and fastcgi
  • https://www scalescale com/tips/nginx/nginx-configuration-concrete5/
  • install concrete5 ubuntu nginx
profile

Esteban Borges

Linux Geek, Webperf Addict, Nginx Fan. CTO @Infranetworking