# ⽤nginx做负载均衡服务器,配置动静分离

news2024/11/22 11:09:19

⽤nginx做负载均衡服务 器,配置动静分离


文章目录

  • ⽤nginx做负载均衡服务 器,配置动静分离
      • 部署LNMP ,做动态资源
          • nginx安装
          • mysql安装
          • 安装php
          • 配置nginx
          • 配置PHP网络界面
      • node2安装httpd,做静态资源
      • node3源码安装nginx并配置负载均衡器,进行调度
      • 配置负载均衡
      • 实现动静分离

题目:
后端RS服务器⼀台部署LNMP(nginx1.22+mysql8.0+php8.1),⼀台部署
httpd。
要求nginx和php使⽤编译安装
最后要通过访问nginx负载均衡服务器的IP看到动静分离的效果。

环境准备:

主机ip安装的服务
node1192.168.174.170lnmp,动态资源
node2192.168.174.175nginx,静态资源
node3192.168.174.177nginx,做负载均衡

部署LNMP ,做动态资源

nginx安装
//首先关闭防火墙和selinux
[root@node1 ~]# setenforce 0
[root@node1 ~]# sed -ri 's/^(SELINUX=).*/\1disabled/g' /etc/selinux/config
[root@node1 ~]# systemctl disable  --now firewalld.service 

//创建用户
[root@node1 ~]# useradd -rMs /sbin/nologin nginx

//安装所需要的依赖包
[root@node1 ~]# dnf -y install pcre-devel openssl openssl-devel gd-devel gcc gcc-c++ make wget vim

//下载nginx源码包,并解压
[root@node1 ~]# wget https://nginx.org/download/nginx-1.22.0.tar.gz
[root@node1 ~]# tar -xf nginx-1.22.0.tar.gz 
[root@node1 ~]# cd nginx-1.22.0/
[root@node1 nginx-1.22.0]# 

//编译安装
[root@node1 nginx-1.22.0]# ./configure \
> --prefix=/usr/local/nginx \
> --user=nginx \
> --group=nginx \
> --with-debug \
> --with-http_ssl_module \
> --with-http_realip_module \
> --with-http_image_filter_module \
> --with-http_gunzip_module \
> --with-http_gzip_static_module \
> --with-http_stub_status_module 

//开启编译安装
[root@node1 nginx-1.20.2]# make -j $(grep 'processor' /proc/cpuinfo | wc -l) && make install

//安装成功
[root@node1 nginx-1.22.0]# cd /usr/local/nginx/
[root@node1 nginx]# ls
conf  html  logs  sbin

nginx配置

//配置环境变量
[root@node1 nginx]# echo 'export PATH=/usr/local/nginx/sbin:$PATH' > /etc/profile.d/nginx.sh
[root@node1 nginx]# source /etc/profile

//启动服务
[root@node1 nginx]# nginx 
[root@node1 nginx]# ss -anlt
State      Recv-Q     Send-Q           Local Address:Port           Peer Address:Port     Process     
LISTEN     0          128                    0.0.0.0:80                  0.0.0.0:*                    
LISTEN     0          128                    0.0.0.0:22                  0.0.0.0:*                    
LISTEN     0          128                       [::]:22                     [::]:* 

//关闭服务,编写service文件,并设置服务开机自启
[root@node1 nginx]# cat > /usr/lib/systemd/system/nginx.service << EOF
> [Unit]
> Description=nginx server daemon
> After=network.target 
> 
> [Service]
> Type=forking
> ExecStart=/usr/local/nginx/sbin/nginx
> ExecStop=/usr/local/nginx/sbin/nginx -s stop
> ExecReload=/bin/kill -HUP \$MAINPID
>  
> [Install]
> WantedBy=multi-user.target
> EOF


[root@node1 nginx]# systemctl daemon-reload
[root@node1 nginx]# systemctl enable --now nginx.service 
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service.
[root@node1 nginx]# ss -anlt
State      Recv-Q     Send-Q           Local Address:Port           Peer Address:Port     Process     
LISTEN     0          128                    0.0.0.0:80                  0.0.0.0:*                    
LISTEN     0          128                    0.0.0.0:22                  0.0.0.0:*                    
LISTEN     0          128                       [::]:22                     [::]:*

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-YxRm2o2D-1682564464646)(null)]

