Hướng dẫn cài đặt WordPress trên CentminMod

7
0

Sau khi bạn đã cài đặt hoàn tất CentminMod ở bài hướng dẫn trước của mình. Trong bài này mình sẽ hướng dẫn bạn cài đặt WordPress mặc định trên CentminMod.

CentminMod quản lý các tính năng với bảng menu. Để mở bảng menu lên thì tại bên trong ssh bạn nhập lệnh centmin

centmin

Sau đó bạn hãy nhập vào một số thông tin yêu cầu như Email.

Hướng dẫn cài đặt WordPress trên CentminMod

Sau khi chọn menu số 22 là Add WordPress Nginx vhost + Cache plugin. Bạn nhập vào các thông tin sau

anh 15

Nhập vào các thông tin được gợi ý trong bảng điều khiển để cài đặt WordPress. Mình sẽ chủ thích ở các phần được tô đậm bên dưới. Bạn hãy xem kỹ và thực hiện nhé

-------------------------------------------------------------
Setup full Nginx vhost + WordPress + WP Plugins
-------------------------------------------------------------

---------------------------------------------------------------
Important Information
---------------------------------------------------------------


Do you want to continue with Nginx vhost site creation ? [y/n] y <= Chọn Y

Enter vhost domain name you want to add (without www. prefix): vpscanban.com <= nhập vào tên miền

Create a self-signed SSL certificate Nginx vhost? [y/n]: y <= Chọn Y
Theme Setup:
Install CyberChimps Responsive Theme (cyberchimps.com/responsive-theme/) [y/n]: n <= Chọn nWordPress Setup:

Not a fan of Gutenberg Editor ? You can switch to Classic Editor
If you run into Gutenberg Editor issues, you can later switch to
the Classic Editor https://wordpress.org/plugins/classic-editor/
Install Classic Editor WordPress Plugin ? [y/n]: n <= Chọn y/n để cài Plugin kèm theo

Autoptimize WP Plugin is installed by default. Do you want to install
companion Autoptimize Gzip Plugin to precompresses js/css optimized files
details at https://community.centminmod.com/threads/15314/
Install Autoptimize Gzip Companion WordPress Plugin ? [y/n]: y <= Chọn y/n để cài Plugin kèm theo

Google Native LazyLoad Plugin https://wordpress.org/plugins/native-lazyload/
Install Google Native LazyLoad Plugin ? [y/n]: y <= Chọn y/n để cài Plugin kèm theo

Set custom WP Admin Display Name ? [y/n]: y <= Chọn y
Enter Custom WP Admin Display Name: VPSCANBAN
Install WordPress in subdirectory /blog ? [y/n]: n <= Chọn n
Disable Auto Generated WP Admin Username / Password ? [y/n]: y <= Chọn y
Disable wp-login.php password protection ? (less security) [y/n]: y <= Chọn y

--------------------------
!! Security Note !!
--------------------------
Please choose a stronger Username/Password Combination

Enter desired WP Admin Username: admin <= Đặt tên đăng nhập
Enter desired WP Admin Password: Quan@2022 <= Đặt mật khẩu
Enter email address for Admin User for WordPress Installation: [email protected]

Default is to install KeyCDN WP Cache Enabler Plugin
as it's more stable and reliable than WP Super Cache.
Redis cache may have issues with caching due to long 6hr cache TTL
You can select which caching method to use below:

--------------------------------------------------------
        WordPress Caching
--------------------------------------------------------
1) KeyCDN Cache Enabler
2) Redis Nginx Level Caching
3) WordPress Super Cache
--------------------------------------------------------
Enter option [ 1 - 3 ] 2 <= Chọn Plugin cache kèm theo

you selected option 2 (Redis Nginx Level Cache) [wpscache=redis]

Create FTP username for vhost domain (enter username):
Do you want to auto generate FTP password (recommended) [y/n]: y <= Chọn y/n để tạo FTP

