How to install NEOS CMS with Apache on Ubuntu 24.04

NEOS CMS, a powerful and flexible content management system, can be installed with Apache on Ubuntu 24.04 to create a reliable and secure environment for website hosting. This setup involves installing Apache, MariaDB, PHP, and configuring NEOS files. Once completed, an Apache virtual host is created and Let’s Encrypt SSL/TLS can be set up for…

This article explains how to install NEOS CMS with Apache on Ubuntu 24.04.

NEOS CMS is a powerful and flexible content management system that allows easy website creation and management. When you install NEOS CMS with Apache on Ubuntu, you set up a reliable and secure environment for hosting websites and delivering content to users.

Apache, a widely used web server, works seamlessly with NEOS CMS, offering stability and robust performance. Ubuntu, a popular and user-friendly operating system, provides a solid foundation for hosting web applications.

This combination of NEOS CMS, Apache, and Ubuntu ensures a reliable and secure web hosting environment for your projects, giving you the confidence to focus on your content and users.

Install Apache HTTP server on Ubuntu

NEOS CMS requires a web server. This post will install and use the Apache web server to run NEOS.

To do that, open the Ubuntu terminal and run the commands below to install the Apache web server.

sudo apt update
sudo apt install apache2

Once Apache is installed, the commands below can start, stop, and enable the Apache web server to start automatically when your server boots up.

sudo systemctl stop apache2
sudo systemctl start apache2
sudo systemctl enable apache2

You can test that the Apache web server is running by opening your web browser and browsing to the server’s localhost or IP address.

http://localhost

When you see the Apache2 Default Page, it means the Apache HTTP server is successfully installed.

Additional help on installing Apache on Ubuntu is in the link below.

How to install Apache on Ubuntu

Install the MariaDB database server on Ubuntu

The next component required to run NEOS is a database server. This post will install and use the MariaDB database server.

To install and use the MariaDB database server, use the instructions below.

Open the Ubuntu terminal and run the commands below to install the MariaDB database server.

sudo apt update
sudo apt install mariadb-server

Once the MariaDB database server is installed, use the commands below to stop, start, and enable the MariaDB server to start automatically when the server boots.

sudo systemctl stop mariadb
sudo systemctl start mariadb
sudo systemctl enable mariadb

Run the following commands to validate and test if the MariaDB database server is installed successfully.

sudo mariadb

Once you run the commands above, it will log you onto the MariaDB console and display a message similar to the one below.

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 32
Server version: 10.11.2-MariaDB-1 Ubuntu 23.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

The message tells you that the server is installed successfully.

Additional help on installing MariaDB.

Create a NEOS database

Upon successfully installing the MariaDB database server, create a blank database on the server specifically for the NEOS application.

As part of the setup, we will create a neosdb database and a user account called neosdbuser.

Finally, we’ll grant the neosdbuser full access to the neosdb database.

All the database steps above can be done using the commands below:

But first, log on to the MariaDB database server:

sudo mariadb

Then run the commands below to complete the steps:

CREATE DATABASE neosdb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER neosdbuser@localhost IDENTIFIED BY 'type_your_password_here';
GRANT ALL ON neosdb.* TO neosdbuser@localhost WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit

Ensure to replace ‘type_your_password_here ‘with your password.

Install PHP on Ubuntu Linux

The last component you will need to run NEOS is PHP. The NEOS application is PHP-based and supports the latest versions of PHP.

Then, run the commands below to install the latest PHP version.

sudo apt install php libapache2-mod-php php-intl php-mysql php-curl php-cli php-zip php-xml php-gd php-common php-mbstring php-xmlrpc php-bcmath php-json php-sqlite3 php-soap php-zip php-imap php-redis php-snmp php-imagick imagemagick

Additional help on installing PHP

How to install PHP on Ubuntu Linux

Download NEOS files

Let’s begin downloading and configuring the NEOS files on Ubuntu Linux.

First, install Composer, Curl, and other dependencies.

sudo apt install curl git
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

