kodbox installation wizard

kodbox installation wizard

1. Environment preparation

CPU name ip address use
kodbox 10.0.0.79 equivalent to web
kodbox-mysql 10.0.0.80 Store website or user information

2. kodbox-mysql–>deploy redis and mysql

2.1 deploy redis

2.2.1 Install redis and start the service

yum install -y redis

2.2.2 Modify redis remote access permissions and start the service

grep -wn bind /etc/redis.conf
61:bind 127.0.0.1 172.16.1.80

systemctl enable redis
systemctl start redis

2.2 Deploy MySQL

2.2.1 Install mysql and start the service

yum install -y mariadb-server
systemctl enable mariadb && systemctl start mariadb

2.2.2 Initialize the database

$ mysql_secure_installation 

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

2.2.3 Create kodbox database and user, and authorize

1.进入数据库
mysql -uroot -p123

2.创建kodbox使用的数据库
CREATE DATABASE IF NOT EXISTS kodbox CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

3.创建用户并进行远程授权
grant all on kodbox.* to 'admin'@'localhost' identified by '123456';
grant all on kodbox.* to 'admin'@'172.16.1.%' identified by '123456';

4.刷新权限
FLUSH PRIVILEGES;

3. kodbox–>deploy nginx/php/kodbox

3.1 Deploy nginx

3.1.1 Configure the yum source of nginx and install nginx

$cat /etc/yum.repos.d/nginx.repo

name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

yum install -y nginx
systemctl enable nginx

3.1.2 Configure the kodx.conf file in nginx

server {
  listen 80;
  server_name lwx.kodx.cn;
  root /app/code/kodbox;

  location / {
  index index.php;
  }

  location ~ [^/]\.php(/|$) {
    try_files $uri =404;
    fastcgi_pass unix:/var/run/php-fpm.sock;
    fastcgi_index index.php;
    set $path_info $fastcgi_path_info;
    set $real_script_name $fastcgi_script_name;

   if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
      set $real_script_name $1;
      set $path_info $2;
   }

   fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
   fastcgi_param SCRIPT_NAME $real_script_name;
   fastcgi_param PATH_INFO $path_info;
   include fastcgi_params;
 }
}

nginx -t   #检查语法

3.2 Install php-fpm

3.2.1 Upload the php compressed package and install php

tar -xvf php72w-all.tar.gz
yum localinstall -y *.rpm

chown -R root:nginx /var/lib/php
systemctl enable php-fpm && systemctl start php-fpm

3.2.2 Configuration parameter file

PHP_INI=/etc/php.ini
PHP_FPM=/etc/php-fpm.d/www.conf
 
sed -i \
  -e "s/max_execution_time = 30/max_execution_time = 3600/g" \
  -e "s/max_input_time = 60/max_input_time = 3600/g" \
  -e "s/memory_limit = 128M/memory_limit = 512M/g" \
  -e "s/post_max_size = 8M/post_max_size = 512M/g" \
  -e "s/upload_max_filesize = 2M/upload_max_filesize = 512M/g" \
  ${PHP_INI}
   
sed -i \
  -e "s/pm.max_children = 50/pm.max_children = 100/g" \
  -e "s/pm.start_servers = 5/pm.start_servers = 10/g" \
  -e "s/pm.min_spare_servers = 5/pm.min_spare_servers = 10/g" \
  -e "s/pm.max_spare_servers = 35/pm.max_spare_servers = 50/g" \
  -e "s/;pm.max_requests = 500/pm.max_requests = 500/g" \
  -e "s/user = apache/user = nginx/g" \
  -e "s/group = apache/group = nginx/g" \
  -e "s/;listen.mode = 0660/listen.mode = 0666/g" \
  -e "s/;listen.owner = nobody/listen.owner = nginx/g" \
  -e "s/;listen.group = nobody/listen.group = nginx/g" \
  -e "s/listen = 127.0.0.1:9000/listen = \/var\/run\/php-fpm.sock/g" \
  ${PHP_FPM}
   
 systemctl restart php-fpm

3.3 install kodbox

1.创建站点目录
mkdir -p /app/code/kodbox/
cd /app/code/kodbox/

2.下载有道云压缩包并解压
curl -L "https://api.kodcloud.com/?app/version&download=server.link" -o kodbox.zip
unzip kodbox.zip && rm -f kodbox.zip

3.站点目录进行授权
chown -R nginx:nginx /app/code/kodbox/
chmod -R 755 /app/code/kodbox/

4.重启nginx
systemctl restart nginx

4. kodbox web page configuration

4.1 Website access http://10.0.0.79

After the environmental monitoring is successful, click Next

image-20230220194605622

4.2 Database configuration

Because a separate database server is used here, the mariadb client needs to be installed on the kodbox server

yum install -y mariadb

The storage engine chooses MyISAM, otherwise this page will report an error

image-20230220195430082

image-20230220195209424

Click OK to proceed to the next step

4.3 Account configuration

image-20230220195618461

image-20230220195656005

4.4 Login page

image-20230220195855989

image-20230220195930756

5. Kodbox configures Minio object storage

5.1 Find background management

image-20230220200522385

5.2 Select Storage Management in Storage Files

image-20230220200725903

5.3 Added Minio object storage

Minio installation reference

https://blog.csdn.net/m0_49562857/article/details/129484748?spm=1001.2014.3001.5501

image-20230220200816800

5.4 Minio configuration

Pay attention to the port here. Minio’s default port 9000 is for web services, and 9029 is a port for other devices to access.

Both of these ports can be customized when installing Minio

5.5 Verification

image-20230220204439844

image-20230220204510714

image-20230220204526576

I uploaded a picture, and you can see that this picture is stored separately in my two Minio

Guess you like

Origin blog.csdn.net/m0_49562857/article/details/129484811