Neos is a free and open source content management system. It is written in PHP and uses its own framework flow. Neos is highly customizable and extensible. The content on the site can be edited very easily, you just need to click on the content and you can edit it right away. It provides tools so you can easily create a multilingual site. It provides many more features such as Multisite capabilities, Human readable URLs, Reviews and Workflows, Users and Roles, Package Manager, Templates etc.
In this tutorial, we will install Neos on CentOS 7 server.
Neos CMS does not require any special hardware requirements. It can be installed on servers with a small amount of RAM. All the required dependencies will be installed throughout the tutorial. You will need a minimal installation of CentOS 7 with root access on it. If you are logged in as a non-root user, you can run
sudo -i to switch to root user.
Before installing any package it is recommended that you update the packages and repository using the following command.
yum -y update
Once you have your system updated, you can proceed to install the LAMP stack. Start the LAMP installation by installing Apache web server and MariaDB, which is a fork of MySQL using the following command.
yum -y install httpd mod_rewrite mariadb-server mariadb
Neos can be installed on any version of PHP greater than 7.0. PHP 7 is not included in default YUM repository, hence you will need to add the Webtatic repository in your system. Webtatic repository requires EPEL repository to work. Run the following command to install EPEL repository.
yum -y install epel-release
yum -y update
Now install Webtatic repository using the following commands.
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum -y update
To install PHP 7.1 and all the required PHP modules, run the following command.
yum -y install php71w php71w-mbstring php71w-pdo_mysql php71w-cli php71w-tokenizer php71w-pecl-imagick
Once you have PHP installed, you can check the version of PHP using the following command.
You should get output similar to this.
[root@liptan-pc ~]# php -v PHP 7.1.5 (cli) (built: May 12 2017 21:54:58) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
Now start Apache web server and enable it to start at boot time using the following command.
systemctl start httpd
systemctl enable httpd
To start MariaDB and enable it to start at boot time using the following commands.
systemctl start mariadb
systemctl enable mariadb
Now run the following commands to secure your MySQL or MariaDB installation.
It will run a small script which asks you to provide the root password for MariaDB. As we have just installed MariaDB, the root password is not set, just press enter to proceed further. It will ask you if you want to set a root password for your MariaDB installation, choose
y and set a strong password for the installation. It will also ask you for removing test databases and anonymous users. Most of the questions are self-explanatory and you should answer
y to all the questions.
To create a database we will need to login to MySQL command line first. Run the following command for same.
mysql -u root -p
This will prompt you for the password, provide the root password of MySQL which you have set earlier. Now run the following query to create a new database for your Neos installation.
CREATE DATABASE neos_data;
The above query will create a database named
neos_data. Make sure that you use semicolon at the end of each query as the query always ends with a semicolon. Once the database is created you can create a new user and grant all the permissions to the user for the database. Using root user is not recommended for the databases. To create a new database user, run the following query.
CREATE USER 'neos_user'@'localhost' IDENTIFIED BY 'StrongPassword';
The above query will create a user with username
neos_user. You can use any preferred username instead of
StrongPassword with a strong password. Now provide the appropriate privileges to your database user over the database you have created. Run the following command.
GRANT ALL PRIVILEGES ON neos_data.* TO 'neos_user'@'localhost';
Now change the character set of your database to utf8 using following query.
ALTER DATABASE neos_data charset=utf8;
Now run the following command to immediately apply the changes on the database privileges.
Exit from MySQL prompt using
Now you will need to install Composer. Composer is a dependency manager for PHP.
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/bin/composer
Now switch to the webroot directory of Apache web server and download Neos using following command.
composer create-project --no-dev neos/neos-base-distribution neos
Now you will need to create a virtual host for your web application. Run the following command for same.
Paste the following lines into the file.
<VirtualHost *:80> ServerAdmin firstname.lastname@example.org DocumentRoot "/var/www/html/neos/Web" ServerName cms.yourdomain.com ServerAlias www.cms.yourdomain.com <Directory "/var/www/html/neos/Web"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all Require all granted </Directory> ErrorLog "/var/log/httpd/cms.yourdomain.com-error_log" CustomLog "/var/log/httpd/cms.yourdomain.com-access_log" combined </VirtualHost>
cms.yourdomain.com with any domain or subdomain you want to use to access the application. Save the file and exit from the editor. Run the following command to restart your Apache server.
systemctl restart httpd
Now you will need to provide the ownership of the application to web server user using the following command.
./flow core:setfilepermissions root apache apache
You may also need to allow HTTP traffic on port
80 through the firewall if you are running one. Run the following commands to do so.
firewall-cmd --zone=public --permanent --add-service=http
You will also need to disable SELinux. To temporary disable SELinux without restarting the server, run the following command.
To completely disable the SELinux you will need to edit
Find the following line:
Change it to:
Now complete the installation using a web browser, go to the following link using your favourite web browser.
You will see the following page.
The installer will now build the cache and will generate the setup password. Once it is done, you will be redirected to next page asking for setup password.
To obtain the setup password run the following command in terminal.
You will see following out which includes the password.
[root@liptan-pc neos]# cat /var/www/html/neos/Data/SetupPassword.txt The setup password is:
After you successfully logged in, this file is automatically deleted for security reasons. Make sure to save the setup password for later use.
Enter the password in the web interface.
Click Login button to continue. In next interface, it will check for the setup requirements. The installer will automatically choose
imagick module for image manipulation.
Click Next to proceed further. In next interface, you will need to provide the database information.
Select MySQL/MariaDB via PDO Database driver. Provide the username and password which you have created earlier. Once you provide the DB user details, the installer will automatically scan the database associated with the user. Select the database and click Next to go to the next step. In this step, you will need to create a new administrator account.
Provide the administrator details and click Next to continue. In next step, you will be asked how you want to create your site.
Click Next to create the site using the Site package. The site will now be imported and you will see the success message. You can now access the frontend of your site on
http://cms.yourdomain.comwhich will look like this.
To access the backend of your site, go to the following link.
http://cms.yourdomian.com/neoswhich will look like this.
In this tutorial, we have learned to install Neos CMS on CentOS 7 server. You can use this content management system to create beautiful personal sites or business site.