Nginx企业级使用1(运维笔记)

news2024/9/22 4:57:40

Nginx企业级使用1(运维笔记)

重装和升级

信号参数

Kill 选项参数  pid
##关闭nginx
##快速关闭
kill -INT pid
##优雅关闭
kill -QUIT pid


##############实操##############
[root@server01 ~]# ps -ef|grep nginx
root       1668      1  0 11:09 ?        00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
www        1820   1668  0 11:49 ?        00:00:00 nginx: worker process               
root       1896   1839  0 12:14 pts/0    00:00:00 grep --color nginx
[root@server01 ~]# kill -TERM 1668 #快速关闭 作用于master
[root@server01 ~]# ps -ef|grep nginx
root       1898   1839  0 12:15 pts/0    00:00:00 grep --color nginx
[root@server01 ~]# service nginx start
正在启动 nginx:                                           [确定]
[root@server01 ~]# ps -ef|grep nginx
root       1951      1  0 12:15 ?        00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
www        1953   1951  0 12:15 ?        00:00:00 nginx: worker process               
root       1955   1839  0 12:15 pts/0    00:00:00 grep --color nginx
[root@server01 ~]# kill -INT 1953 #快速退出
[root@server01 ~]# ps -ef|grep nginx
root       1951      1  0 12:15 ?        00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
www        1956   1951  0 12:16 ?        00:00:00 nginx: worker process               
root       1958   1839  0 12:16 pts/0    00:00:00 grep --color nginx
[root@server01 ~]# kill -QUIT 1951 #优雅关闭
[root@server01 ~]# ps -ef|grep nginx
root       1960   1839  0 12:17 pts/0    00:00:00 grep --color nginx

重新安装

  • 停止服务,删除编译安装软件包和源码包

  • 重新解压编译安装即可

  • 如有需要,备份配置文件和网站目录里的资源文件

平滑升级

  • 升级软件版本,需要启动新版本,无法启动(端口占用)

  • 旧版本不先停,新的又可以运行

  • 新旧版本同时提供服务,旧的请求完成后,停掉旧进程

  • -USR2平滑启动一个进程(平滑升级)-WINCH优雅关闭子进程 -QUIT优雅关闭主进程

上传新版本

[root@server01 ~]# ps -ef|grep nginx #旧版本启动
root       2027      1  0 12:31 ?        00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
www        2029   2027  0 12:31 ?        00:00:00 nginx: worker process               
root       2034   1839  0 12:31 pts/0    00:00:00 grep --color nginx
[root@server01 ~]# cd soft
[root@server01 soft]# ls
mysql-5.6.33         nginx-1.14.2         php-7.2.12
mysql-5.6.33.tar.gz  nginx-1.14.2.tar.gz  php-7.2.12.tar.gz
mysql_install.sh     nginx_install.sh     php_install.sh
[root@server01 soft]# ls #上传新版本nginx1.16.0
mysql-5.6.33         nginx-1.14.2         nginx_install.sh   php_install.sh
mysql-5.6.33.tar.gz  nginx-1.14.2.tar.gz  php-7.2.12
mysql_install.sh     nginx-1.16.0.tar.gz  php-7.2.12.tar.gz

#解压 配置 编译 安装
tar xvf nginx-1.16.0.tar.gz
cd nginx-1.16.0
./configure  --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module
make install
#(执行完之后也可以直接执行make upgrade 不需要一步一步执行下方命令)

#上述操作完成 ,旧版本备份为nginx.old
[root@server01 nginx-1.16.0]# cd /usr/local/nginx/
[root@server01 nginx]# ls
client_body_temp  fastcgi_temp  logs        sbin       uwsgi_temp
conf              html          proxy_temp  scgi_temp
[root@server01 nginx]# cd sbin/
[root@server01 sbin]# ls
nginx  nginx.old  

[root@server01 sbin]# ./nginx -v
nginx version: nginx/1.16.0
[root@server01 sbin]# ./nginx.old -v
nginx version: nginx/1.14.2