mysql安装
//安装依赖包
[root@node1 ~]# yum -y install ncurses-devel openssl-devel openssl cmake mariadb-devel

//创建apache服务的用户和组
[root@node1 ~]# useradd -r -M -s /sbin/nologin mysql[root@node1 ~]# cd /usr/local/
[root@node1 local]# chown -R mysql.mysql mysql*
[root@node1 local]# ll |gerp mysql
bash: gerp: command not found
[root@node1 local]# ll |grep mysql
lrwxrwxrwx   1 mysql mysql  36 Oct 19 04:26 mysql -> mysql-8.0.30-linux-glibc2.12-x86_64/
drwxr-xr-x   4 mysql mysql  28 Oct 19 04:23 mysql-8.0.30-linux-glibc2.12-x86_64

[root@node1 ~]# id mysql 
uid=992(mysql) gid=989(mysql) groups=989(mysql)


//下载或导入mysql二进制软件包
[root@node1 ~]# ls
mysql-8.0.30-linux-glibc2.12-x86_64.tar  

//解压软件至/usr/local/
[root@node1 ~]# tar -xf mysql-8.0.30-linux-glibc2.12-x86_64.tar -C /usr/local/
[root@node1 ~]# cd /usr/local/
[root@node1 local]# ls
bin  games    lib    libexec                              nginx  share
etc  include  lib64  mysql-8.0.30-linux-glibc2.12-x86_64  sbin   src

//建立软链接
[root@node1 local]# ln -sv mysql-8.0.30-linux-glibc2.12-x86_64/ mysql
'mysql' -> 'mysql-8.0.30-linux-glibc2.12-x86_64/'
[root@node1 local]# ll mysql
lrwxrwxrwx 1 root root 36 Oct 19 04:26 mysql -> mysql-8.0.30-linux-glibc2.12-x86_64/

//修改目录/usr/local/mysql的属主属组
[root@node1 ~]# cd /usr/local/
[root@node1 local]# chown -R mysql.mysql mysql*
[root@node1 local]# ll |grep mysql
lrwxrwxrwx   1 mysql mysql  36 Oct 19 04:26 mysql -> mysql-8.0.30-linux-glibc2.12-x86_64/
drwxr-xr-x   4 mysql mysql  28 Oct 19 04:23 mysql-8.0.30-linux-glibc2.12-x86_64

[root@node1 local]# ls /usr/local/mysql
bin   include  LICENSE  mysql-8.0.30-linux-glibc2.12-x86_64  share
docs  lib      man      README                               support-files
[root@node1 local]# ln -s /usr/local/mysql/include/ /usr/include/mysql/
[root@node1 local]# echo '/usr/local/mysql/lib/' > /etc/ld.so.conf.d/mysql.conf
[root@node1 local]# vim /etc/man_db.conf
MANDATORY_MANPATH                       /usr/local/mysql/man

//添加环境变量
[root@node1 ~]# echo 'export PATH=/usr/local/mysql/bin:$PATH' > /etc/profile.d/mysql.sh
[root@node1 ~]# source /etc/profile.d/mysql.sh
[root@node1 ~]# which mysql
/usr/local/mysql/bin/mysql

//创建数据存放目录
[root@node1 ~]# mkdir /opt/data
[root@node1 ~]# chown -R mysql.mysql /opt/data/
[root@node1 ~]# ll /opt/
total 0
drwxr-xr-x 2 mysql mysql 6 Oct 19 04:46 data

//初始化数据库
[root@node1 ~]# mysqld --initialize --user=mysql --datadir=/opt/data/
2022-10-19T08:47:34.299683Z 0 [System] [MY-013169] [Server] /usr/local/mysql-8.0.30-linux-glibc2.12-x86_64/bin/mysqld (mysqld 8.0.30) initializing of server in progress as process 27184
2022-10-19T08:47:34.420194Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-10-19T08:47:47.324357Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-10-19T08:47:53.257519Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: B=wdzUpHZ4hq

