Please note that the forum isn't realy used anymore.

If you have questions, want support or just simply want to talk to us you can find us on slack.

 

Installing ForkCMS on CentOS 6

Fork-CMS on CentOS 6 32/64bit Minimal

This is for a install of Fork CMS under a completely new/fresh/empty CentOS 6 Minimal. And should be seen as a guideline for what you need (and what to do).

My personal prerequisites (Not nessecary, but comfortable) is marked with “¤>” and required installations / steps / commands marked with “+>”. Also, I take for granted you have SSH up and running and have root access (or possibility to use sudo for root commands), a SSH client (Like PuTTY in Windows) and preferably a SCP client for file transfers (Like WinSCP) (Why use clear text FTP when you have SCP capability in SSH?):

  • We need the EPEL repos for several reasons (Extra Packages for Enterprise Linux):

+> yum install epel-release

+> yum update

+> yum upgrade

  • Next, fix the timezone from EST. This sets the timezone to Europe/Stockholm (change to suit your needs), and is future safe for changes in timezone handling when changes occur. This way (the CORRECT way), if the timezones get changes in the future, the system handles it automatically when updated. Countries differ in how they handle leap years and seconds, daylight time savings, and so on. If you noticed on the yum update above, you have a “tzdata noarch 2015a-1.el6 updates 440 k” or later containing the latest changes as of feb 10th, 2015. Don’t ask. Just DO this. Saves you headaches later on.

+> cd /etc

+> mv localtime localtime.EST

+> ln -s /usr/share/zoneinfo/Europe/Stockholm /etc/localtime

  • Now a question to ask yourself. Do you need anything else than the standard available PHP (For CentOS 6 as of writing the release is 5.3.3 (minimum for fork-cms) and the LATEST (Last?) release of the End Of Life 5.3.x branch is 5.3.29-4 (This means that 5.3.x Is DEAD)). I want a newer, supported PHP, such as the 5.6.x branch for several reasons. So I use the following build tree (Only for CentOS 6). This ALSO installs Apache AND MySQL (!!! REMEMBER to refer everything php as php56w from now on when doing stuff !!!). This also installs what Fork-CMS needs in PHP, and MySQL 5.5.x:

+> rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm

+> yum install mysql55w-server

+> yum install php56w php56w-opcache php56w-mysql php56w-dom

+> yum install php56w-mbstring php56w-gd

  • If you want the standard php and mysql (WHY????), you just skip the above and just do

( !!! UNTESTED !!! )

+> yum install mysql-server php php-opchache php-mysql php-dom

+> yum install php-mbstring php-gd

  • Exactly what it says… If you are unsure, this is not a crash course in MySQL. It’s on the web.

+> service mysqld start

+> /usr/bin/mysqlsecureinstallation

  • Check runlevel. For a normal, clean system of CentOS 6, you are in 3 per default (N 3).

+> runlevel

  • Check what services autostart in all runlevels.

+> chkconfig

  • Make sure services needed gets started properly.

+> chkconfig --level 3 httpd on

+> chkconfig –level 3 mysqld on

+> service httpd status; service mysqld status

  • If httpd and/or mysqld is running, fine. If not, do this;

+> service httpd start

+> service mysqld start

  • This is optional utilities. Just makes MY life a lot easier. If you don’t need them, don’t install.

¤> yum install joe htop mc lynx which traceroute

  • Yes, just for testing, get some php info we can browse to. Replace “blorp.php” with whatever-you-want.php and open a browser to check what php has installed. Use http://your.ip/blorp.php. You don’t want this page in a production site, why reveal what you have running to an outside person? But is very useful to get a hint of what’s in php and what’s not.

+> echo "<?PHP phpinfo(); ?>" > /var/www/html/blorp.php

  • Allow usage of .htaccess, around line 338, change “AllowOverride None” to “AllowOverride All”

¤> joe /etc/httpd/conf/httpd.conf

  • Fix stupid bug in php not reading system timezone (Actually, it’s not a bug…. It’s a feature…). Anyway, around line 889, set the timezone , like “date.timezone = ‘Europe/Stockholm’ ” without quotes(“) but with the single quotes (‘)

¤> joe /etc/php.ini

  • And restart httpd – Otherwise the changes in httpd.conf and php.ini won’t get noticed.

+> service httpd restart

  • Now we get to the messy (And FUN) bit. Installing Fork-CMS. Get the latest. This WILL change Check the download page for the latest!!!!!!! And THIS you can do in a lot of different ways. I prefer to use wget, then use “mc” (Midnight Commander) to handle the archive, and copy the content to /var/www/html. But that’s only one way. Or you can use git. Or (Option 1 of n) - go home (either /root if you are running as root as you are if you followed guide or your /home/username directory)

+> cd

+> wget http://www.fork-cms.com/frontend/files/releases/forkcms-3.8.6.tar.gz

+> tar -xzf forkcms-3.8.6.tar.gz -C /var/www/html/ --strip-components=1

  • !!!!!! THIS IS IMPORTANT! ALL FILES AND DIRECTORIES CURRENTLY HAS THE USER THAT CREATED THE DIRECTORIES RIGHTS. THIS IS WHAT CAUSES THE INFAMOUS “ERROR 500”. (in /var/log/httpd/error.log you will see “…..PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 53672377 bytes) in /var/www/html/vendor/spoon/library/spoon/exception/exception.php on line 441” because the httpd doesn’t have proper rights to acces/write directories !!!!!!.

+> chgrp apache /var/www/html/* -R

+> chown apache /var/www/html/* -R

Now go to http://your.ip/

(Markdown edit doesn't work)

Thanks for the guide! Note that you can use codeblocks by putting them between backticks or start a multi-line code fragment with 4 spaces.

I Know. And i can't edit texts correctly after I posted them either. I get the edit window, but changes doesn't get saved. I can't get rid of some things describing double quotes, single quotes, line breaks etc, so posted stuff can't be edited...afterwards to fix such things... (I can edit partially, but not completely. Changes doesn't get saved.

Anyway, I hope people understands anyway :-P

Yes I know the forum has some bugs. I fixed some of them (edit first post, fix encoding of special characters, ...) and they should be deployed on the website in the near future... :-)

Comment

The forum is deprecated in favor of our Slack channel, which provides real-time support for your issues.

Join us on Slack here: https://fork-cms.herokuapp.com/