#新旧版本同时进行
[root@server01 sbin]# ps -ef |grep nginx
root       2027      1  0 12:31 ?        00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
www        2029   2027  0 12:31 ?        00:00:00 nginx: worker process                          
root       4666   1839  0 12:40 pts/0    00:00:00 grep --color nginx
[root@server01 sbin]# kill -USR2 2027
[root@server01 sbin]# ps -ef |grep nginx
root       2027      1  0 12:31 ?        00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
www        2029   2027  0 12:31 ?        00:00:00 nginx: worker process                          
root       4667   2027  0 12:41 ?        00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
www        4668   4667  0 12:41 ?        00:00:00 nginx: worker process                          
root       4670   1839  0 12:41 pts/0    00:00:00 grep --color nginx

[root@server01 sbin]# kill -WINCH 2029 #杀死旧子进程
[root@server01 sbin]# ps -ef |grep nginx
root       2027      1  0 12:31 ?        00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
root       4667   2027  0 12:41 ?        00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
www        4668   4667  0 12:41 ?        00:00:00 nginx: worker process                          
www        4671   2027  0 12:42 ?        00:00:00 nginx: worker process                          
root       4673   1839  0 12:42 pts/0    00:00:00 grep --color nginx
[root@server01 sbin]# kill -QUIT 2027 #一键杀死旧进程
[root@server01 sbin]# ps -ef |grep nginx
root       4667      1  0 12:41 ?        00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
www        4668   4667  0 12:41 ?        00:00:00 nginx: worker process                          
root       4675   1839  0 12:43 pts/0    00:00:00 grep --color nginx

配置文件

[root@server01 ~]# cd /usr/local/nginx/
[root@server01 nginx]# ls
client_body_temp  conf  fastcgi_temp  html  logs  proxy_temp  sbin  scgi_temp  uwsgi_temp
[root@server01 nginx]# cd conf 
[root@server01 conf]# cat nginx.conf #查看配置文件

#user  nobody;     #nginx启动用户
worker_processes  1;  #子进程数量 一般为cpu核数或者倍数
#错误日志定义
#error_log  logs/error.log;    
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
  #每个子进程的连接数  nginx当前并发量  worker_processes * worker_connections
    worker_connections  1024;
}

#http协议段
http {
    #引入  文件扩展名和与文件类型映射表
    include       mime.types;
    #默认文件类型 
    default_type  application/octet-stream;
    #访问日志access.log的格式
    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;
    #linux内核  提供文件读写的机制
    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    #长连接超时时间  单位为s
    keepalive_timeout  65;

    #gzip  on;

    server {
    #监听端口
        listen       80;
         #域名  可以有多个 用空格分隔
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;
        root html;

        location / {
           #默认访问的网站路径
           # root   html;
           #默认访问页面 从前往后的顺序查找 
            index  index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        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;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}
递进关系 http > server > location

自定义一个错误页面

[root@server01 ~]# cd /usr/local/nginx/
[root@server01 nginx]# ls
client_body_temp  conf  fastcgi_temp  html  logs  proxy_temp  sbin  scgi_temp  uwsgi_temp
[root@server01 nginx]# cd html
[root@server01 html]# ls
50x.html  index.html  index.php
[root@server01 html]# vim 404.html
[root@server01 html]# cat 404.html
oh! 404         

#编辑配置文件
[root@server01 html]# cd ..
[root@server01 nginx]# cd conf/
[root@server01 conf]# vim nginx.conf

#在server里添加或者去掉注释 
 error_page  404              /404.html;

访问不存在的页面就会出现此页面

企业常见配置

基于域名的虚拟主机配置

[root@server01 conf]# ls
fastcgi.conf            koi-utf             nginx.conf           uwsgi_params
fastcgi.conf.default    koi-win             nginx.conf.default   uwsgi_params.default
fastcgi_params          mime.types          scgi_params          win-utf
fastcgi_params.default  mime.types.default  scgi_params.default
[root@server01 conf]# vim nginx.conf  



#文件添加
 server{
       listen 80;#监听端口
       server_name shop.lnmp.com;#域名
       root html/tp5shop; #寻找路径
       index index.html;


      }


#重启服务
[root@server01 conf]# service nginx reload
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
重新载入 nginx:                                           [确定]
[root@server01 conf]# cd ..
[root@server01 nginx]# cd html/
[root@server01 html]# ls
404.html  50x.html  index.html  index.php
[root@server01 html]# mkdir tp5shop #创建配置目录
[root@server01 html]# cd tp5shop/
[root@server01 tp5shop]# vim index.html#新建index.html
[root@server01 tp5shop]# cat index.html
shop.lnmp.com



#使用windows访问 解析域名
PS C:\WINDOWS\system32\drivers\etc> tree /f
卷 系统 的文件夹 PATH 列表
卷序列号为 09C1-B27D
C:.
    hosts
    hosts.ics
    lmhosts.sam
    networks
    protocol
    services

没有子文件夹

#编辑hosts文件添加
#你自己的ip地址  域名
192.168.126.139 shop.lnmp.com


#查看连通性

PS C:\Users\Rkun18> ping shop.lnmp.com

正在 Ping shop.lnmp.com [192.168.126.139] 具有 32 字节的数据:
来自 192.168.126.139 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.126.139 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.126.139 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.126.139 的回复: 字节=32 时间<1ms TTL=64

192.168.126.139 的 Ping 统计信息:
    数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
    最短 = 0ms,最长 = 1ms,平均 = 0ms
#新建php文件
[root@server01 tp5shop]# pwd
/usr/local/nginx/html/tp5shop
[root@server01 tp5shop]# vim index.php
[root@server01 tp5shop]# cat index.php
<?php
echo 'shop site by php';




#不能解析php文件在nginx.conf里新建的server里编辑内容
 server{
      listen 80;
      server_name shop.lnmp.com;
      root html/tp5shop;
      index index.html;
      location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
        }


    }



#访问
http://shop.lnmp.com/index.php
#成功访问

基于端口的配置

[root@server01 ~]# vim /usr/local/nginx/conf/nginx.conf
#修改端口
server{
      listen 5210;
      server_name shop.lnmp.com;
      root html/tp5shop;
      index index.html;
      location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
        }


    }