//保存临时密码,方便后面使用
[root@node1 ~]# echo 'B=wdzUpHZ4hq' > pass

//生成配置文件
[root@node1 ~]# vim /etc/my.cnf
[root@node1 ~]# cat /etc/my.cnf
[mysqld]
basedir = /usr/local/mysql
datadir = /opt/data
socket = /tmp/mysql.sock
port = 3306
pid-file = /opt/data/mysql.pid
user = mysql
skip-name-resolve

//配置服务启动脚本
[root@node1 ~]# cp -a /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
[root@node1 ~]# sed -ri 's#^(basedir=).*#\1/usr/local/mysql#g' /etc/init.d/mysqld
[root@node1 ~]# sed -ri 's#^(datadir=).*#\1/opt/data#g' /etc/init.d/mysqld
[root@node1 ~]# 

//启动mysql
[root@node1 ~]# service mysqld start
Starting MySQL.Logging to '/opt/data/node1.err'.
............ SUCCESS! 
[root@node1 ~]# ss -anlt
State      Recv-Q     Send-Q          Local Address:Port            Peer Address:Port     Process     
LISTEN     0          128                   0.0.0.0:80                   0.0.0.0:*                    
LISTEN     0          128                   0.0.0.0:22                   0.0.0.0:*                    
LISTEN     0          128                         *:3306                       *:*                    
LISTEN     0          128                      [::]:22                      [::]:*                    
LISTEN     0          70                          *:33060                      *:*       

//服务开机自启
[root@node1 ~]# chkconfig --add mysqld 

//修改密码
//使用临时密码登录
[root@node1 ~]# mysql -uroot -p'B=wdzUpHZ4hq'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 8.0.30

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

[root@node1 ~]# mysql -uroot -p'B=wdzUpHZ4hq'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 8.0.30

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> ALTER user 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY '123456';
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
安装php
//安装依赖包
[root@node1 ~]# dnf -y install epel-release
[root@node1 ~]# dnf -y install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libicu-devel libjpeg libjpeg-devel libpng libpng-devel openldap-devel  pcre-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel mhash mhash-devel php-mysqlnd libsqlite3x-devel libzip-devel wget gcc gcc-c++ make
[root@node1 ~]# dnf -y install http://mirror.centos.org/centos/8-stream/PowerTools/x86_64/os/Packages/oniguruma-devel-6.8.2-2.el8.x86_64.rpm
 
//下载php源码包,并解压
[root@node1 ~]# wget https://www.php.net/distributions/php-8.1.11.tar.gz
[root@node1 ~]# tar -xf php-8.1.11.tar.gz -C /usr/local/src/
[root@node1 ~]# cd /usr/local/src/php-8.1.11/
[root@node1 php-8.1.11]# 

//编译安装php
[root@node1 php-8.1.11]# ./configure --prefix=/usr/local/php \
 --with-config-file-path=/etc \
 --enable-fpm \
 --disable-debug \
 --disable-rpath \
 --enable-shared \
 --enable-soap \
 --with-openssl \
 --enable-bcmath \
 --with-iconv \
 --with-bz2 \
 --enable-calendar \
 --with-curl \
 --enable-exif  \
 --enable-ftp \
 --enable-gd \
 --with-jpeg \
 --with-zlib-dir \
 --with-freetype \
 --with-gettext \
 --enable-mbstring \
 --enable-pdo \
 --with-mysqli=mysqlnd \
 --with-pdo-mysql=mysqlnd \
 --with-readline \
 --enable-shmop \
 --enable-simplexml \
 --enable-sockets \
 --with-zip \
 --enable-mysqlnd-compression-support \
 --with-pear \
 --enable-pcntl \
 --enable-posix

//开始安装
[root@node1 php-8.1.11]# make -j $(grep 'processor' /proc/cpuinfo | wc -l) && make install
[root@node1 php-8.1.11]# cd /usr/local/php/
[root@node1 php]# ls
bin  etc  include  lib  php  sbin  var