FTP username you entered:
FTP password auto generated: stkRu^3K{75a3y{>Cfe=&c$:,|

Missing login

include file /usr/local/nginx/conf/wpcacheenabler_map.conf add to nginx.conf
---------------------------------------------------------------
SSL Vhost Setup...
---------------------------------------------------------------

--2022-05-09 09:30:44--  https://gist.githubusercontent.com/centminmod/020e3580eb03f1c36ced83b94fe4e1c5/raw/origin.crt
Resolving gist.githubusercontent.com... 185.199.110.133, 185.199.108.133, 185.199.111.133, ...
Connecting to gist.githubusercontent.com|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2154 (2.1K) [text/plain]
Saving to: ‘/usr/local/nginx/conf/ssl/cloudflare/vpscanban.com/origin.crt’

     0K ..                                                    100% 16.3M=0s

2022-05-09 09:30:44 (16.3 MB/s) - ‘/usr/local/nginx/conf/ssl/cloudflare/vpscanban.com/origin.crt’ saved [2154/2154]

---------------------------------------------------------------
Generating self signed SSL certificate...
CSR file can also be used to be submitted for paid SSL certificates
If using for paid SSL certificates be sure to keep both private key and CSR safe
creating CSR File: vpscanban.com.csr
creating private key: vpscanban.com.key
creating self-signed SSL certificate: vpscanban.com.crt

[req]
default_bits       = 2048
distinguished_name = req_distinguished_name
req_extensions     = v3_req
prompt = no
[req_distinguished_name]
C = US
ST = California
L = Los Angeles
O = vpscanban.com
OU = vpscanban.com
CN = vpscanban.com
[v3_req]
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names
[alt_names]
DNS.1 = vpscanban.com
DNS.2 = www.vpscanban.com

authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names

[alt_names]
DNS.1 = vpscanban.com
DNS.2 = www.vpscanban.com

Generating a 2048 bit RSA private key
..+++
...+++
writing new private key to 'vpscanban.com.key'
-----
                DNS:vpscanban.com, DNS:www.vpscanban.com
Signature ok
subject=/C=US/ST=California/L=Los Angeles/O=vpscanban.com/OU=vpscanban.com/CN=vpscanban.com
Getting Private key

---------------------------------------------------------------
Generating dhparam.pem file - can take a few minutes...
Generating DH parameters, 2048 bit long safe prime, generator 2
This is going to take a long time


include file /usr/local/nginx/conf/redisupstream.conf add to nginx.conf
------------------------------------------------------------
Setup WordPress + Redis Nginx Level Cache for vpscanban.com
------------------------------------------------------------

Using full static page caching may cause problems for mobile & tablet device
visitors depending on your WP themes used so you may want to exclude those

Do you want to exclude mobile/tablet devices from full page caching ? [y/n]: y
Downloading WordPress 5.9.3 (en_US)...
md5 hash verified: 0394271c56837b7d209b57eadec0b7b8
Success: WordPress downloaded.
Success: Generated 'wp-config.php' file.
13 23 * * * /usr/local/src/centminmod/tools/autoprotect.sh >/dev/null 2>&1
0 */4 * * * /usr/bin/cminfo_updater 2>/dev/null
22 */12 * * * /usr/local/src/centminmod/tools/csfcf.sh auto >/dev/null 2>&1
11 */12 * * * /usr/local/src/centminmod/tools/jetpackips.sh >/dev/null 2>&1
0 0 * * 5 /usr/local/src/centminmod/tools/cf-authenticated-origin-cert-update.sh update >/dev/null 2>&1
#*/15 * * * * sleep 187s > /dev/null 2>&1; curl -skD - -H "Cookie: wordpress_logged_in" "http://vpscanban.com/wp-cron.php?doing_wp_cron" -o /dev/null 2>&1
Success: WordPress installed successfully.
Success: Updated user 157992.
Success: Rewrite structure set.
Success: Rewrite rules flushed.
------------------------------------------------------------
Installing Nginx Helper (2.2.2)
Downloading installation package from https://downloads.wordpress.org/plugin/nginx-helper.2.2.2.zip...
Unpacking the package...
Installing the plugin...
Plugin installed successfully.
Activating 'nginx-helper'...
Plugin 'nginx-helper' activated.
Success: Installed 1 of 1 plugins.
------------------------------------------------------------

------------------------------------------------------------
Created uninstall script
/root/tools/wp_uninstall_vpscanban.com.sh
------------------------------------------------------------
------------------------------------------------------------
Created wp_updater_vpscanban.com.sh script
/root/tools/wp_updater_vpscanban.com.sh
------------------------------------------------------------
154
15
final 154
final 15
13 23 * * * /usr/local/src/centminmod/tools/autoprotect.sh >/dev/null 2>&1
0 */4 * * * /usr/bin/cminfo_updater 2>/dev/null
22 */12 * * * /usr/local/src/centminmod/tools/csfcf.sh auto >/dev/null 2>&1
11 */12 * * * /usr/local/src/centminmod/tools/jetpackips.sh >/dev/null 2>&1
0 0 * * 5 /usr/local/src/centminmod/tools/cf-authenticated-origin-cert-update.sh update >/dev/null 2>&1
#*/15 * * * * sleep 187s > /dev/null 2>&1; curl -skD - -H "Cookie: wordpress_logged_in" "http://vpscanban.com/wp-cron.php?doing_wp_cron" -o /dev/null 2>&1
0 */8 * * * sleep 154s > /dev/null 2>&1;/root/tools/wp_updater_vpscanban.com.sh >/dev/null 2>&1

-------------------------------------------------------------
generated nginx include file [initial]: /usr/local/nginx/conf/autoprotect/demodomain.com/autoprotect-demodomain.com.conf
generated nginx include file [initial]: /usr/local/nginx/conf/autoprotect/vpscanban.com/autoprotect-vpscanban.com.conf

autoprotect.sh run completed...

Reloading nginx configuration (via systemctl):  [  OK  ]
service nginx reload
Reloading nginx configuration (via systemctl):  [  OK  ]

nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

service php-fpm restart
Redirecting to /bin/systemctl restart php-fpm.service

-------------------------------------------------------------
FTP hostname : 139.180.221.26
FTP port : 21
FTP mode : FTP (explicit SSL)
FTP Passive (PASV) : ensure is checked/enabled
FTP username created for vpscanban.com :
FTP password created for vpscanban.com : stkRu^3K{75a3y{>Cfe=&c$:,|
-------------------------------------------------------------
vhost for vpscanban.com created successfully

domain: http://vpscanban.com
vhost conf file for vpscanban.com created: /usr/local/nginx/conf/conf.d/vpscanban.com.conf

vhost ssl for vpscanban.com created successfully

domain: https://vpscanban.com
vhost ssl conf file for vpscanban.com created: /usr/local/nginx/conf/conf.d/vpscanban.com.ssl.conf
/usr/local/nginx/conf/ssl_include.conf created
Self-signed SSL Certificate: /usr/local/nginx/conf/ssl/vpscanban.com/vpscanban.com.crt
SSL Private Key: /usr/local/nginx/conf/ssl/vpscanban.com/vpscanban.com.key
SSL CSR File: /usr/local/nginx/conf/ssl/vpscanban.com/vpscanban.com.csr
Backup SSL Private Key: /usr/local/nginx/conf/ssl/vpscanban.com/vpscanban.com-backup.key
Backup SSL CSR File: /usr/local/nginx/conf/ssl/vpscanban.com/vpscanban.com-backup.csr

upload files to /home/nginx/domains/vpscanban.com/public
vhost log files directory is /home/nginx/domains/vpscanban.com/log

------------------------------------------------------------
SSH commands to uninstall created WordPress install and Nginx vhost:
  /root/tools/wp_uninstall_vpscanban.com.sh
------------------------------------------------------------

------------------------------------------------------------
Wordpress Auto Updater created at:
  /root/tools/wp_updater_vpscanban.com.sh
cronjob set for every 8 hours update (3x times per day)
------------------------------------------------------------
#Thông tin của website.
WordPress domain: vpscanban.com
Wordpress DB Name: wp1984427264db_19872
Wordpress DB User: wpdb19872u3857
Wordpress DB Pass: wpdbcsvcilcMdM1Rin2uIp16581
Wordpress Admin User ID: 157992
Wordpress Admin User: admin
Wordpress Admin Pass: Quan@2022
Wordpress Admin Email: [email protected]
Wordpress Admin Display Name: VPSCANBAN
Reloading nginx configuration (via systemctl):  [  OK  ]

-------------------------------------------------------------
Current vhost listing at: /usr/local/nginx/conf/conf.d/


May 9   09:00   1.1K   demodomain.com.conf
May 9   09:17   1.4K   virtual.conf
May 9   09:34   4.3K   vpscanban.com.conf
May 9   09:34   6.1K   vpscanban.com.ssl.conf

-------------------------------------------------------------
Current vhost ssl files listing at: /usr/local/nginx/conf/ssl/vpscanban.com


May 9   09:30   1.7K   vpscanban.com.key
May 9   09:30   1.2K   vpscanban.com.csr
May 9   09:30   1.6K   vpscanban.com.crt
May 9   09:32   424    dhparam.pem

------------------------------------------------------------
To complete setup:
  1. Enable Permalinks (DO NOT use links with .html extensions for performance reasons) i.e. /%post_id%/%postname%/
  2. Settings Menu > Nginx Helper Enable Purging set Caching Method to Redis Cache, & set Purging Conditions
  3. Settings Menu > CDN Enabler and set CDN up or disable plugin
  4. Appearance > Theme Options (Responsive theme) > Home Page nav bar > Uncheck Overrides WordPress front page option
------------------------------------------------------------

-------------------------------------------------------------
vhost for vpscanban.com wordpress setup successfully
vpscanban.com setup info log saved at:
/root/centminlogs/centminmod_124.00stable.s5_090522-092412_wordpress_addvhost.log
-------------------------------------------------------------
wpinfo.sh script saved at:
/usr/local/nginx/conf/wpincludes/vpscanban.com/wpinfo.sh
-----------------------------------------------------------

Bây giờ bạn hãy truy cập vào tên miền để vào website nhé.

CleanShot 2022 05 09 at 16.52.39@2x
anh 16

Chúc bạn thực hiện thành công.

Đỗ Trung Quân
WRITTEN BY

Đỗ Trung Quân

Nguồn nội dung này đến từ Website DoTrungQuan.info

Trả lời