集群服务器
文章目录
- 项目名:实现集群服务器
- 技术栈
- 通过这项目你学到(或者复习到)
- 实现功能
- 编码环境
- json环境
- muduo库+boost库
- MySql数据库
- 登录mysql:
- 查看mysql服务开启了没有?
- mysql的服务器及开发包
- 库chat,表 allgroup friend groupuser offlinemessage user
- 查看mysql动态库
- nginx配置tcp负载均衡
- 参考博客
- 遇到的问题
- 测试
项目名:实现集群服务器
技术栈
- Json序列化和反序列化
- muduo网络库开发
- nginx源码编译安装和环境部署
- nginx的tcp负载均衡(也叫反向代理)器配置
- redis缓存服务器编程实践
- 基于发布-订阅的服务器中间件redis消息队列编程实践
- MySQL数据库编程
- CMake构建编译环境
- Github托管项目
通过这项目你学到(或者复习到)
- linux cpp
- Json数据协议
- moduo库(这个是我学习这个的主要目的之一)
- nginx服务器的使用(这个是我学习这个的主要目的之一)
- mysql
- cmake
实现功能
-
客户端注册登录
-
加好友,加群
-
好友聊天
-
群聊天
-
其他,待添加…
编码环境
linux+vscode
json环境
使用一个第三节库:
https://github.com/nlohmann/json/releases/download/v3.6.1/json.hpp
整个库文件只有一个json.hpp组成,使用json和使用stl一样简单
请看testjson文件夹
muduo库+boost库
参考如下博客进行集成开发:
https://blog.csdn.net/QIANGWEIYUAN/article/details/89023980
请看testmuduo文件夹
本质:muduo本身就是epoll+多线程
MySql数据库
登录mysql:
mysql -u root -proot
查看mysql服务开启了没有?
mysql的服务器及开发包
sudo apt-get install mysql-server =》 安装最新版MySQL服务器
sudo apt-get install libmysqlclient-dev =》 安装开发包
库chat,表 allgroup friend groupuser offlinemessage user
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| shared_bike |
| sys |
| webserver |
+--------------------+
6 rows in set (0.27 sec)mysql> create database chat;
Query OK, 1 row affected (0.11 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| chat |
| mysql |
| performance_schema |
| shared_bike |
| sys |
| webserver |
+--------------------+
7 rows in set (0.00 sec)mysql> use chat;
Database changed
mysql> CREATE TABLE `allgroup` (-> `id` int(11) NOT NULL AUTO_INCREMENT,-> `groupname` varchar(50) CHARACTER SET latin1 NOT NULL,-> `groupdesc` varchar(200) CHARACTER SET latin1 DEFAULT '',-> PRIMARY KEY (`id`),-> UNIQUE KEY `groupname` (`groupname`)-> ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.68 sec)mysql> show tables;
+----------------+
| Tables_in_chat |
+----------------+
| allgroup |
+----------------+
1 row in set (0.00 sec)
mysql> CREATE TABLE `friend` (-> `userid` int(11) NOT NULL,-> `friendid` int(11) NOT NULL,-> KEY `userid` (`userid`,`friendid`)-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.11 sec)mysql> CREATE TABLE `groupuser` (-> `groupid` int(11) NOT NULL,-> `userid` int(11) NOT NULL,-> `grouprole` enum('creator','normal') CHARACTER SET latin1 DEFAULT NULL,-> KEY `groupid` (`groupid`,`userid`)-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.13 sec)mysql> CREATE TABLE `offlinemessage` (-> `userid` int(11) NOT NULL,-> `message` varchar(500) NOT NULL-> ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Query OK, 0 rows affected (0.11 sec)mysql> CREATE TABLE `user` (-> `id` int(11) NOT NULL AUTO_INCREMENT,-> `name` varchar(50) DEFAULT NULL,-> `password` varchar(50) DEFAULT NULL,-> `state` enum('online','offline') CHARACTER SET latin1 DEFAULT 'offline',-> PRIMARY KEY (`id`),-> UNIQUE KEY `name` (`name`)-> ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.01 sec)mysql> show tables;
+----------------+
| Tables_in_chat |
+----------------+
| allgroup |
| friend |
| groupuser |
| offlinemessage |
| user |
+----------------+
5 rows in set (0.00 sec)mysql>
User表
字段名称 | 字段类型 | 字段说明 | 约束 |
---|---|---|---|
id | INT | 用户id | PRIMARY KEY、AUTO_INCREMENT |
name | VARCHAR(50) | 用户名 | NOT NULL, UNIQUE |
password | VARCHAR(50) | 用户密码 | NOT NULL |
state | ENUM(‘online’, ‘offline’) | 当前登录状态 | DEFAULT ‘offline’ |
Friend表
字段名称 | 字段类型 | 字段说明 | 约束 |
---|---|---|---|
userid | INT | 用户id | NOT NULL、联合主键 |
friendid | INT | 好友id | NOT NULL、联合主键 |
AllGroup表
字段名称 | 字段类型 | 字段说明 | 约束 |
---|---|---|---|
id | INT | 组id | PRIMARY KEY、AUTO_INCREMENT |
groupname | VARCHAR(50) | 组名称 | NOT NULL,UNIQUE |
groupdesc | VARCHAR(200) | 组功能描述 | DEFAULT ‘’ |
GroupUser表
字段名称 | 字段类型 | 字段说明 | 约束 |
---|---|---|---|
groupid | INT | 组id | NOT NULL、联合主键 |
userid | INT | 组员id | NOT NULL、联合主键 |
grouprole | ENUM(‘creator’, ‘normal’) | 组内角色 | DEFAULT ‘normal’ |
OfflineMessage表
字段名称 | 字段类型 | 字段说明 | 约束 |
---|---|---|---|
userid | INT | 用户id | NOT NULL |
message | VARCHAR(500) | 离线消息(存储Json字符串) | NOT NULL |
查看mysql动态库
sudo find /usr -name libmysqlclient*
nginx配置tcp负载均衡
nginx在1.9版本之前,只支持http协议web服务器的负载均衡,
从1.9版本开始以后,nginx开始支持tcp的长连接负载均衡,但是nginx默认并没有编译tcp负载均衡模块,编写它时,需要加入–with-stream参数来激活这个模块。
nginx编译加入–with-stream参数激活tcp负载均衡模块
nginx编译安装需要先安装pcre、openssl、zlib等库,也可以直接编译执行下面的configure命令,根
据错误提示信息,安装相应缺少的库。
下面的make命令会向系统路径拷贝文件,需要在root用户下执行
tony@tony-virtual-machine:~/package/nginx-1.12.2# ./configure --with-stream
tony@tony-virtual-machine:~/package/nginx-1.12.2# make && make install
编译完成后,默认安装在了/usr/local/nginx目录。
tony@tony-virtual-machine:~/package/nginx-1.12.2$ cd /usr/local/nginx/
tony@tony-virtual-machine:/usr/local/nginx$ ls
conf html logs sbin
可执行文件在sbin目录里面,配置文件在conf目录里面。
具体步骤可以看下面的内容:
(注:要想在nginx编译加入–with-stream参数激活tcp负载均衡模块,不能直接使用sudo apt-get install nginx,还需下载源码,比如1.12.2这个版本)
具体步骤:
wxncom@wxncom-virtual-machine:~/Nginx$ ls ###################################
nginx-1.12.2.tar.gz
wxncom@wxncom-virtual-machine:~/Nginx$ tar -axvf nginx-1.12.2.tar.gz ###############
nginx-1.12.2/
nginx-1.12.2/auto/
nginx-1.12.2/conf/
nginx-1.12.2/contrib/
nginx-1.12.2/src/
nginx-1.12.2/configure
nginx-1.12.2/LICENSE
nginx-1.12.2/README
nginx-1.12.2/html/
nginx-1.12.2/man/
nginx-1.12.2/CHANGES.ru
nginx-1.12.2/CHANGES
nginx-1.12.2/man/nginx.8
nginx-1.12.2/html/50x.html
nginx-1.12.2/html/index.html
nginx-1.12.2/src/core/
nginx-1.12.2/src/event/
nginx-1.12.2/src/http/
nginx-1.12.2/src/mail/
nginx-1.12.2/src/misc/
nginx-1.12.2/src/os/
nginx-1.12.2/src/stream/
nginx-1.12.2/src/stream/ngx_stream_geo_module.c
nginx-1.12.2/src/stream/ngx_stream.c
nginx-1.12.2/src/stream/ngx_stream.h
nginx-1.12.2/src/stream/ngx_stream_limit_conn_module.c
nginx-1.12.2/src/stream/ngx_stream_access_module.c
nginx-1.12.2/src/stream/ngx_stream_core_module.c
nginx-1.12.2/src/stream/ngx_stream_geoip_module.c
nginx-1.12.2/src/stream/ngx_stream_handler.c
nginx-1.12.2/src/stream/ngx_stream_proxy_module.c
nginx-1.12.2/src/stream/ngx_stream_log_module.c
nginx-1.12.2/src/stream/ngx_stream_map_module.c
nginx-1.12.2/src/stream/ngx_stream_split_clients_module.c
nginx-1.12.2/src/stream/ngx_stream_realip_module.c
nginx-1.12.2/src/stream/ngx_stream_return_module.c
nginx-1.12.2/src/stream/ngx_stream_script.c
nginx-1.12.2/src/stream/ngx_stream_script.h
nginx-1.12.2/src/stream/ngx_stream_ssl_preread_module.c
nginx-1.12.2/src/stream/ngx_stream_ssl_module.c
nginx-1.12.2/src/stream/ngx_stream_ssl_module.h
nginx-1.12.2/src/stream/ngx_stream_upstream.c
nginx-1.12.2/src/stream/ngx_stream_upstream.h
nginx-1.12.2/src/stream/ngx_stream_upstream_least_conn_module.c
nginx-1.12.2/src/stream/ngx_stream_upstream_zone_module.c
nginx-1.12.2/src/stream/ngx_stream_upstream_hash_module.c
nginx-1.12.2/src/stream/ngx_stream_upstream_round_robin.c
nginx-1.12.2/src/stream/ngx_stream_upstream_round_robin.h
nginx-1.12.2/src/stream/ngx_stream_variables.c
nginx-1.12.2/src/stream/ngx_stream_variables.h
nginx-1.12.2/src/stream/ngx_stream_write_filter_module.c
nginx-1.12.2/src/os/unix/
nginx-1.12.2/src/os/unix/ngx_atomic.h
nginx-1.12.2/src/os/unix/ngx_alloc.c
nginx-1.12.2/src/os/unix/ngx_alloc.h
nginx-1.12.2/src/os/unix/ngx_darwin_config.h
nginx-1.12.2/src/os/unix/ngx_channel.c
nginx-1.12.2/src/os/unix/ngx_channel.h
nginx-1.12.2/src/os/unix/ngx_daemon.c
nginx-1.12.2/src/os/unix/ngx_darwin.h
nginx-1.12.2/src/os/unix/ngx_darwin_sendfile_chain.c
nginx-1.12.2/src/os/unix/ngx_darwin_init.c
nginx-1.12.2/src/os/unix/ngx_file_aio_read.c
nginx-1.12.2/src/os/unix/ngx_dlopen.c
nginx-1.12.2/src/os/unix/ngx_dlopen.h
nginx-1.12.2/src/os/unix/ngx_errno.c
nginx-1.12.2/src/os/unix/ngx_errno.h
nginx-1.12.2/src/os/unix/ngx_freebsd.h
nginx-1.12.2/src/os/unix/ngx_files.c
nginx-1.12.2/src/os/unix/ngx_files.h
nginx-1.12.2/src/os/unix/ngx_freebsd_sendfile_chain.c
nginx-1.12.2/src/os/unix/ngx_freebsd_config.h
nginx-1.12.2/src/os/unix/ngx_freebsd_init.c
nginx-1.12.2/src/os/unix/ngx_gcc_atomic_sparc64.h
nginx-1.12.2/src/os/unix/ngx_gcc_atomic_amd64.h
nginx-1.12.2/src/os/unix/ngx_gcc_atomic_ppc.h
nginx-1.12.2/src/os/unix/ngx_linux_sendfile_chain.c
nginx-1.12.2/src/os/unix/ngx_gcc_atomic_x86.h
nginx-1.12.2/src/os/unix/ngx_linux.h
nginx-1.12.2/src/os/unix/ngx_linux_aio_read.c
nginx-1.12.2/src/os/unix/ngx_linux_config.h
nginx-1.12.2/src/os/unix/ngx_linux_init.c
nginx-1.12.2/src/os/unix/ngx_posix_config.h
nginx-1.12.2/src/os/unix/ngx_os.h
nginx-1.12.2/src/os/unix/ngx_solaris_config.h
nginx-1.12.2/src/os/unix/ngx_posix_init.c
nginx-1.12.2/src/os/unix/ngx_process.c
nginx-1.12.2/src/os/unix/ngx_process.h
nginx-1.12.2/src/os/unix/ngx_process_cycle.c
nginx-1.12.2/src/os/unix/ngx_process_cycle.h
nginx-1.12.2/src/os/unix/ngx_readv_chain.c
nginx-1.12.2/src/os/unix/ngx_recv.c
nginx-1.12.2/src/os/unix/ngx_send.c
nginx-1.12.2/src/os/unix/ngx_setaffinity.c
nginx-1.12.2/src/os/unix/ngx_setaffinity.h
nginx-1.12.2/src/os/unix/ngx_setproctitle.c
nginx-1.12.2/src/os/unix/ngx_setproctitle.h
nginx-1.12.2/src/os/unix/ngx_shmem.c
nginx-1.12.2/src/os/unix/ngx_shmem.h
nginx-1.12.2/src/os/unix/ngx_socket.c
nginx-1.12.2/src/os/unix/ngx_socket.h
nginx-1.12.2/src/os/unix/ngx_solaris.h
nginx-1.12.2/src/os/unix/ngx_solaris_init.c
nginx-1.12.2/src/os/unix/ngx_sunpro_amd64.il
nginx-1.12.2/src/os/unix/ngx_thread_cond.c
nginx-1.12.2/src/os/unix/ngx_thread.h
nginx-1.12.2/src/os/unix/ngx_solaris_sendfilev_chain.c
nginx-1.12.2/src/os/unix/ngx_sunpro_atomic_sparc64.h
nginx-1.12.2/src/os/unix/ngx_sunpro_sparc64.il
nginx-1.12.2/src/os/unix/ngx_sunpro_x86.il
nginx-1.12.2/src/os/unix/ngx_thread_mutex.c
nginx-1.12.2/src/os/unix/ngx_thread_id.c
nginx-1.12.2/src/os/unix/ngx_udp_recv.c
nginx-1.12.2/src/os/unix/ngx_time.c
nginx-1.12.2/src/os/unix/ngx_time.h
nginx-1.12.2/src/os/unix/ngx_udp_sendmsg_chain.c
nginx-1.12.2/src/os/unix/ngx_udp_send.c
nginx-1.12.2/src/os/unix/ngx_writev_chain.c
nginx-1.12.2/src/os/unix/ngx_user.c
nginx-1.12.2/src/os/unix/ngx_user.h
nginx-1.12.2/src/misc/ngx_google_perftools_module.c
nginx-1.12.2/src/misc/ngx_cpp_test_module.cpp
nginx-1.12.2/src/mail/ngx_mail_handler.c
nginx-1.12.2/src/mail/ngx_mail.c
nginx-1.12.2/src/mail/ngx_mail.h
nginx-1.12.2/src/mail/ngx_mail_auth_http_module.c
nginx-1.12.2/src/mail/ngx_mail_core_module.c
nginx-1.12.2/src/mail/ngx_mail_imap_handler.c
nginx-1.12.2/src/mail/ngx_mail_imap_module.c
nginx-1.12.2/src/mail/ngx_mail_imap_module.h
nginx-1.12.2/src/mail/ngx_mail_parse.c
nginx-1.12.2/src/mail/ngx_mail_pop3_handler.c
nginx-1.12.2/src/mail/ngx_mail_pop3_module.c
nginx-1.12.2/src/mail/ngx_mail_pop3_module.h
nginx-1.12.2/src/mail/ngx_mail_proxy_module.c
nginx-1.12.2/src/mail/ngx_mail_smtp_handler.c
nginx-1.12.2/src/mail/ngx_mail_smtp_module.c
nginx-1.12.2/src/mail/ngx_mail_smtp_module.h
nginx-1.12.2/src/mail/ngx_mail_ssl_module.c
nginx-1.12.2/src/mail/ngx_mail_ssl_module.h
nginx-1.12.2/src/http/modules/
nginx-1.12.2/src/http/ngx_http_cache.h
nginx-1.12.2/src/http/ngx_http.c
nginx-1.12.2/src/http/ngx_http.h
nginx-1.12.2/src/http/ngx_http_core_module.c
nginx-1.12.2/src/http/ngx_http_config.h
nginx-1.12.2/src/http/ngx_http_postpone_filter_module.c
nginx-1.12.2/src/http/ngx_http_copy_filter_module.c
nginx-1.12.2/src/http/ngx_http_core_module.h
nginx-1.12.2/src/http/ngx_http_file_cache.c
nginx-1.12.2/src/http/ngx_http_header_filter_module.c
nginx-1.12.2/src/http/ngx_http_parse.c
nginx-1.12.2/src/http/ngx_http_special_response.c
nginx-1.12.2/src/http/ngx_http_request.c
nginx-1.12.2/src/http/ngx_http_request.h
nginx-1.12.2/src/http/ngx_http_request_body.c
nginx-1.12.2/src/http/ngx_http_script.c
nginx-1.12.2/src/http/ngx_http_script.h
nginx-1.12.2/src/http/ngx_http_variables.c
nginx-1.12.2/src/http/ngx_http_upstream.c
nginx-1.12.2/src/http/ngx_http_upstream.h
nginx-1.12.2/src/http/v2/
nginx-1.12.2/src/http/ngx_http_upstream_round_robin.c
nginx-1.12.2/src/http/ngx_http_upstream_round_robin.h
nginx-1.12.2/src/http/ngx_http_variables.h
nginx-1.12.2/src/http/ngx_http_write_filter_module.c
nginx-1.12.2/src/http/v2/ngx_http_v2_module.c
nginx-1.12.2/src/http/v2/ngx_http_v2.c
nginx-1.12.2/src/http/v2/ngx_http_v2.h
nginx-1.12.2/src/http/v2/ngx_http_v2_filter_module.c
nginx-1.12.2/src/http/v2/ngx_http_v2_huff_decode.c
nginx-1.12.2/src/http/v2/ngx_http_v2_huff_encode.c
nginx-1.12.2/src/http/v2/ngx_http_v2_module.h
nginx-1.12.2/src/http/v2/ngx_http_v2_table.c
nginx-1.12.2/src/http/modules/ngx_http_addition_filter_module.c
nginx-1.12.2/src/http/modules/ngx_http_access_module.c
nginx-1.12.2/src/http/modules/ngx_http_charset_filter_module.c
nginx-1.12.2/src/http/modules/ngx_http_auth_basic_module.c
nginx-1.12.2/src/http/modules/ngx_http_auth_request_module.c
nginx-1.12.2/src/http/modules/ngx_http_autoindex_module.c
nginx-1.12.2/src/http/modules/ngx_http_browser_module.c
nginx-1.12.2/src/http/modules/ngx_http_not_modified_filter_module.c
nginx-1.12.2/src/http/modules/ngx_http_chunked_filter_module.c
nginx-1.12.2/src/http/modules/ngx_http_dav_module.c
nginx-1.12.2/src/http/modules/ngx_http_degradation_module.c
nginx-1.12.2/src/http/modules/ngx_http_empty_gif_module.c
nginx-1.12.2/src/http/modules/ngx_http_fastcgi_module.c
nginx-1.12.2/src/http/modules/ngx_http_flv_module.c
nginx-1.12.2/src/http/modules/ngx_http_geo_module.c
nginx-1.12.2/src/http/modules/ngx_http_geoip_module.c
nginx-1.12.2/src/http/modules/ngx_http_gunzip_filter_module.c
nginx-1.12.2/src/http/modules/ngx_http_gzip_filter_module.c
nginx-1.12.2/src/http/modules/ngx_http_gzip_static_module.c
nginx-1.12.2/src/http/modules/ngx_http_headers_filter_module.c
nginx-1.12.2/src/http/modules/ngx_http_image_filter_module.c
nginx-1.12.2/src/http/modules/ngx_http_index_module.c
nginx-1.12.2/src/http/modules/ngx_http_limit_conn_module.c
nginx-1.12.2/src/http/modules/ngx_http_limit_req_module.c
nginx-1.12.2/src/http/modules/ngx_http_log_module.c
nginx-1.12.2/src/http/modules/ngx_http_map_module.c
nginx-1.12.2/src/http/modules/ngx_http_memcached_module.c
nginx-1.12.2/src/http/modules/ngx_http_mp4_module.c
nginx-1.12.2/src/http/modules/ngx_http_random_index_module.c
nginx-1.12.2/src/http/modules/ngx_http_proxy_module.c
nginx-1.12.2/src/http/modules/ngx_http_upstream_ip_hash_module.c
nginx-1.12.2/src/http/modules/ngx_http_range_filter_module.c
nginx-1.12.2/src/http/modules/ngx_http_realip_module.c
nginx-1.12.2/src/http/modules/ngx_http_referer_module.c
nginx-1.12.2/src/http/modules/ngx_http_rewrite_module.c
nginx-1.12.2/src/http/modules/ngx_http_scgi_module.c
nginx-1.12.2/src/http/modules/ngx_http_secure_link_module.c
nginx-1.12.2/src/http/modules/ngx_http_slice_filter_module.c
nginx-1.12.2/src/http/modules/ngx_http_split_clients_module.c
nginx-1.12.2/src/http/modules/perl/
nginx-1.12.2/src/http/modules/ngx_http_ssi_filter_module.c
nginx-1.12.2/src/http/modules/ngx_http_ssi_filter_module.h
nginx-1.12.2/src/http/modules/ngx_http_ssl_module.c
nginx-1.12.2/src/http/modules/ngx_http_ssl_module.h
nginx-1.12.2/src/http/modules/ngx_http_static_module.c
nginx-1.12.2/src/http/modules/ngx_http_stub_status_module.c
nginx-1.12.2/src/http/modules/ngx_http_sub_filter_module.c
nginx-1.12.2/src/http/modules/ngx_http_upstream_hash_module.c
nginx-1.12.2/src/http/modules/ngx_http_xslt_filter_module.c
nginx-1.12.2/src/http/modules/ngx_http_upstream_keepalive_module.c
nginx-1.12.2/src/http/modules/ngx_http_upstream_least_conn_module.c
nginx-1.12.2/src/http/modules/ngx_http_upstream_zone_module.c
nginx-1.12.2/src/http/modules/ngx_http_uwsgi_module.c
nginx-1.12.2/src/http/modules/ngx_http_userid_filter_module.c
nginx-1.12.2/src/http/modules/perl/Makefile.PL
nginx-1.12.2/src/http/modules/perl/nginx.pm
nginx-1.12.2/src/http/modules/perl/nginx.xs
nginx-1.12.2/src/http/modules/perl/typemap
nginx-1.12.2/src/http/modules/perl/ngx_http_perl_module.c
nginx-1.12.2/src/http/modules/perl/ngx_http_perl_module.h
nginx-1.12.2/src/event/modules/
nginx-1.12.2/src/event/ngx_event_accept.c
nginx-1.12.2/src/event/ngx_event.c
nginx-1.12.2/src/event/ngx_event.h
nginx-1.12.2/src/event/ngx_event_openssl_stapling.c
nginx-1.12.2/src/event/ngx_event_connect.c
nginx-1.12.2/src/event/ngx_event_connect.h
nginx-1.12.2/src/event/ngx_event_openssl.c
nginx-1.12.2/src/event/ngx_event_openssl.h
nginx-1.12.2/src/event/ngx_event_pipe.c
nginx-1.12.2/src/event/ngx_event_pipe.h
nginx-1.12.2/src/event/ngx_event_posted.c
nginx-1.12.2/src/event/ngx_event_posted.h
nginx-1.12.2/src/event/ngx_event_timer.c
nginx-1.12.2/src/event/ngx_event_timer.h
nginx-1.12.2/src/event/modules/ngx_win32_select_module.c
nginx-1.12.2/src/event/modules/ngx_devpoll_module.c
nginx-1.12.2/src/event/modules/ngx_epoll_module.c
nginx-1.12.2/src/event/modules/ngx_eventport_module.c
nginx-1.12.2/src/event/modules/ngx_kqueue_module.c
nginx-1.12.2/src/event/modules/ngx_poll_module.c
nginx-1.12.2/src/event/modules/ngx_select_module.c
nginx-1.12.2/src/core/ngx_array.c
nginx-1.12.2/src/core/nginx.c
nginx-1.12.2/src/core/nginx.h
nginx-1.12.2/src/core/ngx_conf_file.c
nginx-1.12.2/src/core/ngx_array.h
nginx-1.12.2/src/core/ngx_buf.c
nginx-1.12.2/src/core/ngx_buf.h
nginx-1.12.2/src/core/ngx_connection.c
nginx-1.12.2/src/core/ngx_conf_file.h
nginx-1.12.2/src/core/ngx_config.h
nginx-1.12.2/src/core/ngx_module.c
nginx-1.12.2/src/core/ngx_file.c
nginx-1.12.2/src/core/ngx_connection.h
nginx-1.12.2/src/core/ngx_core.h
nginx-1.12.2/src/core/ngx_cpuinfo.c
nginx-1.12.2/src/core/ngx_crc.h
nginx-1.12.2/src/core/ngx_crc32.c
nginx-1.12.2/src/core/ngx_crc32.h
nginx-1.12.2/src/core/ngx_crypt.c
nginx-1.12.2/src/core/ngx_crypt.h
nginx-1.12.2/src/core/ngx_cycle.c
nginx-1.12.2/src/core/ngx_cycle.h
nginx-1.12.2/src/core/ngx_parse.h
nginx-1.12.2/src/core/ngx_file.h
nginx-1.12.2/src/core/ngx_hash.c
nginx-1.12.2/src/core/ngx_hash.h
nginx-1.12.2/src/core/ngx_inet.c
nginx-1.12.2/src/core/ngx_inet.h
nginx-1.12.2/src/core/ngx_list.c
nginx-1.12.2/src/core/ngx_list.h
nginx-1.12.2/src/core/ngx_log.c
nginx-1.12.2/src/core/ngx_log.h
nginx-1.12.2/src/core/ngx_md5.c
nginx-1.12.2/src/core/ngx_md5.h
nginx-1.12.2/src/core/ngx_murmurhash.c
nginx-1.12.2/src/core/ngx_module.h
nginx-1.12.2/src/core/ngx_open_file_cache.c
nginx-1.12.2/src/core/ngx_murmurhash.h
nginx-1.12.2/src/core/ngx_slab.h
nginx-1.12.2/src/core/ngx_open_file_cache.h
nginx-1.12.2/src/core/ngx_output_chain.c
nginx-1.12.2/src/core/ngx_palloc.c
nginx-1.12.2/src/core/ngx_palloc.h
nginx-1.12.2/src/core/ngx_parse.c
nginx-1.12.2/src/core/ngx_thread_pool.c
nginx-1.12.2/src/core/ngx_parse_time.c
nginx-1.12.2/src/core/ngx_parse_time.h
nginx-1.12.2/src/core/ngx_proxy_protocol.c
nginx-1.12.2/src/core/ngx_proxy_protocol.h
nginx-1.12.2/src/core/ngx_queue.c
nginx-1.12.2/src/core/ngx_queue.h
nginx-1.12.2/src/core/ngx_radix_tree.c
nginx-1.12.2/src/core/ngx_radix_tree.h
nginx-1.12.2/src/core/ngx_rbtree.c
nginx-1.12.2/src/core/ngx_rbtree.h
nginx-1.12.2/src/core/ngx_regex.c
nginx-1.12.2/src/core/ngx_regex.h
nginx-1.12.2/src/core/ngx_resolver.c
nginx-1.12.2/src/core/ngx_resolver.h
nginx-1.12.2/src/core/ngx_rwlock.c
nginx-1.12.2/src/core/ngx_rwlock.h
nginx-1.12.2/src/core/ngx_sha1.c
nginx-1.12.2/src/core/ngx_sha1.h
nginx-1.12.2/src/core/ngx_shmtx.c
nginx-1.12.2/src/core/ngx_shmtx.h
nginx-1.12.2/src/core/ngx_slab.c
nginx-1.12.2/src/core/ngx_spinlock.c
nginx-1.12.2/src/core/ngx_string.c
nginx-1.12.2/src/core/ngx_string.h
nginx-1.12.2/src/core/ngx_syslog.c
nginx-1.12.2/src/core/ngx_syslog.h
nginx-1.12.2/src/core/ngx_thread_pool.h
nginx-1.12.2/src/core/ngx_times.c
nginx-1.12.2/src/core/ngx_times.h
nginx-1.12.2/contrib/geo2nginx.pl
nginx-1.12.2/contrib/README
nginx-1.12.2/contrib/unicode2nginx/
nginx-1.12.2/contrib/vim/
nginx-1.12.2/contrib/vim/ftdetect/
nginx-1.12.2/contrib/vim/ftplugin/
nginx-1.12.2/contrib/vim/indent/
nginx-1.12.2/contrib/vim/syntax/
nginx-1.12.2/contrib/vim/syntax/nginx.vim
nginx-1.12.2/contrib/vim/indent/nginx.vim
nginx-1.12.2/contrib/vim/ftplugin/nginx.vim
nginx-1.12.2/contrib/vim/ftdetect/nginx.vim
nginx-1.12.2/contrib/unicode2nginx/koi-utf
nginx-1.12.2/contrib/unicode2nginx/win-utf
nginx-1.12.2/contrib/unicode2nginx/unicode-to-nginx.pl
nginx-1.12.2/conf/fastcgi.conf
nginx-1.12.2/conf/fastcgi_params
nginx-1.12.2/conf/koi-utf
nginx-1.12.2/conf/koi-win
nginx-1.12.2/conf/mime.types
nginx-1.12.2/conf/nginx.conf
nginx-1.12.2/conf/scgi_params
nginx-1.12.2/conf/uwsgi_params
nginx-1.12.2/conf/win-utf
nginx-1.12.2/auto/cc/
nginx-1.12.2/auto/have_headers
nginx-1.12.2/auto/define
nginx-1.12.2/auto/endianness
nginx-1.12.2/auto/feature
nginx-1.12.2/auto/have
nginx-1.12.2/auto/lib/
nginx-1.12.2/auto/os/
nginx-1.12.2/auto/headers
nginx-1.12.2/auto/include
nginx-1.12.2/auto/init
nginx-1.12.2/auto/install
nginx-1.12.2/auto/types/
nginx-1.12.2/auto/make
nginx-1.12.2/auto/module
nginx-1.12.2/auto/modules
nginx-1.12.2/auto/nohave
nginx-1.12.2/auto/options
nginx-1.12.2/auto/sources
nginx-1.12.2/auto/stubs
nginx-1.12.2/auto/summary
nginx-1.12.2/auto/threads
nginx-1.12.2/auto/unix
nginx-1.12.2/auto/types/uintptr_t
nginx-1.12.2/auto/types/sizeof
nginx-1.12.2/auto/types/typedef
nginx-1.12.2/auto/types/value
nginx-1.12.2/auto/os/conf
nginx-1.12.2/auto/os/darwin
nginx-1.12.2/auto/os/freebsd
nginx-1.12.2/auto/os/linux
nginx-1.12.2/auto/os/solaris
nginx-1.12.2/auto/os/win32
nginx-1.12.2/auto/lib/geoip/
nginx-1.12.2/auto/lib/conf
nginx-1.12.2/auto/lib/google-perftools/
nginx-1.12.2/auto/lib/libatomic/
nginx-1.12.2/auto/lib/libgd/
nginx-1.12.2/auto/lib/libxslt/
nginx-1.12.2/auto/lib/openssl/
nginx-1.12.2/auto/lib/make
nginx-1.12.2/auto/lib/pcre/
nginx-1.12.2/auto/lib/perl/
nginx-1.12.2/auto/lib/zlib/
nginx-1.12.2/auto/lib/zlib/makefile.bcc
nginx-1.12.2/auto/lib/zlib/conf
nginx-1.12.2/auto/lib/zlib/make
nginx-1.12.2/auto/lib/zlib/makefile.msvc
nginx-1.12.2/auto/lib/zlib/makefile.owc
nginx-1.12.2/auto/lib/perl/conf
nginx-1.12.2/auto/lib/perl/make
nginx-1.12.2/auto/lib/pcre/makefile.bcc
nginx-1.12.2/auto/lib/pcre/conf
nginx-1.12.2/auto/lib/pcre/make
nginx-1.12.2/auto/lib/pcre/makefile.msvc
nginx-1.12.2/auto/lib/pcre/makefile.owc
nginx-1.12.2/auto/lib/openssl/makefile.bcc
nginx-1.12.2/auto/lib/openssl/conf
nginx-1.12.2/auto/lib/openssl/make
nginx-1.12.2/auto/lib/openssl/makefile.msvc
nginx-1.12.2/auto/lib/libxslt/conf
nginx-1.12.2/auto/lib/libgd/conf
nginx-1.12.2/auto/lib/libatomic/conf
nginx-1.12.2/auto/lib/libatomic/make
nginx-1.12.2/auto/lib/google-perftools/conf
nginx-1.12.2/auto/lib/geoip/conf
nginx-1.12.2/auto/cc/clang
nginx-1.12.2/auto/cc/acc
nginx-1.12.2/auto/cc/bcc
nginx-1.12.2/auto/cc/ccc
nginx-1.12.2/auto/cc/conf
nginx-1.12.2/auto/cc/gcc
nginx-1.12.2/auto/cc/icc
nginx-1.12.2/auto/cc/msvc
nginx-1.12.2/auto/cc/name
nginx-1.12.2/auto/cc/owc
nginx-1.12.2/auto/cc/sunc
wxncom@wxncom-virtual-machine:~/Nginx$ ls ################################
nginx-1.12.2 nginx-1.12.2.tar.gz
wxncom@wxncom-virtual-machine:~/Nginx$ cd nginx-1.12.2/ ##################
wxncom@wxncom-virtual-machine:~/Nginx/nginx-1.12.2$ ls #################
auto CHANGES CHANGES.ru conf configure contrib html LICENSE man README src
wxncom@wxncom-virtual-machine:~/Nginx/nginx-1.12.2$ ./configure --with-stream ########
checking for OS+ Linux 4.15.0-213-generic x86_64
checking for C compiler ... found+ using GNU C compiler+ gcc version: 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
checking for gcc -pipe switch ... found
checking for -Wl,-E switch ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for gcc builtin 64 bit byteswap ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
checking for epoll ... found
checking for EPOLLRDHUP ... found
checking for EPOLLEXCLUSIVE ... found
checking for O_PATH ... found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for sched_setaffinity() ... found
checking for crypt_r() ... found
checking for sys/vfs.h ... found
checking for nobody group ... not found
checking for nogroup group ... found
checking for poll() ... found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... found
checking for F_READAHEAD ... not found
checking for posix_fadvise() ... found
checking for O_DIRECT ... found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for statfs() ... found
checking for statvfs() ... found
checking for dlopen() ... not found
checking for dlopen() in libdl ... found
checking for sched_yield() ... found
checking for SO_SETFIB ... not found
checking for SO_REUSEPORT ... found
checking for SO_ACCEPTFILTER ... not found
checking for SO_BINDANY ... not found
checking for IP_BIND_ADDRESS_NO_PORT ... found
checking for IP_TRANSPARENT ... found
checking for IP_BINDANY ... not found
checking for IP_RECVDSTADDR ... not found
checking for IP_PKTINFO ... found
checking for IPV6_RECVPKTINFO ... found
checking for TCP_DEFER_ACCEPT ... found
checking for TCP_KEEPIDLE ... found
checking for TCP_FASTOPEN ... found
checking for TCP_INFO ... found
checking for accept4() ... found
checking for eventfd() ... found
checking for int size ... 4 bytes
checking for long size ... 8 bytes
checking for long long size ... 8 bytes
checking for void * size ... 8 bytes
checking for uint32_t ... found
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... 4 bytes
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system byte ordering ... little endian
checking for size_t size ... 8 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 8 bytes
checking for AF_INET6 ... found
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for pwritev() ... found
checking for sys_nerr ... found
checking for localtime_r() ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... found
checking for POSIX semaphores ... not found
checking for POSIX semaphores in libpthread ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found
checking for struct dirent.d_namlen ... not found
checking for struct dirent.d_type ... found
checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for openat(), fstatat() ... found
checking for getaddrinfo() ... found
checking for PCRE library ... not found
checking for PCRE library in /usr/local/ ... not found
checking for PCRE library in /usr/include/pcre/ ... not found
checking for PCRE library in /usr/pkg/ ... not found
checking for PCRE library in /opt/local/ ... not found./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.wxncom@wxncom-virtual-machine:~/Nginx/nginx-1.12.2$ sudo apt-get install libpcre3 libpcre3-dev #####################################
Reading package lists... Done
Building dependency tree
Reading state information... Done
libpcre3 is already the newest version (2:8.39-9ubuntu0.1).
The following packages were automatically installed and are no longer required:libnginx-mod-http-geoip libnginx-mod-http-image-filter libnginx-mod-http-xslt-filter libnginx-mod-mail libnginx-mod-streamlibprotobuf-lite10 nginx-common nginx-core
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:libpcre16-3 libpcre32-3 libpcrecpp0v5
The following NEW packages will be installed:libpcre16-3 libpcre3-dev libpcre32-3 libpcrecpp0v5
0 upgraded, 4 newly installed, 0 to remove and 42 not upgraded.
Need to get 837 kB of archives.
After this operation, 3,566 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 libpcre16-3 amd64 2:8.39-9ubuntu0.1 [147 kB]
Get:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 libpcre32-3 amd64 2:8.39-9ubuntu0.1 [138 kB]
Get:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 libpcrecpp0v5 amd64 2:8.39-9ubuntu0.1 [15.3 kB]
Get:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 libpcre3-dev amd64 2:8.39-9ubuntu0.1 [536 kB]
Fetched 837 kB in 1s (638 kB/s)
Selecting previously unselected package libpcre16-3:amd64.
(Reading database ... 181653 files and directories currently installed.)
Preparing to unpack .../libpcre16-3_2%3a8.39-9ubuntu0.1_amd64.deb ...
Unpacking libpcre16-3:amd64 (2:8.39-9ubuntu0.1) ...
Selecting previously unselected package libpcre32-3:amd64.
Preparing to unpack .../libpcre32-3_2%3a8.39-9ubuntu0.1_amd64.deb ...
Unpacking libpcre32-3:amd64 (2:8.39-9ubuntu0.1) ...
Selecting previously unselected package libpcrecpp0v5:amd64.
Preparing to unpack .../libpcrecpp0v5_2%3a8.39-9ubuntu0.1_amd64.deb ...
Unpacking libpcrecpp0v5:amd64 (2:8.39-9ubuntu0.1) ...
Selecting previously unselected package libpcre3-dev:amd64.
Preparing to unpack .../libpcre3-dev_2%3a8.39-9ubuntu0.1_amd64.deb ...
Unpacking libpcre3-dev:amd64 (2:8.39-9ubuntu0.1) ...
Setting up libpcrecpp0v5:amd64 (2:8.39-9ubuntu0.1) ...
Setting up libpcre32-3:amd64 (2:8.39-9ubuntu0.1) ...
Setting up libpcre16-3:amd64 (2:8.39-9ubuntu0.1) ...
Setting up libpcre3-dev:amd64 (2:8.39-9ubuntu0.1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.5) ...
wxncom@wxncom-virtual-machine:~/Nginx/nginx-1.12.2$ ./configure --with-stream
checking for OS+ Linux 4.15.0-213-generic x86_64
checking for C compiler ... found+ using GNU C compiler+ gcc version: 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
checking for gcc -pipe switch ... found
checking for -Wl,-E switch ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for gcc builtin 64 bit byteswap ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
checking for epoll ... found
checking for EPOLLRDHUP ... found
checking for EPOLLEXCLUSIVE ... found
checking for O_PATH ... found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for sched_setaffinity() ... found
checking for crypt_r() ... found
checking for sys/vfs.h ... found
checking for nobody group ... not found
checking for nogroup group ... found
checking for poll() ... found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... found
checking for F_READAHEAD ... not found
checking for posix_fadvise() ... found
checking for O_DIRECT ... found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for statfs() ... found
checking for statvfs() ... found
checking for dlopen() ... not found
checking for dlopen() in libdl ... found
checking for sched_yield() ... found
checking for SO_SETFIB ... not found
checking for SO_REUSEPORT ... found
checking for SO_ACCEPTFILTER ... not found
checking for SO_BINDANY ... not found
checking for IP_BIND_ADDRESS_NO_PORT ... found
checking for IP_TRANSPARENT ... found
checking for IP_BINDANY ... not found
checking for IP_RECVDSTADDR ... not found
checking for IP_PKTINFO ... found
checking for IPV6_RECVPKTINFO ... found
checking for TCP_DEFER_ACCEPT ... found
checking for TCP_KEEPIDLE ... found
checking for TCP_FASTOPEN ... found
checking for TCP_INFO ... found
checking for accept4() ... found
checking for eventfd() ... found
checking for int size ... 4 bytes
checking for long size ... 8 bytes
checking for long long size ... 8 bytes
checking for void * size ... 8 bytes
checking for uint32_t ... found
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... 4 bytes
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system byte ordering ... little endian
checking for size_t size ... 8 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 8 bytes
checking for AF_INET6 ... found
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for pwritev() ... found
checking for sys_nerr ... found
checking for localtime_r() ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... found
checking for POSIX semaphores ... not found
checking for POSIX semaphores in libpthread ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found
checking for struct dirent.d_namlen ... not found
checking for struct dirent.d_type ... found
checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for openat(), fstatat() ... found
checking for getaddrinfo() ... found
checking for PCRE library ... found
checking for PCRE JIT support ... found
checking for zlib library ... found
creating objs/MakefileConfiguration summary+ using system PCRE library+ OpenSSL library is not used+ using system zlib librarynginx path prefix: "/usr/local/nginx"nginx binary file: "/usr/local/nginx/sbin/nginx"nginx modules path: "/usr/local/nginx/modules"nginx configuration prefix: "/usr/local/nginx/conf"nginx configuration file: "/usr/local/nginx/conf/nginx.conf"nginx pid file: "/usr/local/nginx/logs/nginx.pid"nginx error log file: "/usr/local/nginx/logs/error.log"nginx http access log file: "/usr/local/nginx/logs/access.log"nginx http client request body temporary files: "client_body_temp"nginx http proxy temporary files: "proxy_temp"nginx http fastcgi temporary files: "fastcgi_temp"nginx http uwsgi temporary files: "uwsgi_temp"nginx http scgi temporary files: "scgi_temp"wxncom@wxncom-virtual-machine:~/Nginx/nginx-1.12.2$
wxncom@wxncom-virtual-machine:~/Nginx/nginx-1.12.2$ sudo su
root@wxncom-virtual-machine:/home/wxncom/Nginx/nginx-1.12.2# make && make install #####
make -f objs/Makefile
make[1]: Entering directory '/home/wxncom/Nginx/nginx-1.12.2'
make[1]: Nothing to be done for 'build'.
make[1]: Leaving directory '/home/wxncom/Nginx/nginx-1.12.2'
make -f objs/Makefile install
make[1]: Entering directory '/home/wxncom/Nginx/nginx-1.12.2'
test -d '/usr/local/nginx' || mkdir -p '/usr/local/nginx'
test -d '/usr/local/nginx/sbin' \|| mkdir -p '/usr/local/nginx/sbin'
test ! -f '/usr/local/nginx/sbin/nginx' \|| mv '/usr/local/nginx/sbin/nginx' \'/usr/local/nginx/sbin/nginx.old'
cp objs/nginx '/usr/local/nginx/sbin/nginx'
test -d '/usr/local/nginx/conf' \|| mkdir -p '/usr/local/nginx/conf'
cp conf/koi-win '/usr/local/nginx/conf'
cp conf/koi-utf '/usr/local/nginx/conf'
cp conf/win-utf '/usr/local/nginx/conf'
test -f '/usr/local/nginx/conf/mime.types' \|| cp conf/mime.types '/usr/local/nginx/conf'
cp conf/mime.types '/usr/local/nginx/conf/mime.types.default'
test -f '/usr/local/nginx/conf/fastcgi_params' \|| cp conf/fastcgi_params '/usr/local/nginx/conf'
cp conf/fastcgi_params \'/usr/local/nginx/conf/fastcgi_params.default'
test -f '/usr/local/nginx/conf/fastcgi.conf' \|| cp conf/fastcgi.conf '/usr/local/nginx/conf'
cp conf/fastcgi.conf '/usr/local/nginx/conf/fastcgi.conf.default'
test -f '/usr/local/nginx/conf/uwsgi_params' \|| cp conf/uwsgi_params '/usr/local/nginx/conf'
cp conf/uwsgi_params \'/usr/local/nginx/conf/uwsgi_params.default'
test -f '/usr/local/nginx/conf/scgi_params' \|| cp conf/scgi_params '/usr/local/nginx/conf'
cp conf/scgi_params \'/usr/local/nginx/conf/scgi_params.default'
test -f '/usr/local/nginx/conf/nginx.conf' \|| cp conf/nginx.conf '/usr/local/nginx/conf/nginx.conf'
cp conf/nginx.conf '/usr/local/nginx/conf/nginx.conf.default'
test -d '/usr/local/nginx/logs' \|| mkdir -p '/usr/local/nginx/logs'
test -d '/usr/local/nginx/logs' \|| mkdir -p '/usr/local/nginx/logs'
test -d '/usr/local/nginx/html' \|| cp -R html '/usr/local/nginx'
test -d '/usr/local/nginx/logs' \|| mkdir -p '/usr/local/nginx/logs'
make[1]: Leaving directory '/home/wxncom/Nginx/nginx-1.12.2'
root@wxncom-virtual-machine:/home/wxncom/Nginx/nginx-1.12.2#
wxncom@wxncom-virtual-machine:~$ cd /usr/local/nginx/
wxncom@wxncom-virtual-machine:/usr/local/nginx$ ls
conf html logs sbin
wxncom@wxncom-virtual-machine:/usr/local/nginx$ cd sbin/
wxncom@wxncom-virtual-machine:/usr/local/nginx/sbin$ ls
nginx
wxncom@wxncom-virtual-machine:/usr/local/nginx/sbin$ cd ..
wxncom@wxncom-virtual-machine:/usr/local/nginx$ cd conf/
wxncom@wxncom-virtual-machine:/usr/local/nginx/conf$ ls
fastcgi.conf fastcgi_params.default mime.types nginx.conf.default uwsgi_params
fastcgi.conf.default koi-utf mime.types.default scgi_params uwsgi_params.default
fastcgi_params koi-win nginx.conf scgi_params.default win-utf
wxncom@wxncom-virtual-machine:/usr/local/nginx/conf$ sudo vi nginx.conf#user nobody;
worker_processes 1;#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;#pid logs/nginx.pid;events {worker_connections 1024;
}#添加了这一部分
#nginx tcp loadbalance config
stream{upstream MyServer{server 127.0.0.1:6000 weight=1 max_fails=3 fail_timeout=30s;server 127.0.0.1:6002 weight=1 max_fails=3 fail_timeout=30s;}server{proxy_connect_timeout 1s;#proxy_timeout 3s;listen 8000;proxy_pass MyServer;tcp_nodelay on;}
}http {include mime.types;default_type application/octet-stream;#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;sendfile on;#tcp_nopush on;#keepalive_timeout 0;keepalive_timeout 65;#gzip on;server {listen 80;server_name localhost;#charset koi8-r;#access_log logs/host.access.log main;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 /scripts$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;# }#}}
wxncom@wxncom-virtual-machine:/usr/local/nginx/conf$ cd ..
wxncom@wxncom-virtual-machine:/usr/local/nginx$ cd sbin/
wxncom@wxncom-virtual-machine:/usr/local/nginx/sbin$ ls
nginx
wxncom@wxncom-virtual-machine:/usr/local/nginx/sbin$ ./nginx
nginx: [alert] could not open error log file: open() "/usr/local/nginx/logs/error.log" failed (13: Permission denied)
2023/10/05 12:47:12 [emerg] 8198#0: mkdir() "/usr/local/nginx/client_body_temp" failed (13: Permission denied)
wxncom@wxncom-virtual-machine:/usr/local/nginx/sbin$ sudo ./nginx
wxncom@wxncom-virtual-machine:/usr/local/nginx/sbin$
wxncom@wxncom-virtual-machine:/usr/local/nginx/sbin$ sudo netstat -tanp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:1123 0.0.0.0:* LISTEN 2176/TabNine
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 887/mysqld
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 1065/smbd
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 848/redis-server 12
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 8202/nginx: master
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 577/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 850/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 2459/cupsd
tcp 0 0 127.0.0.1:45945 0.0.0.0:* LISTEN 1908/node
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 2666/sshd: wxncom@p
tcp 0 0 127.0.0.1:6011 0.0.0.0:* LISTEN 8118/sshd: wxncom@p
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 1065/smbd
tcp 0 0 0.0.0.0:8000 0.0.0.0:* LISTEN 8202/nginx: master
tcp 0 0 127.0.0.1:49152 0.0.0.0:* LISTEN 2310/TabNine-deep-l
tcp 0 0 127.0.0.1:45945 127.0.0.1:52662 ESTABLISHED 1908/node
tcp 0 0 127.0.0.1:41332 127.0.0.1:49152 ESTABLISHED 2176/TabNine
tcp 0 0 192.168.121.131:22 192.168.121.1:54829 ESTABLISHED 3374/sshd: wxncom [
tcp 0 0 127.0.0.1:45945 127.0.0.1:52668 ESTABLISHED 1975/node
tcp 0 0 127.0.0.1:49152 127.0.0.1:41332 ESTABLISHED 2310/TabNine-deep-l
tcp 0 0 127.0.0.1:52668 127.0.0.1:45945 ESTABLISHED 1809/sshd: wxncom@n
tcp 0 0 192.168.121.131:22 192.168.121.1:53233 ESTABLISHED 2619/sshd: wxncom [
tcp 0 196 192.168.121.131:22 192.168.121.1:55042 ESTABLISHED 8067/sshd: wxncom [
tcp 0 0 127.0.0.1:52662 127.0.0.1:45945 ESTABLISHED 1809/sshd: wxncom@n
tcp 0 0 192.168.121.131:22 192.168.121.1:51381 ESTABLISHED 1643/sshd: wxncom [
tcp6 0 0 ::1:6379 :::* LISTEN 848/redis-server 12
tcp6 0 0 :::139 :::* LISTEN 1065/smbd
tcp6 0 0 :::22 :::* LISTEN 850/sshd
tcp6 0 0 ::1:631 :::* LISTEN 2459/cupsd
tcp6 0 0 ::1:6010 :::* LISTEN 2666/sshd: wxncom@p
tcp6 0 0 ::1:6011 :::* LISTEN 8118/sshd: wxncom@p
tcp6 0 0 :::445 :::* LISTEN 1065/smbd
wxncom@wxncom-virtual-machine:/usr/local/nginx/sbin$
nginx -s reload
重新加载配置文件启动
nginx -s stop
停止nginx服务
按照上面的步骤 , 配置好之后,你就可以启动服务器的6000端口和6002端口,
然后 , 客户端启动8000端口
参考博客
https://blog.csdn.net/qq_20513027/article/details/88758356
https://blog.csdn.net/QIANGWEIYUAN/article/details/89023980
遇到的问题
- reason: [json.exception.type_error.316] invalid UTF-8 byte at index 0: 0xB8
Aborted (core dumped)
解决:
response["errmsg"] = "该用户已经登录,请重新输入新账号!";
改成:
response["errmsg"] = "The user has logged in, please enter a new account!";
说实话,一直没搞懂编码究竟怎么搞,服务器是一个编码,编译器又是另外一个编码,一个utf-7,一个是gb18030,不清楚如何平衡这两种编码.
- 然后 , redis是基于发布-订阅的消息队列
redis暂时可装可不装,加了只是如虎添翼 ,
我暂时还没有体验到redis的好处,仅仅只是会安装和使用了 , 这个项目暂时先这样 , 后续再进行相关拓展.
redis的安装:
https://blog.csdn.net/weixin_52668597/article/details/133522930
补充:
还有许多其他的消息队列系统可用,例如:
- RabbitMQ:一个基于AMQP(高级消息队列协议)的开源消息队列系统。
- Apache Kafka:一个高吞吐量、分布式的消息队列系统,用于处理实时数据流。
- ActiveMQ:一个Java消息代理,支持多种消息协议,如AMQP、STOMP、OpenWire等。
- ZeroMQ:一个快速、异步的消息库,用于构建分布式应用程序。
测试
{“msgid”:1,“id”:1,“password”:“123456”}
{“msgid”:1,“id”:2,“password”:“666666”}
{“msgid”:5,“id”:1,“from”:“zhangsan”,“to”:2,“msg”:“hello!”}
{“msgid”:5,“id”:2,“from”:“li si”,“to”:1,“msg”:“hi!”}
注册
{“msgid”:3,“name”:“li si”,“password”:“666666”}
联合查询:
select a.id,a.name,a.state from user a inner join friend b on b.friendid = a.id where b.userid = 1;
相关文章:
集群服务器
文章目录 项目名:实现集群服务器技术栈通过这项目你学到(或者复习到)实现功能编码环境json环境muduo库boost库MySql数据库登录mysql:查看mysql服务开启了没有?mysql的服务器及开发包库chat,表 allgroup friend groupuser offlinemessage user…...
大数据Doris(五):开始编译 Doris
文章目录 开始编译 Doris 一、下载Doris的安装包 二、解压缩 三、上传配置文件...
Linux软硬链接和动静态库
本文已收录至《Linux知识与编程》专栏! 作者:ARMCSKGT 演示环境:CentOS 7 软硬链接和动静态库 前言正文软硬链接原理使用 文件时间动静态库库介绍静态库静态库制作静态库的使用关于静态链接 动态库动态库制作动态库的使用关于动态链接 补充 最…...
Linux shell编程学习笔记6:查看和设置变量的常用命令
上节我们介绍了变量的变量命名规则、变量类型、使用变量时要注意的事项,今天我们学习一下查看和设置变量的一些常用命令,包括变量的提升,有些命令在之前的实例中已经使用过了。 一、 echo :查看变量的值 语法格式:ech…...
leetcode 416.分割等和子集
416. 分割等和子集 给你一个 只包含正整数 的 非空 数组 nums 。请你判断是否可以将这个数组分割成两个子集,使得两个子集的元素和相等。 示例 1: 输入:nums [1,5,11,5] 输出:true 解释:数组可以分割成 [1, 5, 5] 和…...
Java基于SSM+Vue的平时成绩管理系统
末尾获取源码 开发语言:Java Java开发工具:JDK1.8 后端框架:SSM 前端:采用Vue技术开发 数据库:MySQL5.7和Navicat管理工具结合 服务器:Tomcat8.5 开发软件:IDEA / Eclipse 是否Maven项目&#x…...
flutter开发实战-webview插件flutter_inappwebview使用
flutter开发实战-webview插件flutter_inappwebview使用 在开发过程中,经常遇到需要使用WebView,Webview需要调用原生的插件来实现。常见的flutter的webview插件是webview_flutter,flutter_inappwebview。之前整理了一下webview_flutter&…...
Selenium 浏览器坐标转桌面坐标
背景: 做图表自动化项目需要做拖拽操作,但是selenium提供的拖拽API无效,因此借用pyautogui实现拖拽,但是pyautogui的拖拽是基于Windows桌面坐标实现的,另外浏览器中的坐标与windows桌面坐标并不是一比一对应的关系&am…...
1.6.C++项目:仿muduo库实现并发服务器之channel模块的设计
项目完整版在: 文章目录 一、channel模块:事件管理Channel类实现二、提供的功能三、实现思想(一)功能(二)意义(三)功能设计 四、代码(一)框架(二…...
Redis代替session 实现登录流程
Redis代替session 实现登录流程 如果使用String,他的value,用多占用一点空间,如果使用哈希,则他的value中只会存储他数据本身,如果不是特别在意内存,其实使用String就可以 设计key的具体细节 在设计这个k…...
理解C++强制类型转换
理解C强制类型转换 文章目录 理解C强制类型转换理解C强制转换运算符1 static_cast1.1. static_cast用于内置数据类型之间的转换1.2 用于指针之间的转换 1.3 用于基类与派生类之间的转换2. const_cast2.1示例12.2 示例2——this指针 3.reinterpret_cast4.dynamic_cast C认为C风格…...
《TCP/IP网络编程》代码实现
文章目录 1. 项目说明1.1 项目特点2. 文件说明2.1 脚本文件2.1.1 `TCP_IP.sln`2.1.2 `xmake.lua`2.1.2.1 编译说明2.1.2.2 运行说明2.1.3 章节说明项目代码已经开源在github上! 微信公众号文章同步发表! 1. 项目说明 根据《TCP/IP网络编程》书籍学习,对其中的代码进行整理,…...
【Python】如何使用PyInstaller打包自己写好的代码
使用PyInstaller打包自己写好的代码 零、需求 最近接到一个小单,需要批量修改文档内容,用Python做好后要打包成exe程序给客户的Win7电脑使用,此时需要用到PyInstaller打包自己的代码,想到还要有给用户试用的需求,所以…...
Java 线程的调度与时间片
🙈作者简介:练习时长两年半的Java up主 🙉个人主页:程序员老茶 🙊 ps:点赞👍是免费的,却可以让写博客的作者开兴好久好久😎 📚系列专栏:Java全栈,…...
Java项目-文件搜索工具
目录 项目背景 项目效果 SQLite的下载安装 使用JDBC操作SQLite 第三方库pinyin4j pinyin4j的具体使用 封装pinyin4j 数据库的设计 创建实体类 实现DBUtil 封装FileDao 设计scan方法 多线程扫描 周期性扫描 控制台版本的客户端 图形化界面 设计图形化界面 项目…...
记录开发中遇到关于MySQL的一些问题-MySQL版
本篇文章是记录开发中遇到关于MySQL的一些问题: 希望在这篇文章也能够找到你正在查找的问题,解决问题 Good Luck ! 关于Id 的一些问题 数据库并没有直接写SQL,是通过使用IDEA 同一个公司下的数据库软件生成的(DataGrip…...
2023-10-06 LeetCode每日一题(买卖股票的最佳时机含手续费)
2023-10-06每日一题 一、题目编号 714. 买卖股票的最佳时机含手续费二、题目链接 点击跳转到题目位置 三、题目描述 给定一个整数数组 prices,其中 prices[i]表示第 i 天的股票价格 ;整数 fee 代表了交易股票的手续费用。 你可以无限次地完成交易&…...
openGauss学习笔记-91 openGauss 数据库管理-内存优化表MOT管理-内存表特性-使用MOT-MOT使用MOT外部支持工具
文章目录 openGauss学习笔记-91 openGauss 数据库管理-内存优化表MOT管理-内存表特性-使用MOT-MOT使用MOT外部支持工具91.1 gs_ctl(全量和增量)91.2 gs_basebackup91.3 gs_dump91.4 gs_restore openGauss学习笔记-91 openGauss 数据库管理-内存优化表MOT…...
PostgreSQL快速入门
PostgreSQL快速入门:轻松掌握强大的开源数据库 PostgreSQL(简称Postgres)是一款强大、可定制且免费的开源关系型数据库管理系统(RDBMS)。它以其高级功能、可扩展性和安全性而著称,被广泛用于各种规模的项目…...
MATLAB:线性系统的建模与仿真(含完整程序)
目录 前言实验内容一、先看作业题目要求二、作业正文Modeling LTI systemsEstablish model1.tf(sys2)2. tf(sys3)3.zpk(sys1)4. zpk(sys3)5. ss(sys1)6. ss(sys2)7.[num,den] tfdata(sys1)8.[num,den] tfdata(sys2)9.[num,den] tfdata(sys3)10.[num,den] tfdata(sys1,’v’…...
mycat实现mysql读写分离
架构图: 视频地址...
【C++】STL详解(十一)—— unordered_set、unordered_map的介绍及使用
📝个人主页:Sherry的成长之路 🏠学习社区:Sherry的成长之路(个人社区) 📖专栏链接:C学习 🎯长路漫漫浩浩,万事皆有期待 上一篇博客:【C】STL…...
【C语言】动态通讯录(超详细)
通讯录是一个可以很好锻炼我们对结构体的使用,加深对结构体的理解,在为以后学习数据结构打下结实的基础 这里我们想设计一个有添加联系人,删除联系人,查找联系人,修改联系人,展示联系人,排序这几…...
Mac下docker安装MySQL8.0.34
学习并记录一下如何用docker部署MySQL 在Docker中搜索并下载MySQL8.0.x的最新版本 下载好后,在Images中就可以看到MySQL的镜像了 通过下面的命令也可以查看docker images启动镜像,使用下面的命令就可以启动镜像了docker run -itd --name mysql8.0.34 -…...
基于python编写的excel表格数据标记的exe文件
目录 一、需求: 二、思路: 三、工具 四、设计过程 (一)根据需要导入相关的图形界面库 (二)创建图形窗口 (三)标签设计 (四)方法按钮设计 ࿰…...
acwing算法基础之基础算法--高精度加法算法
目录 1 知识点2 模板 1 知识点 大整数 大整数,它们的长度都为 1 0 6 10^6 106。大整数是指长度为 1 0 6 10^6 106的整数。 大整数 - 大整数 大整数 * 小整数 大整数 / 小整数 把大整数存储到向量中,需要考虑高位在前还是低位在前,低位在前…...
openGauss学习笔记-84 openGauss 数据库管理-内存优化表MOT管理-内存表特性-MOT部署服务器优化:x86
文章目录 openGauss学习笔记-84 openGauss 数据库管理-内存优化表MOT管理-内存表特性-MOT部署服务器优化:x8684.1 BIOS84.2 操作系统环境设置84.3 网络 openGauss学习笔记-84 openGauss 数据库管理-内存优化表MOT管理-内存表特性-MOT部署服务器优化:x86 …...
二分查找:34. 在排序数组中查找元素的第一个和最后一个位置
个人主页 : 个人主页 个人专栏 : 《数据结构》 《C语言》《C》《算法》 文章目录 前言一、题目解析二、解题思路1. 暴力查找2. 一次二分查找 部分遍历3. 两次二分查找分别查找左右端点1.查找区间左端点2. 查找区间右端点 三、代码实现总结 前言 本篇文…...
javaee ssm框架项目整合thymeleaf2.0 更多thymeleaf标签用法 项目结构图
创建ssmthymeleaf项目 创建ssmthymeleaf项目参考此文 thymeleaf更多常用标签 <!DOCTYPE html> <html lang"en" xmlns:th"http://www.thymeleaf.org"> <head><meta charset"UTF-8"><title>Title</title> …...
lv7 嵌入式开发-网络编程开发 11 TCP管理与UDP协议
目录 1 TCP管理 1.1 三次握手 1.2 四次挥手 1.3 保活计时器 2 wireshark安装及实验 3.1 icmp协议抓包演示 3.2 tcp协议抓包演示 3 UDP协议 3.1 UDP 的主要特点: 4 练习 1 TCP管理 1.1 三次握手 TCP 建立连接的过程叫做握手。 采用三报文握手࿱…...
营销网站建设培训/安卓优化大师最新版下载
SOA是面向服务的架构的缩写字。这个缩写字很简单,可是要解释其意义却很困难。因此,向客户证明SOA的投资回报也是不容易的。事实上,据研 究机构Evans Data最近的一项调查显示,研究SOA实施的开发人员面临的最大挑战就是确定投资回报…...
网站做302重定向会怎么样/福州seo兼职
https://blog.csdn.net/my_nice_life/article/details/52837084转载于:https://www.cnblogs.com/feifeicui/p/8650949.html...
建设一个网站大概需要多久/中国企业500强
ls 只显示当前目录可见文件 ls -l 显示当前目录可见文件的详细信息 ls -al 显示所有文件包括隐藏的文件的详细信息 cat命令主要有三个功能; 1,查看文件 在命令行里输入 cat filename 确认后可以查看filename 文件 2.创建文件 输入cat >filename.xxx…...
wordpress 评论双击/seo搜索优化工程师招聘
InputStreamReader 和 OutputStreamWriter类用法简介。 一、InputStreamReader类 InputStreamReader 将字节流转换为字符流。是字节流通向字符流的桥梁。如果不指定字符集编码,该解码过程将使用平台默认的字符编码,如:GBK。 构造方法…...
怎样做网站搜索推广/竞价推广托管公司介绍
在网上看到了一个IOS组件PendulumView,实现了钟摆的动画效果。由于原生的进度条确实是不好看,所以想可以自定义View实现这样的效果,以后也可以用于加载页面的进度条。废话不多说,先上效果图底部黑边是录制时不小心录上的ÿ…...
网站建设设计摘要/上海优化公司
量子公司Rigetti Computing于近日宣布,从美国国防部高级研究计划局(DARPA)获得高达860万美元(约合6077万人民币)的资助,用于开发具有成熟量子优势的全堆栈系统,以解决现实世界中的问题。这项工作是与美国宇航局(NASA)…...