//配置服务
(复制默认配置文件,使配置文件生效)
[root@node1 php]# cp etc/php-fpm.conf.default etc/php-fpm.conf 
[root@node1 php]# cp etc/php-fpm.d/www.conf.default etc/php-fpm.d/www.conf

//编写service文件
[root@node1 php]# cat > /usr/lib/systemd/system/php.service << EOF
> [Unit]
> Description=php server daemon
> After=network.target 
>  
> [Service]
> Type=forking
> ExecStart=/usr/local/php/sbin/php-fpm
> ExecStop=ps -ef |grep php |grep -v grep|awk '{print$2}'|xargs kill -9
> ExecReload=/bin/kill -HUP $MAINPID
>  
> [Install]
> WantedBy=multi-user.target 
> EOF

[root@node1 php]# systemctl daemon-reload 
[root@node1 php]# systemctl enable --now php.service 
Created symlink /etc/systemd/system/multi-user.target.wants/php.service → /usr/lib/systemd/system/php.service.
[root@node1 php]# ss -anlt
State      Recv-Q     Send-Q          Local Address:Port            Peer Address:Port     Process     
LISTEN     0          128                 127.0.0.1:9000                 0.0.0.0:*                    
LISTEN     0          128                   0.0.0.0:80                   0.0.0.0:*                    
LISTEN     0          128                   0.0.0.0:22                   0.0.0.0:*                    
LISTEN     0          128                         *:3306                       *:*                    
LISTEN     0          128                      [::]:22                      [::]:*                    
LISTEN     0          70                          *:33060                      *:*   
配置nginx
[root@node1 ~]# vim /usr/local/nginx/conf/nginx.conf
......
        location / {
            root   html;
            index  index.html index.html index.php;   //在index后面添加index.php,表示优先访问php页面
        }

......
        location ~ \.php$ {                 //将以下内容取消注释并修改  
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
......
配置PHP网络界面
[root@node1 ~]# cd /usr/local/nginx/html/
[root@node1 html]# vim index.php
[root@node1 html]# cat index.php
<?php
    phpinfo();
?>
[root@node1 html]# 

//重启服务
[root@node1 ~]# nginx -s stop
[root@node1 ~]# nginx

访问:http://192.168.174.170/index.php
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-TMTvYHNl-1682564464613)(null)]

node2安装httpd,做静态资源

[root@node2 ~]# yum -y install httpd
[root@node2 ~]# systemctl enable --now httpd
[root@node2 ~]# ss -anlt
State      Recv-Q     Send-Q           Local Address:Port           Peer Address:Port     Process     
LISTEN     0          128                    0.0.0.0:22                  0.0.0.0:*                    
LISTEN     0          128                          *:80                        *:*                    
LISTEN     0          128                       [::]:22                     [::]:*                    

node3源码安装nginx并配置负载均衡器,进行调度

//创建nginx用户
[root@node3 ~]# useradd -r -M -s /sbin/nologin nginx
[root@node3 ~]# id nginx
uid=994(nginx) gid=991(nginx) groups=991(nginx)

//下载依赖包
[root@node3 ~]# dnf -y install pcre-devel openssl openssl-devel gd-devel gcc gcc-c++ make wget vim

//下载nginx源码包,并解压
[root@node3 ~]# wget https://nginx.org/download/nginx-1.22.0.tar.gz
--2022-10-19 09:42:47--  https://nginx.org/download/nginx-1.22.0.tar.gz
Resolving nginx.org (nginx.org)... 52.58.199.22, 3.125.197.172, 2a05:d014:edb:5702::6, ...
Connecting to nginx.org (nginx.org)|52.58.199.22|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1073322 (1.0M) [application/octet-stream]
Saving to: ‘nginx-1.22.0.tar.gz’

nginx-1.22.0.tar.gz       100%[===================================>]   1.02M   731KB/s    in 1.4s    

2022-10-19 09:42:50 (731 KB/s) - ‘nginx-1.22.0.tar.gz’ saved [1073322/1073322]

[root@node3 ~]# tar -xf nginx-1.22.0.tar.gz 
[root@node3 ~]# cd nginx-1.22.0/
[root@node3 nginx-1.22.0]# 