First, close NEOS files into the /var/www/neoscms directory. Next, make Apache the owner of the neoscms folder. Then, change to the neoscms folder and install updates using Composer.

sudo git clone https://github.com/neos/neos-base-distribution.git /var/www/neoscms
sudo chown -R www-data:www-data /var/www/neoscms
cd /var/www/neoscms
sudo -u www-data composer install

After running the command above, set up the NEOS CMS database and account created above.

Note: For unknown reasons, I had to run the command twice by using the up arrow key to resolve “Access denied for user ”@’localhost’.

sudo -u www-data ./flow setup:database

When prompted, type in the database info created above.

DB Driver (mysqli): 
[pdo_mysql] MySQL/MariaDB via PDO
[mysqli ] MySQL/MariaDB via mysqli
> mysqli
Host (127.0.0.1):
Database: neosdb
Username: neosdbuser
Password: type_strong_password_here

Database neosdb was connected sucessfully.

Neos:
Flow:
persistence:
backendOptions:
driver: mysqli
host: 127.0.0.1
dbname: neosdb
user: neosdbuser
password: type_strong_password
The new database settings were written to /var/www/neoscms/Configuration/Development/Settings.Database.yaml

Next, set up the default image handler in the same directory.

sudo -u www-data ./flow setup:imagehandler

When prompted, choose Imagick driver as the PHP module.

  [Gd     ] GD Library - generally slow, not recommended in production
[Imagick] ImageMagick php module
> ImageMagick php module

Neos:
Imagine:
driver: Imagick

Migrate the database by running the command below.

sudo -u www-data ./flow doctrine:migrate

Create an administrator account.

sudo -u www-data ./flow user:create --roles administrator

When prompted, create an administrator account.

Please specify the required argument "username": superadmin
Please specify the required argument "password": strong_password_here
Please specify the required argument "firstName": Super
Please specify the required argument "lastName": Admin
The role Neos.Neos:administrator does not exist.

Finally, complete the setup.

sudo -u www-data ./flow cache:flush
sudo -u www-data ./flow site:import --package-key Neos.Demo
sudo -u www-data ./flow neos.flow:doctrine:compileproxies

Once you have completed all the above steps, continue configuring the Apache web server below to serve the NEOS content.

Run the commands below to create an Apache virtual host file for NEOS.

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

Then, copy and paste the content block below into the Apache server block.

<VirtualHost *:80>
ServerName neoscms.example.com
ServerAlias www.neoscms.example.com
ServerAdmin admin@example.com
DocumentRoot /var/www/neoscms/Web

<Directory /var/www/neoscms/Web/>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Save the file.

Then, run the commands below to enable the virtual host and restart the Apache server.

sudo a2ensite neoscms.conf
sudo a2enmod rewrite
sudo systemctl restart apache2

Setup Let’s Encrypt SSL/TLS for NEOS

You may want to install an SSL/TLS certificate to secure your NEOS site. Secure your NEOS installation with HTTPS from Let’s Encrypt.

Please read the post below for additional resources on installing and creating Let’s Encrypt SSL certificates for Apache.

How to set up Let’s Encrypt SSL certificate for Apache on Ubuntu Linux

Once you have restarted the Apache web server, open your browser and browse to the server hostname or IP address defined in the Apache server block.

http://neoscms.example.com/

Your NEOS site should be set up and ready to use.

That should do it!

Conclusion

  • Installing NEOS CMS with Apache on Ubuntu establishes a reliable and secure environment for hosting websites and managing content effectively.
  • The combination of NEOS CMS, Apache, and Ubuntu ensures stability and robust performance, allowing users to focus on creating quality content and engaging with their audience.
  • The step-by-step guide covers the installation of Apache, MariaDB, PHP, and NEOS files, providing detailed commands to create a NEOS database, install PHP, download NEOS files, and configure the Apache web server.
  • Additional resources for further assistance are provided for installing Apache, MariaDB, PHP, and Let’s Encrypt SSL certificates on Ubuntu.
  • The NEOS site is ready for use upon completion, offering a seamless user experience and comprehensive content management capabilities.
Richard Avatar

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *


Exit mobile version