Home / How To / How to install WonderCMS with Apache and let's encrypt SSL on CentOS 8

How to install WonderCMS with Apache and let's encrypt SSL on CentOS 8



WonderCMS is a free, open source, simple and easy content management system for building simple websites and blogs. It is a flat file CMS and requires no database. The installation process is very simple and requires no initial configuration. It offers a rich set of features including, WYSIWYG support, flexible CSS framework, SEO friendly and many more.

In this tutorial, we will show you how to install WonderCMS on CentOS 8 and secure it with Let & # 39; s Encrypt SSL. [19659003] Prerequisites

  • A server running CentOS 8.
  • A root password is configured on your server.

Install Apache and PHP

First install Apache web server, PHP and other PHP extensions with the following command:

  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 

When the installation is complete, open the php.ini file and change some settings:

  nano /etc/php.inivud1
9659009??Change value according to your requirement:

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

Save and close the file when you are done. Then start the Apache service and restart it to start after system startup with the following command:

  systemctl start httpd 
systemctl enable httpd

Download WonderCMS

First download the latest version of WonderCMS from Git- storage:

  cd / var / www / html 
git-clone https://github.com/robiso/wondercms.git Chapter19659009 ?? When the download is complete, give proper permissions to the downloaded directory with the following command:

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

Configure Apache for WonderCMS

First create a new Apache virtual configuration file host of WonderCMS with the following command:

  nano /etc/httpd/conf.d/wondercms.confebrit19659009vardAdd the following lines: 

  
Server name 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


Alternative FollowSymLinks
AllowOrrride All
Require everyone granted



Save and close the file. Then restart the Apache service with the following command:

  systemctl restart httpd 

You can also check the status of the Apache service with the following command:

  systemctl status httpd 

You should see the following output

 ? httpd.service - Apache HTTP server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor setting: 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
Document: man: httpd.service (8)
Main PID: 4716 (httpd)
Status: "Total Requests: 6; Vacant / Busy Workers 100/0; Request / Sec: 0.0759; Bytes Served / Sec: 812 B / Sec"
Details: 278 (limit: 12558)
Memory: 43.1 M
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

19 feb. 08:51:34 centos8 systemd [1]: Launch Apache HTTP server ...

Secure WonderCMS with Let's Encrypt SSL

Then install the Certbot Let's Encrypt client with the following command:

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

Now run the following command for to get and install an SSL certificate for your WonderCMS site.

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

The above command first installs all the necessary dependencies on your server. Once installed, you will be prompted to enter an email address and accept the service shown below:

Note : If you receive any SSL certificate related error, restart the Apache service and run the above command again.

  Saves debug log to /var/log/letsencrypt/letsencrypt.log
Selected plugins: Authenticator apache, Install apache
Enter Email Address (Used for Emergency Renewal and Security Messages) (Enter & # 39; c & # 39; to
cancel): [email protected]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Read the terms of use at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree to register on the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A) gree / (C) ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Should you be willing to share your email address with Electronic Frontier
Foundation, a founding partner of Let & # 39; s Encrypt project and the nonprofit
organization developing Certbot? We want to send an e-mail about our work
web encryption, EFF news, campaigns and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y) es / (N) o: Y


Get a new certificate
Perform the following challenges:
http-01 challenge for wonder.linuxbuz.com
Waiting for verification ...
Cleaning of challenges
Distribute certificates to VirtualHost /etc/nginx/conf.d/wondercms.conf

Then you have to choose whether you want to redirect HTTP traffic to HTTPS as shown below:

  Choose whether you want to redirect HTTP traffic to HTTPS or remove HTTP access or not.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No Redirect - Do not make any further changes to the web server configuration.
2: Redirect - Makes all requests redirect to secure HTTPS access. Select this for
new websites, or if you are sure your site is working on HTTPS. You can undo this
change by editing your web server configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] and then [enter] (press & # 39; c & # 39; to cancel): 2

Type 2 and hit Enter to continue. When the installation is complete, you should see the following output:

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

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

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

IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved to:
/etc/letsencrypt/live/wonder.linuxbuz.com/fullchain.pem
Your key file has been saved to:
/etc/letsencrypt/live/wonder.linuxbuz.com/privkey.pem
Your certificate expires 2020-03-23. To get a new or fine tuned
version of this certificate in the future, simply run certbot-auto
again with the "certonly" option. Not to renew * everything *
of your certificates, run "certbot-auto-renewal"
- If you like Certbot, you can consider supporting our work by:

Donate to ISRG / Let & # 39; s Encrypt: https://letsencrypt.org/donate
Donate to EFF: https://eff.org/donate-le

Configure Firewall and SELinux

Next, you must create a firewall rule to allow HTTP and HTTPS service from external networks. You can allow it with the following command:

  firewall-cmd --permanent --add-service = http 
  firewall-cmd --permanent --add-service = https 
firewall-cmd --reload [19659008] Next, you must configure SELinux for WonderCMS. You can configure SELinux with the following command:

  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

Finally, restart Apache service to restart the Apache service apply the changes:

  systemctl restart httpd 

Access WonderCMS

Now open your browser and type the URL https://wonder.linuxbuz.com . You will be redirected to the WonderCMS website:

 WonderCMS was successfully installed

Now, copy the password from the page above and click the C button to log in to the button. You should see the following page:

 WonderCMS Login

Paste the password and click the Login button. You should see the following page:

 WonderCMS Admin Mode

Then click Settings => Security . You should see the following page:

 WonderCMS Dashboard

Change your login address, password and click the CHANGE PASSWORD button.

Conclusion

Congratulations! you have installed and secured WonderCMS on CentOS 8 with Let & # 39; s Encrypt SSL. You can now host your own blog and website with the help of WonderCMS.


Source link