//开始配置
[root@node3 ~]# tar -xf nginx-1.22.0.tar.gz 
[root@node3 ~]# cd nginx-1.22.0/
[root@node3 nginx-1.22.0]# ./configure \
> --prefix=/usr/local/nginx \
> --user=nginx \
> --group=nginx \
> --with-debug \
> --with-http_ssl_module \
> --with-http_realip_module \
> --with-http_image_filter_module \
> --with-http_gunzip_module \
> --with-http_gzip_static_module \
> --with-http_stub_status_module

//开启编译安装
[root@node3 nginx-1.22.0]# make -j $(grep 'processor' /proc/cpuinfo | wc -l) && make install

//安装完成
[root@node3 nginx-1.22.0]# cd /usr/local/nginx/
[root@node3 nginx]# ls
conf  html  logs  sbin

//配置环境变量
[root@node3 nginx]# echo "export PATH=$PATH:/usr/local/nginx/sbin" > /etc/profile.d/nginx.sh
[root@node3 nginx]# source /etc/profile.d/nginx.sh

//启动服务
[root@node3 nginx]# nginx
[root@node3 nginx]# ss -anlt
State      Recv-Q     Send-Q           Local Address:Port           Peer Address:Port     Process     
LISTEN     0          128                    0.0.0.0:80                  0.0.0.0:*                    
LISTEN     0          128                    0.0.0.0:22                  0.0.0.0:*                    
LISTEN     0          128                       [::]:22      
[::]:* 

//关闭服务,编写service文件,并设置服务开机自启
[root@node3 nginx]# nginx -s stop
[root@node3 nginx]# ss -anlt
State      Recv-Q     Send-Q           Local Address:Port           Peer Address:Port     Process     
LISTEN     0          128                    0.0.0.0:22                  0.0.0.0:*                    
LISTEN     0          128                       [::]:22                     [::]:* 

[root@node3 nginx]# cat > /usr/lib/systemd/system/nginx.service << EOF
> [Unit]
> Description=nginx server daemon
> After=network.target 
>  
> [Service]
> Type=forking
> ExecStart=/usr/local/nginx/sbin/nginx
> ExecStop=/usr/local/nginx/sbin/nginx -s stop
> ExecReload=/bin/kill -HUP \$MAINPID
>  
> [Install]
> WantedBy=multi-user.target
> EOF

[root@node3 nginx]# systemctl daemon-reload 
[root@node3 nginx]# systemctl enable --now nginx.service 
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service.
[root@node3 nginx]# ss -anlt
State      Recv-Q     Send-Q           Local Address:Port           Peer Address:Port     Process     
LISTEN     0          128                    0.0.0.0:80                  0.0.0.0:*                    
LISTEN     0          128                    0.0.0.0:22                  0.0.0.0:*                    
LISTEN     0          128                       [::]:22                     [::]:*        

配置负载均衡

[root@node3 ~]# vim /usr/local/nginx/conf/nginx.conf
......
    upstream backend  {
        server 192.168.174.170;
        server 192.168.174.175;
    }
......
    location / {
            proxy_pass http://backend;
    }
[root@node3 ~]# nginx -t
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
[root@node3 ~]# systemctl restart nginx.service 

访问:http://192.168.174.177/

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-XFoClpzb-1682564464640)(null)]

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Dflb5gqU-1682564464653)(null)]

实现动静分离

[root@node3 ~]# vim /usr/local/nginx/conf/nginx.conf
......
    upstream static {
        server 192.168.174.175;
    }
    upstream dynamic {
        server 192.168.174.170;
    }
......
    location / {
        proxy_pass http://static;
    }
    location ~ \.php$ {
        proxy_pass http://dynamic;
    }
......
[root@node3 ~]# nginx -t
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
[root@node3 ~]# systemctl restart nginx.service

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-vB0SmiV3-1682564464623)(null)]

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-4s1BpVhk-1682564464632)(null)]
upstream dynamic {
server 192.168.174.170;
}

location / {
proxy_pass http://static;
}
location ~ .php$ {
proxy_pass http://dynamic;
}

[root@node3 ~]# nginx -t
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
[root@node3 ~]# systemctl restart nginx.service

