Neos CMS is an innovative content management system that allows you to manage websites and blogs without any coding knowledge. With its user-friendly interface and robust features, Neos CMS is an excellent choice for businesses looking to create and maintain their online presence. In this comprehensive guide, we will walk you through the step-by-step process of installing Neos CMS with Apache and Let’s Encrypt SSL on Ubuntu 22.04. By the end of this tutorial, you will have a fully functional Neos CMS installation on your Ubuntu server.
Prerequisites
Before we begin, make sure you have the following prerequisites in place:
- A server running Ubuntu 22.04.
- A valid domain name pointed to your server IP.
- A root password configured on the server.
Step 1: Updating System Packages
To ensure that your system is up to date, start by updating all your system packages. Open the terminal and run the following commands:
apt update -y apt upgrade -y
Step 2: Installing Apache, MariaDB, and PHP
Next, we 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 the installation is complete, we need to make some changes to the php.ini
file. Open the file using the nano text editor:
nano /etc/php/8.1/apache2/php.ini
Inside the file, find the following lines and make the necessary changes:
short_open_tag = On memory_limit = 256M upload_max_filesize = 150M max_execution_time = 360 date.timezone = UTC
Save and close the file by pressing Ctrl+X
, then Y
, and finally Enter
. Restart the Apache service to apply the changes:
systemctl restart apache2
Step 3: Creating a Database for Neos CMS
Before we can install Neos CMS, we need to set up a database for it. Start by securing the MariaDB installation. Run the following command:
mysql_secure_installation
You will be prompted to enter the current password for the root user. Since this is a fresh installation, press Enter
. You will then be asked if you want to set a root password. Choose N
to skip this step.
Next, you will be asked if you want to remove anonymous users, disallow remote root login, remove the test database, and reload the privilege tables. Answer with Y
to all of these prompts.
Once you have secured the installation, log in to MariaDB with the following command:
mysql -u root -p
Enter the MariaDB root password when prompted. Now, create a database and user for Neos CMS:
CREATE DATABASE neosdb; CREATE USER 'neos'@'localhost' IDENTIFIED BY 'mypassword';
Make sure to replace 'mypassword'
with a strong password of your choice. Next, grant all the privileges to the Neos database:
GRANT ALL PRIVILEGES ON neosdb.* TO 'neos'@'localhost' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
Again, replace 'mypassword'
with the password you set earlier. After granting the privileges, we need to change the database charset to utf8mb4
, flush the privileges, and exit from MariaDB:
ALTER DATABASE neosdb charset=utf8mb4; FLUSH PRIVILEGES; EXIT;
Now, let’s edit the MariaDB configuration file to make some additional changes:
nano /etc/mysql/mariadb.conf.d/50-server.cnf
Inside the file, add the following lines at the end:
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:
systemctl restart mariadb
Step 4: Installing Neos CMS
Before we can install Neos CMS, we need to install Composer, a dependency manager used for installing PHP dependencies. Run the following command to install Composer:
curl -sS https://getcomposer.org/installer | php
Next, move the Composer file to the system location:
mv composer.phar /usr/local/bin/composer
Now, change the directory to the Apache web root and download the Neos CMS using the following command:
cd /var/www/html git clone https://github.com/neos/neos-base-distribution.git
After the download is complete, rename the downloaded directory and install all PHP dependencies using Composer:
mv neos-base-distribution neoscms cd neoscms composer install
Once the installation is finished, set the proper permissions and ownership to the Neos directory:
chown -R www-data:www-data /var/www/html/neoscms/ chmod -R 755 /var/www/html/neoscms/
Step 5: Configuring Apache for Neos CMS
To host Neos CMS, we need to create an Apache virtual host configuration file. Run the following command to create the file:
nano /etc/apache2/sites-available/neoscms.conf
Inside the file, add the following lines:
<VirtualHost *:80>
ServerAdmin test@example
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. Next, activate the virtual host and enable the Apache rewrite module:
a2ensite neoscms.conf
a2enmod rewrite
Finally, restart the Apache service to apply the changes:
systemctl restart apache2
You can check the status of the Apache service to ensure it is running:
systemctl status apache2
Step 6: Accessing Neos CMS
Now that Neos CMS is installed and configured, you can access it through your web browser. Open your browser and enter the URL http://neos.example.com
. You will be redirected to the Neos CMS setup page.
Click on the “Go to setup” button to begin the setup process. On the setup page, enter the setup password from the SetupPassword.txt
file and click on the “Login” button.
Make sure all the required PHP extensions are installed, and then click on the “Next” button. On the next page, enter the database name, database username, database host, and password. Click on the “Next” button to proceed.
Provide your name, admin username, password, and click on the “Next” button. Finally, click on the “Go to the backend” button to access the Neos CMS backend.
To log in to the backend in the future, enter your admin username and password on the login page. Once logged in, you will see the Neos CMS dashboard.
Step 7: Securing Neos CMS with Let’s Encrypt
To secure your Neos CMS website with Let’s Encrypt SSL, we will use the Certbot client. Start by installing the Certbot Apache plugin with the following command:
apt-get install python3-certbot-apache -y
Once the installation is complete, run the following command to secure your website with Let’s Encrypt SSL:
certbot --apache -d neos.example.com
You will be prompted to enter your email address and accept the terms of service. Follow the prompts and choose the appropriate options.
After the configuration is complete, Certbot will automatically install and configure the SSL certificate for your website.
Conclusion
Congratulations! You have successfully installed Neos CMS with Apache and Let’s Encrypt SSL on your Ubuntu 22.04 server. You now have a powerful content management system that allows you to create and manage your website effortlessly.
Neos CMS, combined with the reliable and scalable cloud hosting solutions provided by Shape.host, offers businesses a robust platform to build and grow their online presence. With Shape.host’s Cloud VPS, you can enjoy high-performance hosting tailored to your specific needs.
If you have any questions or need further assistance, feel free to reach out to our support team at Shape.host. We are here to help you make the most of Neos CMS and our hosting services.