FreeBSD Manual Installation Of Neos CMS With Composer and Apache

Neos is a free and open source modern content management system that can be used to build and manage websites easily. For creating and editing online content, Neos is a great choice, apart from being innovative Neos is easy to use as it provides an intuitive editing interface, structured content repository, multilingual content readiness, professional content workflow, and many more powerful features to facilitate content creation and management.

Neos is based on a PHP framework that allows you to build a site that can be customized according to the user's wishes. Neos CMS is not just a CMS, but a content application platform and customizes according to your company's needs. Neos allows you to edit content according to your own wishes in the browser.


1. System Requirements

OS: FreeBSD 13.2
IP address: 192.168.5.2
Hostname: ns3
Web server: apache24
PHP version: PHP82
PHP-FPM
Composer: Recommended version: 2.0 or higher
Dependencies: php82-curl php82-dom php82-fileinfo php82-gd php82-iconv php82-intl php82-pecl-json_post php82-xmlwriter php82-mbstring php82-pdo php82-pdo_mysql php82-phar php82-simplexml php82-xml php82-zip php82-zlib pcre2 libxml2

2. Install Dependencies

There are many dependencies that Neos CMS requires, one of which is a very important dependency is PHP. Because almost all Neos CMS scripts are run with PHP programs. This PHP dependency will later connect Neos CMS with the MySQL database server and will also connect Neos CMS with the Apache web server. If you don't install PHP dependencies, don't expect Neos CMS to be able to run or use it well.

a. PHP Dependencies

On FreeBSD, there are two ways to install PHP dependencies, namely with PKG packages and system ports. To make the installation process faster and easier, in this article we will install PHP dependencies with the FreeBSD PKG package. Run the command below to start installing PHP dependencies.
root@ns3:~ # pkg install php82 php82-intl php82-curl php82-dom php82-fileinfo php82-gd php82-iconv php82-pecl-json_post php82-xmlwriter php82-zlib php82-mbstring php82-pdo php82-pdo_mysql php82-simplexml php82-xml php82-phar php82-zip php82-mysqli libxml2 pcre2

b. Composer Dependencies

Another PHP dependency that you must install is PHP Composer. This dependency will download Neos CMS from the official repository onto your FreeBSD server. In Neos CMS, composer is also used to initialize Neos CMS, such as the installation, update and modification processes.

On FreeBSD the PHP composer repository is available, you can directly install it from the PKG package or system ports. Run the command below to install PHP Composer.
root@ns3:~ # cd /usr/ports/devel/php-composer
root@ns3:/usr/ports/devel/php-composer # make install clean


3. Create Database Neos CMS

The next step is to create a database for Neos CMS. We assume that your FreeBSD server has MySQL Server installed, so we just create a database, with the following conditions.

Database name: neocms
Hosts: localhost
Users: userneocms
Password: router123
root@localhost [(none)]> CREATE DATABASE neocms;
Query OK, 1 row affected (0.03 sec)

root@localhost [(none)]> CREATE USER 'userneocms'@'localhost' IDENTIFIED BY 'router123';
Query OK, 0 rows affected (0.03 sec)

root@localhost [(none)]> GRANT ALL PRIVILEGES ON neocms.* TO 'userneocms'@'localhost';
Query OK, 0 rows affected (0.02 sec)

root@localhost [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
Apart from the MySQL server, to create a Neos CMS database you can also use the MariaDB database. The two databases are almost the same, because they come from the same womb.


4. Install Neos CMS

After you have installed everything, we continue by installing or downloading Neos CMS. On FreeBSD the Neos CMS repository is not available. You can download it from the official site or Github. We start installing Neos CMS by creating the Neos CMS directory. We will use this directory to store all Neos CMS files. Follow the guide below.
root@ns3:~ # cd /usr/local/www
root@ns3:/usr/local/www # mkdir neos
root@ns3:/usr/local/www # cd neos
root@ns3:/usr/local/www/neos #
After you create the neos directory, continue by downloading Neos CMS. Run the following command.
root@ns3:/usr/local/www/neos # composer create-project --no-dev neos/neos-base-distribution .
After that, you connect Neos CMS to the MySQL server database using the following command.
root@ns3:/usr/local/www/neos # ./flow setup:database
DB Driver (pdo_mysql):
  [pdo_mysql] MySQL/MariaDB via PDO
  [mysqli   ] MySQL/MariaDB via mysqli
 > mysqli
Host (127.0.0.1):
Database (---): neocms
Username (---): userneocms
Password (---): router123

Database neocms was connected sucessfully.

Neos:
  Flow:
    persistence:
      backendOptions:
        driver: mysqli
        host: 127.0.0.1
        dbname: neocms
        user: userneocms
        password: router123

The new database settings were written to /usr/local/www/neos/Configuration/Development/Settings.Database.yaml
Run the command below.
root@ns3:/usr/local/www/neos # ./flow doctrine:migrate
Create a Neos CMS user and password with the following command.
root@ns3:/usr/local/www/neos # ./flow user:create --roles Administrator
Please specify the required argument "username": datainchi
Please specify the required argument "password": router123
Please specify the required argument "firstName": mary
Please specify the required argument "lastName": john mary
Created user "datainchi" and assigned the following role: Neos.Neos:Administrator.
Create a Neos CMS site, to import a site from Neos.Demo you can run the command below.
root@ns3:/usr/local/www/neos # ./flow site:import --package-key Neos.Demo
Change the ownership of the /usr/local/www/neos directory to "www:www" and give User permission to change the mode of the file or folder.
root@ns3:/usr/local/www/neos # chown -R www:www /usr/local/www/neos
root@ns3:/usr/local/www/neos # chmod -R 775 /usr/local/www/neos


5. Configure Apache

So that everyone can see your Neos CMS website, a web server is needed. Generally what people use is Apache as a web server. In this article we also use the Apache web server to connect Neos CMS with the web server. The goal is so that you can open Neos CMS or view it in the Google Chrome or other web browser.

Open the "/usr/local/etc/apache24/httpd.conf" file, activate the script below in that file.

LoadModule vhost_alias_module libexec/apache24/mod_vhost_alias.so
LoadModule alias_module libexec/apache24/mod_alias.so
Include etc/apache24/extra/httpd-vhosts.conf

Then you open the "/usr/local/etc/apache24/extra/httpd-vhosts.conf" file, in that file you type the script below.

<VirtualHost 192.168.5.2:80>

    ServerAdmin datainchi@gmail.com
    DocumentRoot "/usr/local/www/neos/Web"
    ServerName datainchi.com
    ServerAlias www.datainchi.com

<Directory /usr/local/www/neos/Web>
Options Indexes FollowSymlinks MultiViews
    AllowOverride All
    Require all granted
</Directory>

    ErrorLog "/var/log/dummy-host.example.com-error_log"
    CustomLog "/var/log/dummy-host.example.com-access_log" common

</VirtualHost>

Restart the Apache web server and php-fpm.
root@ns3:~ # service apache24 restart
root@ns3:~ # service php-fpm restart
Now, it's time for us to test Neos CMS, whether it can run on the Google Chrome web browser or not. Open Google Chrome and type "http://192.168.5.2/setup/login". If there is nothing wrong with the configuration above, your monitor screen will appear as shown in the image below.



If you carry out all the instructions in the article above correctly and you don't miss any scripts, then Google Chrome will display an image like the one below.



Happy! You have successfully installed Neos CMS with Apache web server on FreeBSD. You can now easily create and edit your website via Google Chrome, Modzilla Firefox or other web browsers.
Iwan Setiawan

I Like Adventure: Mahameru Mount, Rinjani Mount I Like Writer FreeBSD

Post a Comment

Previous Post Next Post