#重载
[root@server01 ~]# service nginx reload
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
重新载入 nginx:    

#查看端口
[root@server01 ~]# netstat -nltp|grep nginx
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      1676/nginx
tcp        0      0 0.0.0.0:5210                0.0.0.0:*                   LISTEN      1676/nginx
#无法访问
http://shop.lnmp.com/index.php
#加端口5210
http://shop.lnmp.com:5210/index.php
成功访问!

基于IP访问

#临时绑定IP 
ifconfig eth0:1 192.168.126.140
#查看IP是否绑定成功
ip a


#######################实操#################
[root@server01 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:19:47:98 brd ff:ff:ff:ff:ff:ff
    inet 192.168.126.139/24 brd 192.168.126.255 scope global eth0
    inet6 fe80::20c:29ff:fe19:4798/64 scope link
       valid_lft forever preferred_lft forever
[root@server01 ~]# ifconfig eth0:1 192.168.126.140
[root@server01 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:19:47:98 brd ff:ff:ff:ff:ff:ff
    inet 192.168.126.139/24 brd 192.168.126.255 scope global eth0
    inet 192.168.126.140/24 brd 192.168.126.255 scope global secondary eth0:1
    inet6 fe80::20c:29ff:fe19:4798/64 scope link
       valid_lft forever preferred_lft forever       




#在nginx配置文件里新建一个server
[root@server01 ~]# vim /usr/local/nginx/conf/nginx.conf

server {
    listen 80;
    server_name 192.168.126.140;
    root html/ip;

}

#建立测试目录
 cd /usr/local/nginx/html
 mkdir ip
 echo "ip site" >> index.html

#通过浏览器访问
http://192.168.126.140/

上线商城项目

#上传项目源代码 (随意位置)这里我使用MobaXterm 上传文件很方便
 cd /usr/local/nginx/html

[root@server01 ~]# cd /usr/local/nginx/html
[root@server01 html]# ls
404.html  index.html  ip       tp5shop.zip
50x.html  index.php   tp5shop  tpshop.sql
[root@server01 html]# mv tp5shop tp5shop_bak #把之前的目录删除或者做一个备份
[root@server01 html]# ls
404.html  index.html  ip           tp5shop.zip
50x.html  index.php   tp5shop_bak  tpshop.sql

#把项目压缩包解压
 unzip tp5shop.zip


#解压后
[root@server01 html]# ls
404.html  index.html  ip       tp5shop_bak  tpshop.sql
50x.html  index.php   tp5shop  tp5shop.zip
[root@server01 html]# cd tp5shop
[root@server01 tp5shop]# ls
application  composer.json  extend       public     runtime  thinkphp
build.php    composer.lock  LICENSE.txt  README.md  think    vendor 


#设置基本信息
 vim /usr/local/nginx/conf/nginx.conf

#在配置文件中配置server虚拟主机段
 server {
        listen 80;
        server_name shop.lnmp.com;
        #tp5shop商城项目基于thinkphp5框架开发,需要绑定默认网站目录为public
        root html/tp5shop/public;
        index  index.html;
        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;
        }
}


#每次配置完记得重启配置
 service nginx reload

访问:http://shop.lnmp.com/

403 Forbidden

403 Forbidden


nginx/1.16.0

错误原因

  • 默认访问index.html 刚才配置public目录下没有该文件

  • 没有index.html就会列出目录结构 ,但没有权限列出

#设置基本信息
 vim /usr/local/nginx/conf/nginx.conf

#在配置文件中配置server虚拟主机段
 server {
        listen 80;
        server_name shop.lnmp.com;
        #tp5shop商城项目基于thinkphp5框架开发,需要绑定默认网站目录为public
        root html/tp5shop/public;
#默认index.php添加
        index index.php index.html;
        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;
        }
}