[外链图片转存中...(img-ZM0HyZLJ-1682564464389)]

[外链图片转存中...(img-3msue4FN-1682564464390)]

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/466586.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

全光谱防蓝光护眼灯有用吗?怎么分辨是全光谱灯

每个人的家里都有一两个台灯&#xff0c;孩子用来学习&#xff0c;老人用来阅读。但台灯不仅仅是用来照明而已&#xff0c;还需要呵护我们的双眼。现在的孩子患近视的人越来越多&#xff0c;很多小学生都戴上了眼镜&#xff0c;而老年人老花眼白内障的患者也在攀升&#xff0c;…

华三(H3C)GRE OVER IPsec实验

实验拓扑 目录 实验需求 1. 某企业北京总部、上海分支、武汉分支分别通过 R1&#xff0c;R3&#xff0c;R4 接入互联网&#xff0c;配置默认路由连通公网 2. 按照图示配置 IP 地址&#xff0c;R1&#xff0c;R3&#xff0c;R4 分别配置 Loopback0 口匹配感兴趣流&#xff0…

电子行业数字工厂管理系统有哪些优点和不足

随着制造业的不断发展&#xff0c;其生产技术也在不断改进&#xff0c;有许多电子企业都在部署数字工厂管理系统&#xff0c;进行数字化转型。如果不了解数字工厂管理系统&#xff0c;盲目部署的话&#xff0c;容易走很多弯路。本文将跟大家探讨一下&#xff0c;电子行业数字工…

本地Linux服务器安装宝塔面板,并公网远程登录

文章目录 前言1. 安装宝塔2. 安装cpolar内网穿透3. 远程访问宝塔4. 固定http地址5. 配置二级子域名6. 测试访问二级子域名 前言 宝塔面板作为建站运维工具&#xff0c;它支持一键LAMP/LNMP/集群/监控/网站/FTP/数据库/JAVA等100多项服务器管理功能&#xff0c;可提高运维效率。…

云原生|Packer插件开发在项目中应用

作者&#xff1a;李冠军 神州数码云基地 高级后端开发工程师 云时代我们可以在各云厂商控制台点一点&#xff0c;实例就生成了&#xff0c;但是这个点还是需要自己去点&#xff0c;如果把这些动作写成代码&#xff0c;直接运行&#xff0c;一切就完成了。 这就是Packer的作用…

使用Markdown编辑器

使用Markdown编辑器 欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题&#xff0c;有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants 创建一个自定义列表如何创建一个注…

总结833

学习目标&#xff1a; 4月&#xff08;复习完高数18讲内容&#xff0c;背诵21篇短文&#xff0c;熟词僻义300词基础词&#xff09; 学习内容&#xff1a; 暴力英语&#xff1a;背《美丽心灵》&#xff0c;背《大独裁者》五六段&#xff0c;六百四十字的文章&#xff0c;明天加…

Java中的序列化与反序列化

序列化和反序列化作为 Java 里一个较为基础的知识点&#xff0c;但我相信很多人能了解的也就是那么几句而已&#xff0c;甚至都不了解&#xff0c;如果再深究问一下 Java 如何实现序列化和反序列化的&#xff0c;就可能不知所措了&#xff01; 不知道怎么说好&#xff0c;什么是…

GD(兆易创新)系列FLASH进行FPGA和ZYNQ配置固化相关操作

写在前面 本文主要针对使用GD&#xff08;兆易创新&#xff09;系列的FLASH做启动配置片时&#xff0c;遇到的相关问题进行简单整理复盘&#xff0c;避免后人踩坑。 本人操作固化芯片型号为&#xff1a;ZYNQ7045、690T&#xff08;复旦微替代型号V7 690T&#xff09;。 7系列…

为类创建事务码,读取EXCEL并显示报表简单版

屏幕以及字段定义 DATA: go_container TYPE REF TO cl_gui_custom_container. DATA: lv_subrc TYPE i,gv_action TYPE int4,lt_filetab TYPE filetable,ls_filetab TYPE file_table.DATA: gv_exit TYPE flag . DATA: lt_input TYPE TABLE OF alsmex_tabline,…

人脸识别概述

博主简介 博主是一名大二学生&#xff0c;主攻人工智能研究。感谢让我们在CSDN相遇&#xff0c;博主致力于在这里分享关于人工智能&#xff0c;c&#xff0c;Python&#xff0c;爬虫等方面知识的分享。 如果有需要的小伙伴可以关注博主&#xff0c;博主会继续更新的&#xff0c…

封装 (encapsulation)--计算机程序术语

封装&#xff0c;即隐藏对象的属性和实现细节&#xff0c;仅对外公开接口&#xff0c;控制在程序中属性的读和修改的 访问级别&#xff1b;将抽象得到的数据和行为(或功能)相结合&#xff0c;形成一个有机的整体&#xff0c;也就是将数据与操作数据的 源代码进行有机的结合&…

以轻量级服务器niginx为核心的JavaWeb项目:第一章 项目设计

这里写目录标题 一 需求分析与环境搭建1.需求分析2.环境搭建1.2.1首先配置mysql环境1.2.2 配置maven环境 二 打成War包&#xff0c;发到linux上 一 需求分析与环境搭建 1.需求分析 2.环境搭建 1.2.1首先配置mysql环境 先查找一下mysql环境 [roothadoop122 ~]# mysql --vers…

SpringCloudAlibaba分布式事务——Seata

Seata 本专栏学习内容来自尚硅谷周阳老师的视频 有兴趣的小伙伴可以点击视频地址观看 分布式事务问题 在使用分布式之前&#xff0c;一般都是单机单库或者是单机多库的情况&#xff0c;一个服务对应一个数据库或者多个数据库&#xff0c;这样事务的问题可以通过Transaction解决…

Python学习:Anaconda23.3.1+spyder5.4.3+Python3.10.11环境配置

问题1&#xff1a;Anaconda安装配置教程&#xff08;真的非常详细的安装过程&#xff0c;还带环境配置&#xff09; 【参考文献】本文链接&#xff1a;Windows安装Anaconda使用教程_在奋斗的大道的博客-CSDN博客 问题2&#xff1a;Anaconda半天打不开&#xff0c;就在这转啊转…

MYSQL(六)函数

函数是指一段可以直接被另一端程序调用的代码 字符串函数 update employees set workn lpad(workno,5, 0); 数值函数 根据数据库的函数&#xff0c;生成一个六位数的随机验证码 select rpad(round(rand()*1000000, 0), 6, 0); 日期函数 流程函数

尚融宝24-标的管理

目录 一、需求介绍 &#xff08;一&#xff09;借款人申请借款 &#xff08;二&#xff09;流程 二、生成新标的 三、标的列表 &#xff08;一&#xff09;后端 &#xff08;二&#xff09;前端 四、标的详情 &#xff08;一&#xff09;后端 &#xff08;二&#xf…

FPGA动态配置si5338输出差分时钟,提供工程源码和技术支持

目录 1、前言2、设计框图3、si5338原理图设计4、si5338使用流程5、vivado工程详解6、上板调试验证并演示7、福利&#xff1a;工程代码的获取 1、前言 如今的FPGA板卡随着FPGA本身性能的提高也越来越高端&#xff0c;特别是在高速接口方面表现得越发明显&#xff0c;以Xilinx的…

Redis(10)哨兵

redis哨兵 哨兵配置步骤步骤一 启动redis节点步骤二 配置哨兵节点第三步 设置主从复制第四步 查看状态第五步 验证哨兵配置是否成功第六步 测试 哨兵配置步骤 本文将介绍redis哨兵的配置步骤。Redis哨兵是一种用于监控Redis主从复制和自动故障转移的系统 Redis哨兵是Redis的核…

“探索C++非质变算法:如何更高效地处理数据“

&#x1f4d6;作者介绍&#xff1a;22级树莓人&#xff08;计算机专业&#xff09;&#xff0c;热爱编程&#xff1c;目前在c&#xff0b;&#xff0b;阶段>——目标Windows&#xff0c;MySQL&#xff0c;Qt&#xff0c;数据结构与算法&#xff0c;Linux&#xff0c;多线程&…