FreeBSD Tutorials Setup PyroCMS The PHP CMS built for Laravel

Laravel is one of the most popular web application frameworks for the PHP programming language. The application has an expressive and elegant syntax and its development has been a great experience. With Laravel developers can easily build websites quickly and efficiently

Meanwhile, PyroCMS is built with Laravel and feels like an extension and makes it easy to build better websites and apps quickly. PyroCMS is not only a content management system but also a powerful and modern development engine and platform.

This Content Management System (CMS) is often used by beginner to professional blogs. PyroCMS uses a popular framework so it is easy to understand.

PyroCMS is an open source, object-oriented content management system application built using the PHP and Laravel languages. PyroCMS is easy to use, looks great and uses some clever caching to keep everything running smoothly. It can be easily extended with Modules, Widgets and Plugins that are easy to create and can be customized with Themes.

According to the official PyroCMS website, the following are the main features of this CMS.
  1. Built with PHP language which has proven its reliability.
  2. OPEN SOURCE Application.
  3. It has a very simple Control panel display that is built based on standard patterns and principles such as APIs.
  4. Responsive Control Panel with easy content management.
  5. Multi language support.
  6. Rapid development.


1. System requirements

To run PyroCMS on FreeBSD, you need to fulfill several conditions.

OS: FreeBSD 13.2
Apache version: Apache24
PHP-FPM
PHP version: PHP82
mod PHP82 dan PHP82 extension
php82-xmlwriter, php82-xmlreader, php82-fileinfo
mysql80-server


2. Enable mod_PHP on Apache

Since PyroCMS is built with the PHP language, as the main topic in this article we will enable mod_PHP on the Apache24 web server.

Use the following command to start enabling mod_PHP.
root@ns3:~ # cd /usr/ports/lang/php82
root@ns3:/usr/ports/lang/php82 # make install clean
root@ns3:/usr/ports/lang/php82 # cd /usr/ports/www/mod_php82
root@ns3:/usr/ports/www/mod_php82 # make install clean
root@ns3:/usr/ports/www/mod_php82 # cd /usr/ports/databases/php82-mysqli
root@ns3:/usr/ports/databases/php82-mysqli # make install clean
root@ns3:~ # pkg install php82-xmlwriter
root@ns3:~ # pkg install php82-xmlreader
root@ns3:~ # pkg install php82-fileinfo
After that, type the following script into the "/usr/local/etc/apache24/httpd.conf" file.

LoadModule php_module         libexec/apache24/libphp.so

<IfModule dir_module>
    DirectoryIndex index.php index.html
</IfModule>

AddType application/x-httpd-php .php
AddType application/x-httpd-php .php .phtml .php3
AddType application/x-httpd-php-source .phps

Continue by creating a php.ini file, just copy it from the existing one.
root@ns3:/usr/ports/databases/php82-mysqli # cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
Then you activate the following script.

cgi.fix_pathinfo=0

In this article we will activate PHP-FPM, with the aim of making the process of reading PHP files faster. We will not discuss the PHP-FPM installation process. You can read the previous article.


Restart PHP-FPM and Apache24, so that all PHP modules can be read by Apache.
root@ns3:~ # service apache24 restart
root@ns3:~ # service php-fpm restart


3. Install Composer PHP

Before we install PHP composer, first activate the SSL mod in the "/usr/local/etc/php.ini" file. Use the command below to create an SSL mod.
root@ns3:~ # cd /etc/ssl
root@ns3:/etc/ssl # wget http://curl.haxx.se/ca/cacert.pem
Enter the SSL file that we created above into the "/usr/local/etc/php.ini" file.

openssl.cafile=/etc/ssl/cacert.pem

On FreeBSD, PHP composer can be installed in two ways, namely via the PKG and curl packages. To make it easier, we just use Curl.
root@ns3:/etc/ssl # cd /tmp
root@ns3:/tmp # curl -sS https://getcomposer.org/installer -o composer-setup.php
root@ns3:/tmp # php composer-setup.php --install-dir=/usr/local/bin --filename=composer
Check composer version.
root@ns3:/tmp # composer --version
Composer version 2.6.6 2023-12-08 18:32:26


4. Create a MySQL Database

So that PyroCMS can run perfectly, it needs a database to support it. OK, now let's move on to creating a database for PyroCMS. Because what is running on our FreeBSD server is the MySQL server, so we use the MySQL server as the database.
root@ns3:/tmp # mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.35 Source distribution

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

root@localhost [(none)]>
Create a database:
database name: pyrocma
username: userpyrocms
Password: router123
root@localhost [(none)]> CREATE DATABASE pyrocms CHARACTER SET utf8;
Query OK, 1 row affected, 1 warning (0.13 sec)

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

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

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


5. Install PyroCMS