#重载配置

连接数据库导入数据

[root@server01 ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.33 Source distribution

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

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> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)     

#创建数据库
mysql > create database tp5shop;
#使用数据库
mysql > use tp5shop;
#通过sql文件导入恢复数据
mysql > source /usr/local/nginx/html/tpshop.sql



######################################################



#修改项目的连接数据库配置文件
vim /usr/local/nginx/html/tp5shop/application/database.php 


return [
    // 数据库类型
    'type'            => 'mysql',
    // 服务器地址
    'hostname'        => '127.0.0.1',
    // 数据库名
    'database'        => 'tp5shop',
    // 用户名
    'username'        => 'root',
    // 密码
    'password'        => '你自己设置的密码',
    // 端口
    'hostport'        => '3306',

访问shop.lnmp.com

遇到问题:项目需要在runtime文件夹中写入缓存信息(需要写权限)

  • nginx 读取静态文件 用户www

  • php-fpm 读取、写入、解析php文件 用户www

  • 把runtime目录的所属关系赋予www

 cd /usr/local/nginx/html/tp5shop
 chown -R www:www runtime/

 ####################################################################
 [root@server01 ~]#  cd /usr/local/nginx/html/tp5shop
[root@server01 tp5shop]# ls
application  composer.json  extend       public     runtime  thinkphp
build.php    composer.lock  LICENSE.txt  README.md  think    vendor
[root@server01 tp5shop]# ll
总用量 68
drwxr-xr-x 5 root root  4096 420 18:43 application
-rw-r--r-- 1 root root  1124 42 2018 build.php
-rw-r--r-- 1 root root  1051 42 2018 composer.json
-rw-r--r-- 1 root root 18657 42 2018 composer.lock
drwxr-xr-x 2 root root  4096 57 2018 extend
-rw-r--r-- 1 root root  1854 42 2018 LICENSE.txt
drwxr-xr-x 7 root root  4096 57 2018 public
-rw-r--r-- 1 root root  5904 42 2018 README.md
drwxr-xr-x 5 root root  4096 57 2018 runtime
-rw-r--r-- 1 root root   770 42 2018 think
drwxr-xr-x 5 root root  4096 57 2018 thinkphp
drwxr-xr-x 7 root root  4096 57 2018 vendor
[root@server01 tp5shop]# chown -R www:www runtime/
[root@server01 tp5shop]# ll
总用量 68
drwxr-xr-x 5 root root  4096 420 18:43 application
-rw-r--r-- 1 root root  1124 42 2018 build.php
-rw-r--r-- 1 root root  1051 42 2018 composer.json
-rw-r--r-- 1 root root 18657 42 2018 composer.lock
drwxr-xr-x 2 root root  4096 57 2018 extend
-rw-r--r-- 1 root root  1854 42 2018 LICENSE.txt
drwxr-xr-x 7 root root  4096 57 2018 public
-rw-r--r-- 1 root root  5904 42 2018 README.md
drwxr-xr-x 5 www  www   4096 57 2018 runtime
-rw-r--r-- 1 root root   770 42 2018 think

访问shop.lnmp.com

在这里插入图片描述
基本部署完成

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

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

相关文章

Flask入门和视图--01

1. 概述 虚拟环境搭建和使用 Flask框架的特点&#xff0c;Flask框架的组成 Flask框架中MVT模式开发 蓝图Blueprint的使用 路由Route的使用 请求Request和响应Response的使用 2. Flask简介 2.1 简介 Python后端的2个主流框架:Flask 轻量级框架Django 重型框架Flask是一…

开心档之C++ 信号处理

C 信号处理 目录 C 信号处理 signal() 函数 实例 raise() 函数 实例 信号是由操作系统传给进程的中断&#xff0c;会提早终止一个程序。在 UNIX、LINUX、Mac OS X 或 Windows 系统上&#xff0c;可以通过按 CtrlC 产生中断。 有些信号不能被程序捕获&#xff0c;但是下表…

安全狗入选2023年福建省数字经济核心产业领域创新企业名单

近日&#xff0c;福建省数字福建建设领导小组办公室公布了入选2023年全省数字经济核心产业领域创新企业名单。 作为国内云原生安全领导厂商&#xff0c;安全狗凭借综合表现与优势入选名单&#xff0c;荣膺“未来独角兽”称号。 据悉&#xff0c;此次对“未来独角兽”的评选条件…

调频电视发射机工作原理

我们平常所接触到的电视信号无线传输器材&#xff0c;较多采用调幅方式。原因是调幅方式在整个电视技术领域用得比较普遍&#xff0c;如我们生活中不可或缺的无线和有线电视广播&#xff0c;几乎全部都采用调幅方式。其实&#xff0c;若是用调频方式来传输电视信号&#xff0c;…

Qt Quick - 分隔器综述

Qt Quick - 分隔器综述 一、概述二、MenuSeparator 控件1. 用法&#xff1a; 三、ToolSeparator 控件1. 用法 一、概述 Qt Quick Controls 提供了多种分隔符&#xff0c;其实就是分割一下MenuBar和ToolBar里面的内容。 控件功能MenuSeparator将菜单中的一组项目与相邻项目分开…

Spring Boot + Spring Security基础入门教程

Spring Security简介 Spring Security 是一个功能强大且高度可定制的身份验证和访问控制框架。Spring Security 致力于为 Java 应用程序提供身份验证和授权的能力。 Spring Security 两大重要核心功能&#xff1a;用户认证&#xff08;Authentication&#xff09;和用户授权&am…

pandas 使用loc和iloc读取行数据或列数据

文章目录 一、 使用loc方法读取数据1.1 读取某行某列的值1.2 读取某个区域1.3 按照条件筛选 二. 使用iloc方法读取数据2.1 读取某行某列的值2.2 读取某个区域的数据 创建一个DataFrame data {name:[张三, 李四, 王五, 赵六],age:[20, 21, 22, 23], gender: [0, 1, 1, 1], stat…

网络工程项目报价单应该怎么写?记住这6个步骤准没错!

作为一名网络工程师&#xff0c;你在向潜在客户提供服务时&#xff0c;编写一个清晰明了的项目报价单是至关重要的。一个好的报价单不仅能够让客户更好地了解你的服务内容&#xff0c;还可以为你的项目提供更高的转化率。在本文中&#xff0c;我们将探讨如何编写一个有效的网络…

一图看懂 xlwt 模块:读写 Excel 文件的数据和格式信息, 资料整理+笔记(大全)

本文由 大侠(AhcaoZhu)原创&#xff0c;转载请声明。 链接: https://blog.csdn.net/Ahcao2008 一图看懂 xlwt 模块&#xff1a;读写 Excel 文件的数据和格式信息, 资料整理笔记&#xff08;大全&#xff09; 摘要模块图类关系图模块全展开【xlwt】统计常量模块1 xlwt.compat2 x…

Linux系统之部署Linux管理面板1Panel

Linux系统之部署Linux管理面板1Panel 一、1Panel介绍1.1Panel简介2.1Panel特点 二、本地环境规划1.本此实践目的2.本地环境规划 三、检查本地环境1.检查操作系统版本2.检查系统内核版本 四、部署1Panel1.创建安装目录2.一键部署1Panel3.检查1Panel服务运行状态4.检查1Panel监听…

数据结构——二叉搜索树、平衡二叉树、红黑树

数据结构——二叉搜索树 一、二叉搜索树1.二叉搜索树的特性2.二叉搜索树的查找、插入和删除 二、平衡二叉树1.基本介绍2.AVL树的自平衡1&#xff09;自平衡的调整操作2&#xff09;自平衡调整的局面 3.AVL树的代码实现4.AVL树的特点 三、红黑树1.基本介绍2.红黑树的自平衡1&…

秒杀系统如何设计

思路&#xff1a;对于秒杀系统&#xff0c;两个架构优化思路&#xff1a; 1&#xff09;尽量将请求拦截在系统上游 2&#xff09;读多写少的常用多使用缓存 1、限制用户在x秒之内只能提交一次请求 2、同一个uid&#xff0c;或同一类查询&#xff08;例如车次&#xff09;。限制…

配电网光伏/储能双层优化配置模型(选址定容)

目录 1 主要内容 上层目标函数考虑光伏和储能的投资成本。 程序采用模块化编程&#xff0c;并有每个模块功能介绍&#xff0c;方便学习。 2 部分代码 3 程序结果 4 程序结果 1 主要内容 该程序主要方法复现《含高比例可再生能源配电网灵活资源双层优化配置》运行-规划联合…

【Maven 入门】第二章、Maven核心程序解压与配置

一、Maven 官网地址 首页&#xff1a; Maven – Welcome to Apache Maven(opens new window) 下载页面&#xff1a; Maven – Download Apache Maven(opens new window) 本文以maven-3.3.8为例 具体下载地址&#xff1a;https://dlcdn.apache.org/maven/maven-3/3.8.8/bina…

LeetCode刷题集(二)(LeetCode 2037使每位学生都有座位的最少移动次数)

学习目标&#xff1a; 掌握LeetCode2037使每位学生都有座位的最少移动次数 题目内容&#xff1a; 一个房间里有 n 个座位和 n 名学生&#xff0c;房间用一个数轴表示。给你一个长度为 n 的数组 seats &#xff0c;其中 seats[i] 是第 i 个座位的位置。同时给你一个长度为 n 的数…

数据结构-排序3(终章)

前言&#xff1a; 上一章&#xff0c;对交换排序的冒牌和快排做了复盘&#xff0c;这一章对&#xff0c;归并排序以及非比较排序中的计数排序做一个复盘。 目录 2.4归并排序 2.4.1规定递归 2.4.2归并非递归 2.5非比较排序 2.5.1计数排序 2.6排序的稳定性分析 2.6.1冒…

【Transformer系列(2)】注意力机制、自注意力机制、多头注意力机制、通道注意力机制、空间注意力机制超详细讲解

前言 注意力机制一直是一个比较热的话题&#xff0c;其实在很早之前就提出了&#xff0c;我们在学习图像分类时在SENet就见到过&#xff08;直通车&#xff1a;经典神经网络论文超详细解读&#xff08;七&#xff09;——SENet&#xff08;注意力机制&#xff09;学习笔记&…

金陵科技学院五年一贯制专转本管理学原理考试大纲

金陵科技学院五年一贯制专转本管理学原理考试大纲 一、考核对象 本课程的考核对象为五年一贯制高职专转本“旅游管理”专业入学考试考生。 二、考核方式 本课程考核采用闭卷笔试的方式。 三、命题依据及原则 1、命题依据 参考书目&#xff1a;《管理学——原理与方法》 …

Docker Swarm集群企业案例实战

1. Docker Swarm集群企业案例实战 Docker Swarm 和 Docker Compose 一样&#xff0c;都是 Docker 官方容器编排项目&#xff0c;但不同的是&#xff0c;Docker Compose 是一个在单个服务器或主机上创建多个容器的工具&#xff0c;而 Docker Swarm 则可以在多个服务器或主机上创…

驼峰式匹配-力扣1023-java

一、题目描述 如果我们可以将小写字母插入模式串 pattern 得到待查询项 query&#xff0c;那么待查询项与给定模式串匹配。&#xff08;我们可以在任何位置插入每个字符&#xff0c;也可以插入 0 个字符。&#xff09; 给定待查询列表 queries&#xff0c;和模式串 pattern&a…