How to Install NEOS CMS on Ubuntu 20.04

Neos CMS is a free and open-source content management system that allows you to build your website easily. It has its own CMS system that helps you to manage websites and blogs without any coding knowledge. It is designed for ease of use and allows business owners to collaborate with users across multiple devices. It offers a rich set of features including, full Unicode support, complete internationalization, SEO, inline editing, and more.

In this post, we will show you how to install Neos CMS with Apache on Ubuntu 20.04 server.

Prerequisites

  • A server running Ubuntu 20.04.
  • A valid domain name pointed with your server IP.
  • A root password is configured on the server.

Getting Started

First, it is always recommended to update your package cache with the latest version. You can do it with the following command:

apt-get update -y

Once you are done, you can proceed to the next step.

Install LAMP Server

Next, you will need to install Apache, MariaDB, PHP and other required packages to your system. Run the following command to install all of them:

apt-get install apache2 mariadb-server php libapache2-mod-php php-common php-mysql php-gmp php-curl php-intl php-mbstring php-xmlrpc php-gd php-bcmath php-xml php-cli php-gmagick php-zip curl unzip git -y

After installing all the packages, edit the php.ini file and make some changes:

nano /etc/php/7.4/apache2/php.ini

Change the following lines:

short_open_tag = On
memory_limit = 256M
upload_max_filesize = 150M
max_execution_time = 360
date.timezone = Asia/Kolkata

Save and close the file then restart the Apache service to apply the changes:

systemctl restart apache2

Create a Database for Neos CMS

First, you will need to set a MariaDB root password and secure the installation. You can do it using the following command:

mysql_secure_installation

Answer all the questions as shown below:

Enter current password for root (enter for none):
Set root password? [Y/n]: N
Remove anonymous users? [Y/n]: Y
Disallow root login remotely? [Y/n]: Y
Remove test database and access to it? [Y/n]:  Y
Reload privilege tables now? [Y/n]:  Y

Once you are done, log in to the MariaDB with the following command:

mysql -u root -p

Once you are log in, create a database and user for Neos CMS using the following command:

MariaDB [(none)]> CREATE DATABASE neosdb;
MariaDB [(none)]> CREATE USER 'neos'@'localhost' IDENTIFIED BY 'mypassword';

Next, grant all the privileges to the Neos database with the following command:

MariaDB [(none)]> GRANT ALL PRIVILEGES ON neosdb.* TO 'neos'@'localhost' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

Next, change the database charset to utf8mb4, flush the privileges, and exit from the MariaDB with the following command:

MariaDB [(none)]> ALTER DATABASE neosdb charset=utf8mb4;
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Next, edit the MariaDB configuration file and make some changes:

nano /etc/mysql/mariadb.conf.d/50-server.cnf

Add the following lines:

innodb_file_format = Barracuda
innodb_large_prefix = 1
innodb_file_per_table = 1
innodb_default_row_format = dynamic

Save and close the file then restart the MariaDB service to apply the changes:

systemctl restart mariadb

Once you are finished, you can proceed to the next step.

Install Neos CMS

First, you will need to install the Composer to your system. Composer is a dependency manager used for installing PHP dependencies.

Run the following command to install Composer:

curl -sS https://getcomposer.org/installer | php

You should get the following output:

All settings correct for using Composer
Downloading...

Composer (version 2.1.3) successfully installed to: /root/composer.phar
Use it: php composer.phar

Next, move the Composer file to the system location:

mv composer.phar /usr/local/bin/composer

Next, change the directory to the Apache web root and download the Neos CMS with the following command:

cd /var/www/html/
composer create-project --no-dev neos/neos-base-distribution neoscms

Next, set proper permission and ownership to the Neos directory:

chown -R www-data:www-data /var/www/html/neoscms/
chmod -R 755 /var/www/html/neoscms/

Once you are finished, you can proceed to the next step.

Configure Apache for Neos CMS

Next, you will need to create an Apache virtual host configuration file to host Neos CMS. You can create it with the following command:

nano /etc/apache2/sites-available/neoscms.conf

Add the following lines:

<VirtualHost *:80>
     ServerAdmin [email protected]
     DocumentRoot /var/www/html/neoscms/Web
     ServerName neos.example.com
     <Directory /var/www/html/neoscms/Web/>
          Options FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/neos_error.log
     CustomLog ${APACHE_LOG_DIR}/neos_access.log combined
    
     <Directory /var/www/html/neoscms/Web/>
            RewriteEngine on
            RewriteBase /
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*) index.php [PT,L]
    </Directory>
</VirtualHost>

Save and close the file then activate the virtual host and enable the Apache rewrite module with the following command:

a2ensite neoscms.conf
a2enmod rewrite

Next, restart the Apache service to apply the changes:

systemctl restart apache2

You can also check the status of the Apache service with the following command:

systemctl status apache2

You should get the following output:

? apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2021-06-17 11:16:53 UTC; 16s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 16996 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 17016 (apache2)
      Tasks: 6 (limit: 2353)
     Memory: 13.4M
     CGroup: /system.slice/apache2.service
             ??17016 /usr/sbin/apache2 -k start
             ??17017 /usr/sbin/apache2 -k start
             ??17018 /usr/sbin/apache2 -k start
             ??17019 /usr/sbin/apache2 -k start
             ??17020 /usr/sbin/apache2 -k start
             ??17021 /usr/sbin/apache2 -k start

Jun 17 11:16:53 ubuntu2004 systemd[1]: Starting The Apache HTTP Server...

At this point, the Apache web server is configured to serve Neos CMS. You can now proceed to the next step.

Access Neos CMS

Now, open your web browser and access the Neos CMS using the URL http://neos.example.com. You will be redirected to the following page:

Neos CMS Installer

Click on the Go to setup. You should see the following page:

Neos Login

Provide the setup password from the SetupPassword.txt file and click on the Login button. You should see the following page:

Requirements check

Make sure all required PHP extensions are installed then click on the Next button. You should see the following page:

Database configuration

Provide your database name, database username, database host, password, and click on the Next button. You should see the following page:

Create an admin account

Provide your name, admin username, password, and click on the Next button. You should see the following page:

Create a new site

Provide all required information and click on the Next button. Once the installation has been completed successfully, you should see the following page:

Neos setup complete

Click on the Go to the backend. You should see the Neos CMS login page:

Neos Login

Provide your admin username, password and click on the Login button. You should see the Neos CMS dashboard on the following page:

Neos CMS backend

Conclusion

Congratulations! you have successfully installed Neos CMS with Apache on Ubuntu 20.04 server. You can now easily create and edit your website through the web browser. Feel free to ask me if you have any questions.

Share this page:

Suggested articles

0 Comment(s)

Add comment