Harga Domain .WEB.ID Termurah Hanya 10rb

Cara Install Lighttpd dengan PHP, PHP-FPM dan MariaDB pada CentOS 7

Lighttpd adalah server web open source, aman, cepat, fleksibel, dan lebih optimal yang dirancang untuk lingkungan yang sangat kritis dengan penggunaan memori yang lebih sedikit dibandingkan dengan server web lainnya. Dapat menangani hingga 10.000 koneksi dalam satu server dengan manajemen beban cpu yang efektif dan dilengkapi dengan fitur canggih seperti FastCGI, SCGI, Auth, Output-Compression, URL-Rewriting dan banyak lagi.

Lighttpd adalah solusi yang sangat baik untuk server Linux, karena infrastruktur io berkecepatan tinggi yang memungkinkan kita untuk menskalakan beberapa kali kinerja yang lebih baik dengan perangkat keras yang sama daripada dengan web-server alternatif lainnya.

Pada artikel ini, kita akan membahas bagaimana cara install Lighttpd dengan PHP-FPM dan MariaDB pada CentOS/RHEL 7 dengan contoh hostname tecmint.example.com dan IP address 192.168.0.103.

Step 1: Install Lighttpd pada CentOS 7

1. Untuk install Lighttpd, pertama kamu membutuhkan update system software menggunakan command.

2. Selanjutnya, membutuhkan EPEL repository.

3. Setelah EPEL repository aktif, kamu dapat menginstall Lighttpd.

4. Setelah Lighttpd terinstal, kamu dapat menjalankan dan mengaktifkan layanan auto start saat system di reboot.

Jika melihat pesan error seperti di bawah, kamu memerlukan perbaikan.

Buka file /etc/lighttpd/lighttpd.conf dengan editor lainnya.

Ubah line server.use-ipv6 dari enable ke disable.

Now try again to start Lighttpd, it should work 100% without any error messages.

5. Now verify the version of Lighttpd installed on your system using the following command.

6. Now you need to allow HTTP and HTTPS traffic on your firewall.

7. Now open your browser and point to the following URL to see your Lighttpd web server working.

Cara Install Lighttpd dengan PHP, PHP-FPM dan MariaDB pada CentOS 7

Check Lighttpd Page

The default document root directory for Lighttpd is /var/www/lighttpd/ and the main configuration file is located under /etc/lighttpd/lighttpd.conf.

Step 2: Installing MariaDB as MySQL in CentOS 7

8. Next, install MySQL support for Lighttpd using following commands.

Baca Juga:  Menggunakan tar, gzip dan bzip2

9. Once the installation is complete, start, enable and verify the status of MariaDB using following commands.

10. Finally, you will need to secure your MariaDB installation by issuing the following command.

You will be prompted a few different questions regarding your MariaDB installation and how you would like to secure it. You can change the database root user password, disable the test database, disable anonymous users, and disable root login remotely.

Sample Output

11. Try connecting to MySQL server and review the existing databases on your database server with following commands on the terminal.

Baca Juga:  Cara Install Nginx, MySQL/MariaDB dan PHP pada RHEL 8

Sample Output

Step 3: Installing PHP and PHP-FPM with FastCGI on CentOS 7

12. To enable PHP-FPM with FastCGI support, first you need to install PHP along with necessary extensions using following command.

13. Once PHP installed, now enable PHP-FPM and FastCGI support for Lighttpd, to do this you need to install these packages too.

14. Now open a file called /etc/php-fpm.d/www.conf.

Set the user and group to lighttpd.

15. Now start PHP-FPM service and make sure to enable it to automatically start at boot time using the following commands.

Baca Juga:  Cara Mengaktifkan Gzip Compression di Apache

Step 4: Enabling PHP and PHP-FPM with FastCGI in Lighttpd

16. Here, we need to modify three files /etc/php.ini, /etc/lighttpd/modules.conf and /etc/lighttpd/conf.d/fastcgi.conf to enable PHP support for Lighttpd.

Open first file /etc/php.ini.

Un-comment the following line that says line cgi.fix_pathinfo=1.

Then open second file called /etc/lighttpd/modules.conf.

Un-comment the following line that says include “conf.d/fastcgi.conf”.

Next, open third file called /etc/lighttpd/conf.d/fastcgi.conf.

Now add the following container at the bottom of the file and save it.

Restart the Lighttpd service to reflect changes and enable PHP support.

Step 5: Testing PHP and PHP-FPM with FastCGI Support in Lighttpd

17. As We said above that the default document root for Lighttpd is /var/www/lighttpd/. So, here we will create a phpinfo.php file into this directory.

Add the following lines to it. This small piece of code will display information about PHP installation with their versions.

18. Open your browser and navigate to the following links.

Check PHP Support in CentOS 7

You will see working information of PHP, PHP-FPM and MySQL with lots of other modules that are already enabled.

Harga Domain .COM Termurah Hanya 99rb

Di tulis oleh: