GNU/Linux >> Belajar Linux >  >> Cent OS

Cara Menginstal WonderCMS dengan Apache dan Mengenkripsi SSL di CentOS 8

WonderCMS adalah sistem manajemen konten gratis, sumber terbuka, sederhana dan ringan untuk membangun situs web dan blog sederhana. Ini adalah CMS file datar dan tidak memerlukan database apa pun. Proses instalasi sangat sederhana dan tidak memerlukan konfigurasi awal. Ini menawarkan serangkaian fitur yang kaya termasuk, dukungan WYSIWYG, kerangka kerja CSS yang fleksibel, SEO friendly dan banyak lagi.

Dalam tutorial ini, kami akan menunjukkan cara menginstal WonderCMS di CentOS 8 dan mengamankannya dengan Let's Encrypt SSL.

Prasyarat

  • Server yang menjalankan CentOS 8.
  • Kata sandi root dikonfigurasi di server Anda.

Instal Apache dan PHP

Pertama, instal server web Apache, PHP, dan ekstensi PHP lainnya dengan perintah berikut:

dnf install httpd php php-mysqlnd php-curl php-opcache php-xml php-xmlrpc php-gd php-mbstring php-zip php-json wget unzip git -y

Setelah instalasi selesai, buka file php.ini dan ubah beberapa pengaturan:

nano /etc/php.ini

Ubah nilainya sesuai kebutuhan Anda:

memory_limit = 128M
post_max_size = 32M
upload_max_filesize = 16M
max_execution_time = 300
date.timezone = Asia/Kolkata

Simpan dan tutup file setelah Anda selesai. Kemudian, mulai layanan Apache dan restart untuk memulai setelah sistem reboot dengan perintah berikut:

systemctl start httpd
systemctl enable httpd

Unduh WonderCMS

Pertama, unduh WonderCMS versi terbaru dari repositori Git:

cd /var/www/html
git clone https://github.com/robiso/wondercms.git

Setelah unduhan selesai, berikan izin yang sesuai ke direktori yang diunduh dengan perintah berikut:

chown -R apache:apache /var/www/html/wondercms
chmod -R 775 /var/www/html/wondercms

Konfigurasi Apache untuk WonderCMS

Pertama, buat file konfigurasi virtual host Apache baru untuk WonderCMS dengan perintah berikut:

nano /etc/httpd/conf.d/wondercms.conf

Tambahkan baris berikut:

<VirtualHost *:80>
  ServerName wonder.linuxbuz.com
  DirectoryIndex index.php
  DocumentRoot /var/www/html/wondercms  
  Redirect /wondercms/loginURL /loginURL

  ErrorLog /var/log/httpd/linuxbuz.com-error.log
  CustomLog /var/log/httpd/linuxbuz.com-access.log combined

  <Directory /var/www/html/wondercms>
      Options FollowSymLinks
      AllowOverride All
      Require all granted
  </Directory>

</VirtualHost>

Simpan dan tutup file. Kemudian, restart layanan Apache dengan perintah berikut:

systemctl restart httpd

Anda juga dapat memeriksa status layanan Apache dengan perintah berikut:

systemctl status httpd

Anda akan melihat output berikut:

? httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/httpd.service.d
           ??php-fpm.conf
   Active: active (running) since Wed 2020-02-19 08:51:34 EST; 1min 25s ago
     Docs: man:httpd.service(8)
 Main PID: 4716 (httpd)
   Status: "Total requests: 6; Idle/Busy workers 100/0;Requests/sec: 0.0759; Bytes served/sec: 812 B/sec"
    Tasks: 278 (limit: 12558)
   Memory: 43.1M
   CGroup: /system.slice/httpd.service
           ??4716 /usr/sbin/httpd -DFOREGROUND
           ??4718 /usr/sbin/httpd -DFOREGROUND
           ??4719 /usr/sbin/httpd -DFOREGROUND
           ??4720 /usr/sbin/httpd -DFOREGROUND
           ??4721 /usr/sbin/httpd -DFOREGROUND
           ??4935 /usr/sbin/httpd -DFOREGROUND

Feb 19 08:51:34 centos8 systemd[1]: Starting The Apache HTTP Server...

Amankan WonderCMS dengan Let's Encrypt SSL

Selanjutnya, instal klien Certbot Let's Encrypt dengan perintah berikut:

wget https://dl.eff.org/certbot-auto
mv certbot-auto /usr/local/bin/certbot-auto
chown root /usr/local/bin/certbot-auto
chmod 0755 /usr/local/bin/certbot-auto

Sekarang, jalankan perintah berikut untuk mendapatkan dan menginstal sertifikat SSL untuk situs web WonderCMS Anda.

certbot-auto --apache -d wonder.linuxbuz.com

Perintah di atas pertama-tama akan menginstal semua dependensi yang diperlukan di server Anda. Setelah terinstal, Anda akan diminta untuk memberikan alamat email dan menerima persyaratan layanan seperti yang ditunjukkan di bawah ini:

Catatan :Jika Anda akan mendapatkan kesalahan terkait sertifikat SSL, restart layanan Apache dan jalankan perintah di atas lagi.

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): [email protected]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y 


Obtaining a new certificate
Performing the following challenges:
http-01 challenge for wonder.linuxbuz.com
Waiting for verification...
Cleaning up challenges
Deploying Certificate to VirtualHost /etc/nginx/conf.d/wondercms.conf

Selanjutnya, Anda harus memilih apakah akan mengarahkan ulang lalu lintas HTTP ke HTTPS seperti yang ditunjukkan di bawah ini:

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

Ketik 2 dan tekan Enter untuk melanjutkan. Setelah instalasi selesai, Anda akan melihat output berikut:

Redirecting all traffic on port 80 to ssl in /etc/nginx/conf.d/wondercms.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://wonder.linuxbuz.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=wonder.linuxbuz.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/wonder.linuxbuz.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/wonder.linuxbuz.com/privkey.pem
   Your cert will expire on 2020-03-23. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot-auto
   again with the "certonly" option. To non-interactively renew *all*
   of your certificates, run "certbot-auto renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

Konfigurasi Firewall dan SELinux

Selanjutnya, Anda perlu membuat aturan firewall untuk mengizinkan layanan HTTP dan HTTPS dari jaringan eksternal. Anda dapat mengizinkannya dengan perintah berikut:

firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload

Selanjutnya, Anda perlu mengkonfigurasi SELinux untuk WonderCMS. Anda dapat mengkonfigurasi SELinux menggunakan perintah berikut:

setsebool httpd_can_network_connect on -P
chcon -R -u system_u -t httpd_sys_rw_content_t -r object_r /var/www/html/wondercms

Terakhir, restart layanan Apache untuk menerapkan perubahan:

systemctl restart httpd

Akses WonderCMS

Sekarang, buka browser web Anda dan ketik URL https://wonder.linuxbuz.com. Anda akan diarahkan ke halaman beranda WonderCMS:

Sekarang, salin kata sandi dari halaman di atas dan klik Cjilat untuk masuk tombol. Anda akan melihat halaman berikut:

Tempelkan sandi dan klik Login tombol. Anda akan melihat halaman berikut:

Selanjutnya, klik Setelan => Keamanan . Anda akan melihat halaman berikut:

Ubah URL login, sandi, dan klik UBAH SANDI tombol.

Kesimpulan

Selamat! Anda telah berhasil menginstal dan mengamankan WonderCMS di CentOS 8 dengan Let's Encrypt SSL. Sekarang Anda dapat meng-host blog dan situs web Anda sendiri dengan mudah menggunakan WonderCMS.


Cent OS
  1. Cara Menginstal WonderCMS dengan Nginx dan Mengenkripsi SSL di CentOS 7

  2. Cara Install Automad CMS dengan Apache dan Lets Encrypt di Debian 10

  3. Cara Menginstal Let's Encrypt dengan Apache di CentOS 7

  1. Cara Menginstal WordPress dengan Nginx dan Mengenkripsi SSL di CentOS 8

  2. Cara Menginstal Forum ElkArte dengan Apache dan Mengenkripsi di Debian 10

  3. Cara Menginstal DokuWiki dengan Nginx dan Mari mengenkripsi SSL di CentOS 8

  1. Cara Install Flarum Forum dengan Nginx dan LE SSL di CentOS 8

  2. Cara Menginstal Askbot dengan Nginx dan Mengamankan dengan Lets Encrypt di CentOS 8

  3. Cara Menginstal Forum ElkArte dengan Apache dan Mengenkripsi SSL di CentOS 8