FreeBSD Tutorial - Install Drupal to create a Blog site

Drupal may be a foreign word that is rarely heard by ordinary people, because this word is very rarely heard. However, it is different from people who are involved in website development activities. Drupal has become a term that is familiar to web development workers or developers. This open source makes it easier for website owners to create, develop and manage websites.

Drupal is an open or open source database application, where in its development it uses the programming language PHP. The creation of this database application already has a license or permission from the GPL.

Drupal is a Content Management System (CMS) that was developed in 2000 by students from Belgium. This CMS is also a competitor of other popular CMS such as WordPress and Joomla CMS. If you are a website developer who needs a CMS with many functions, then Drupal could be one of the CMS whitelists that you can try. Just like other CMS, Drupal has many features that can be used to make things easier for users.

If a comparison is drawn with other CMS such as WordPress, Drupal in terms of features can be said to be richer and easier to develop. Due to the many features available, people sometimes mistake Drupal for a CMS which seems confusing. In fact, the features in Drupal are much more complete and easier to develop.

For this reason, it would be a good idea if you want to use this CMS to learn about all the existing features first. Some of the features most frequently asked about by website managers include themes and plugins. Like WordPress, Drupal provides various themes and plugins, both free and paid versions. In the Drupal world, plugins are called modules. So what makes Drupal more special than other popular CMS?.

In this article we will explain how to install and configure Drupal with Apache24, PHP82 and MySQL server. The entire contents of this article were worked on and run on the FreeBSD 13.2 server.


1. System Specifications

  1. OS: FreeBSD 13.2
  2. Hostname: ns3
  3. Domain: datainchi@gmail.com
  4. IP Address: 192.168.5.2
  5. php82-opcache
  6. Database: mysql80-server
  7. PHP version: PHP82
  8. Apache version: apache24
  9. PHP-FPM
  10. mod PHP82 dan PHP82 extension


2. Install php82-opcache

Before we start the Drupal installation process, let's assume that all the applications above are installed and running on your FreeBSD server. If not, you must first install all the applications above.

As a guide, you can read our previous article about the installation process for all the applications above. On our blog site, a guide on how to install the application above is available. In the search menu, you type the title of the article you want to search for. The process is quite easy.

One of the PHP extensions that Drupal really needs is php82-opcache. This PHP extension is able to optimize web applications with caching methods to handle PHP script tasks.

Use the following command to install php82-opcache.
root@ns3:~ # pkg install php82-opcache
The php82-opcache configuration file is named "php.ini". Open the "/usr/local/etc/php.ini" file and activate the script below.

opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.revalidate_freq=2
opcache.enable_cli=1


3. Create a Drupal database

Almost all CMS frameworks use a database as data storage. Likewise with Drupal, you have to install the database so that Drupal can run perfectly. One of the advantages of Drupal is that it can use various kinds of databases, in this article we will use the MySQL server as the Drupal database.
root@ns3:~ # mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.35 Source distribution

root@localhost [(none)]>
After you connect to the MySQL server, we will create
Database name: drupal
User Name: userdrupal
User Password: router123
root@localhost [(none)]> CREATE DATABASE drupal CHARACTER SET utf8;
Query OK, 1 row affected, 1 warning (0.05 sec)

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

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

root@localhost [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)

root@localhost [(none)]>
When creating a database with the MySQL server, it is important for you to remember the database name, user name and user password. Save and always remember the database. Because we will use it to connect to the Drupal server.


4. Install Drupal

So that all Drupal libraries can be installed perfectly, we use a ports system to install Drupal. The following are the commands you type in the PuTTY shell.
root@ns3:~ # cd /usr/ports/www/drupal10
root@ns3:/usr/ports/www/drupal10 # make config
In the dialog menu that appears, check the "MySQL" option and uncheck the others.



After you check the "MySQL" option, just type the command "make install clean".
root@ns3:/usr/ports/www/drupal10 # make install clean
In order for Drupal to connect to apache24, you must include the Drupal script in the "httpd.con" file. Enter the following script into the "/usr/local/etc/apache24/httpd.con" file.

  Alias /drupal "/usr/local/www/drupal10/"
<Directory "/usr/local/www/drupal10">
    Options Indexes FollowSymlinks MultiViews
    AllowOverride All
    Require all granted
</Directory>

To enable CNC support when setting up Drupal with apache24, you need to uncomment the line in the /usr/local/www/drupal10/.htaccess file.

RewriteBase /drupal

RewriteBase /drupal, where drupal is an alias in "/usr/local/etc/apache24/httpd.conf".

After that, you create a Drupal settings file with access rights that match the Drupal defaults.
root@ns3:~ # cd /usr/local/www/drupal10/sites/default
root@ns3:/usr/local/www/drupal10/sites/default # cp default.settings.php settings.php
Restart apache24, dan run Drupal.
root@ns3:/usr/local/www/drupal10/sites/default # service apache24 restart
Open the Google chrome web browser and type "http://192.168.5.2/drupal/core/install.php" or "http://192.168.5.2/drupal". Then in Google Chrome it will appear like the image below.











Enjoy the ease and power of Drupal to create a website or blog site on your FreeBSD server. For further setup and more complex configurations, see the official manual.
Iwan Setiawan

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

Post a Comment

Previous Post Next Post