The last installation we have to do is PyroCMS. Because in this article we will use Apache24, place the PyroCMS folder in "/usr/local/www".
root@ns3:~ # cd /usr/local/www
root@ns3:/usr/local/www # git clone https://github.com/pyrocms/pyrocms.git
Update composer.
root@ns3:/usr/local/www # cd pyrocms
root@ns3:/usr/local/www/pyrocms # composer update
root@ns3:/usr/local/www/pyrocms # composer install
Use the following command to install PyroCMS.
root@ns3:/usr/local/www/pyrocms # php artisan install
The MIT License (MIT)
Copyright (c) 2018 AnomalyLabs, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the &quot;Software&quot;), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Other Licenses
All add-ons are offered under their own license. Most of the add-ons available and
in our marketplace are either completely free and licensed under MIT as well, or
they are commercial add-ons and offered under our standard commercial license.
These add-ons are sold on a &quot;per-instance&quot; basis. This means one add-on purchase
per live site. Development copies and stages are included.

 Do you agree to the provided license and terms of service? (yes/no) [no]:
 > yes

 What database driver would you like to use? [mysql, pgsql, sqlite, sqlsrv] [mysql]:
 >

 What is the hostname of your database? [localhost]:
 >

 What is the name of your database?:
 > pyrocms

 Enter the username for your database connection [root]:
 > userpyrocms

 Enter the password for your database connection:
 > router123

 Enter the name of your application [Default]:
 >

 Enter the reference slug for your application [default]:
 >

 Enter the primary domain for your application [localhost]:
 >

 Enter the desired username for the admin user [admin]:
 >

 Enter the desired email for the admin user:
 > datainchi@gmail.com

 Enter the desired password for the admin user:
 > router123456

 Enter the default locale [en]:
 >

 Enter the default timezone [UTC]:
 >

1/61 Running core migrations.
2/61 Running application migrations.
3/61 Installing: Navigation Module
4/61 Installing: Users Module
5/61 Installing: Configuration Module
6/61 Installing: Preferences Module
7/61 Installing: Settings Module
8/61 Installing: Blocks Module
9/61 Installing: Files Module
10/61 Installing: Search Module
11/61 Installing: Pages Module
12/61 Installing: Repeaters Module
13/61 Installing: Addons Module
14/61 Installing: Dashboard Module
15/61 Installing: Posts Module
16/61 Installing: Streams Module
17/61 Installing: Variables Module
18/61 Installing: Redirects Module
19/61 Installing: XML Feed Dashboard Widget
20/61 Installing: HTML Block Extension
21/61 Installing: Throttle Security Check Extension
22/61 Installing: Default Authenticator Extension
23/61 Installing: Private Storage Adapter Extension
24/61 Installing: User Security Check Extension
25/61 Installing: Default Page Handler Extension
26/61 Installing: Page Link Type
27/61 Installing: Robots Extension
28/61 Installing: URL Link Type Extension
29/61 Installing: WYSIWYG Block Extension
30/61 Installing: Sitemap Extension
31/61 Reloading application.
32/61 Seeding: Navigation Module
33/61 Seeding: Users Module
34/61 Seeding: Configuration Module
35/61 Seeding: Preferences Module
36/61 Seeding: Settings Module
37/61 Seeding: Blocks Module
38/61 Seeding: Files Module
39/61 Seeding: Search Module
40/61 Seeding: Pages Module
41/61 Seeding: Repeaters Module
42/61 Seeding: Addons Module
43/61 Seeding: Dashboard Module
44/61 Seeding: Posts Module
45/61 Seeding: Streams Module
46/61 Seeding: Variables Module
47/61 Seeding: Redirects Module
48/61 Seeding: XML Feed Dashboard Widget
49/61 Seeding: HTML Block Extension
50/61 Seeding: Throttle Security Check Extension
51/61 Seeding: Default Authenticator Extension
52/61 Seeding: Private Storage Adapter Extension
53/61 Seeding: User Security Check Extension
54/61 Seeding: Default Page Handler Extension
55/61 Seeding: Page Link Type
56/61 Seeding: Robots Extension
57/61 Seeding: URL Link Type Extension
58/61 Seeding: WYSIWYG Block Extension
59/61 Seeding: Sitemap Extension
60/61 Running other migrations.
61/61 Running project seeds.
root@ns3:/usr/local/www/pyrocms #
See the results, by opening the "/usr/local/www/pyrocms/.env" file.
root@ns3:/usr/local/www/pyrocms # ee .env
APP_ENV=local
INSTALLED="true"
APP_KEY=17gYmbMPAwfq0OYAwjLdOpVNXp9oYd1a
APP_DEBUG=true
DEBUG_BAR=false
DB_CONNECTION=mysql
DB_HOST=localhost
DB_DATABASE=pyrocms
DB_USERNAME=userpyrocms
DB_PASSWORD=router123
APPLICATION_NAME=Default
APPLICATION_REFERENCE=default
APPLICATION_DOMAIN=localhost
ADMIN_USERNAME=admin
ADMIN_EMAIL=datainchi@gmail.com
ADMIN_PASSWORD=router123456
APP_LOCALE=en
APP_TIMEZONE=UTC
Run the chown and chmod commands, for ownership and access rights to files.
root@ns3:/usr/local/www/pyrocms # chown -R www:www /usr/local/www/pyrocms/
root@ns3:/usr/local/www/pyrocms # chmod -R 775 /usr/local/www/pyrocms/
The final configuration is, type the following command in the "/usr/local/etc/apache24/httpd.conf
" file.

  Alias /pyrocms "/usr/local/www/pyrocms/"
<Directory "/usr/local/www/pyrocms">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

Restart PHP-FPM and Apache24.
root@ns3:~ # service apache24 restart
root@ns3:~ # service php-fpm restart


6. Test PyroCMS

At this stage, we will test PyroCMS. Is there anything wrong with the configuration you did above?.

Open the Google Chrome web browser, type http://192.168.5.2/pyrocms/



 and http://192.168.5.2/pyrocms/public/



By trying the guide in this article, you can learn more about what PyroCMS is, how to install PyroCMS and use PyroCMS on Apache24. Once you understand, you can apply PyroCMS to create a website or blog.
Iwan Setiawan

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

Post a Comment

Previous Post Next Post