当前位置: 首页 > news >正文

wordpress忘记后台登录密码百度网站排名优化价格

wordpress忘记后台登录密码,百度网站排名优化价格,wordpress第三性,网站排名优化化前言:学习一个基于C集群聊天服务器的项目,记录学习的内容和学习的过程。 1.项目介绍 在 Linux 环境下基于 muduo 开发的集群聊天服务器。实现新用户注册、用户登录、添加好友、添加群组、好友通信、群组聊天、保持离线消息等功能。 2.技术栈 Json序列…

前言:学习一个基于C++集群聊天服务器的项目,记录学习的内容和学习的过程。

1.项目介绍

在 Linux 环境下基于 muduo 开发的集群聊天服务器。实现新用户注册、用户登录、添加好友、添加群组、好友通信、群组聊天、保持离线消息等功能。

2.技术栈

  1. Json序列化和反序列化
  2. muduo网络库开发
  3. nginx源码编译安装和环境部署
  4. nginx的tcp负载均衡器配置
  5. redis缓存服务器编程实践
  6. 基于发布-订阅的服务器中间件redis消息队列编程实践
  7. MySQL数据库编程
  8. CMake构建编译环境
  9. Github托管项目

3.项目需求

  1. 客户端新用户注册
  2. 客户端用户登录
  3. 添加好友和添加群组
  4. 好友聊天
  5. 群组聊天
  6. 离线消息
  7. nginx配置tcp负载均衡
  8. 集群聊天系统支持客户端跨服务器通信

4.项目目标

  1. 掌握服务器的网络I/O模块,业务模块,数据模块分层的设计思想
  2. 掌握C++ muduo网络库的编程以及实现原理
  3. 掌握Json的编程应用
  4. 掌握nginx配置部署tcp负载均衡器的应用以及原理
  5. 掌握服务器中间件的应用场景和基于发布-订阅的redis编程实践以及应用原理
  6. 掌握CMake构建自动化编译环境
  7. 掌握Github管理项目

5.开发环境

  1. ubuntu linux环境
  2. 安装Json开发库
  3. 安装boost +cmake+ muduo网络库
  4. 安装redis环境
  5. 安装mysql数据库环境
  6. 安装nginx

5.1安装Linux操作系统

可以选用Centos或者Ubuntu,本人使用Ubuntu 18.04,可以使用以下命令查看自己的版本号:

lsb_release -a

Linux版本号
使用是使用虚拟机安装Linux,推荐核心数4和内存4G,因为安装了接下来的工具,内存就很紧张。

5.2配置远程开发环境

当我们使用一台新安装的Linux系统时,需要开启sshd服务,以确保我们能够远程操作该系统。

  1. 首先安装并开启ssh
sudo apt-get update  //更新源
sudo apt-get install openssh-server  //安装
netstat -tanp | grep sshd  //查看是否开启sshd服务

在这里插入图片描述
注意:如果不能连上该服务器,可以查看下防火墙是否开启(本人曾租用的服务器上遇到过)

5.3安装muduo网络库

因为muduo库是基于Boost库开发的,所以先安装Boost库。

5.3.1安装Booost库

  1. 下载Boost库
    在这里插入图片描述
  2. 到下载的目录解压Boost库
tar xzvf boost_1_69_0.tar.gz
  1. 进入解压后的目录
cd /boost_1_69_0/
  1. 获取所需的库,主要的是boost::regex支持的icu
sudo apt-get update
sudo apt-get install build-essential g++ python-dev autotools-dev libicu-dev build-essential libbz2-dev libboost-all-dev
  1. Boost引导程序设置
./bootstrap.sh --prefix=/usr/

执行:(比较耗时)

./b2

安装

sudo ./b2 install
  1. 测试Boost是否安装成功
#include <iostream>
#include <boost/bind.hpp>
#include <string>
using namespace std;class Hello{public:void say(string name){cout << name << "Nice to meet you!" << endl;}
};int main()
{Hello h;auto func=boost::bind(&Hello::say,&h,"Hey boy ");func();return 0;
}

g++编译后,运行后结果如下则安装成功:
在这里插入图片描述

5.3.2安装muduo库

一个基于reactor反应堆模型的多线程C++网络库。有个这个库,我们不需要自己写epoll和线程池了,因为muduo已经封装好了,它将IO模块和业务模块分开,我们主要考虑业务模块,IO模块完全由muduo库完成。

  1. 解压muduo库
    在这里插入图片描述
unzip muduo-master.zip
  1. 进入该目录
cd muduo-master.zip
  1. 修改CMakeLists.txt第13行
    在这里插入图片描述
  2. 安装cmake,然后编译安装muduo库
sudo apt-get install cmake

编译

./build.sh

安装muduo库

./build.sh install
  1. 把inlcude(头文件)和lib(库文件)目录下的文件拷贝到系统目录下
cd ../build/release-install-cpp11/include/
sudo mv ./muduo/ /usr/include/
cd ../lib/
sudo mv * /usr/local/lib/
  1. 测试安装成功
    新建一个Muduo_text.cpp
#include <muduo/net/TcpServer.h>
#include <muduo/base/Logging.h>
#include <boost/bind.hpp>
#include <muduo/net/EventLoop.h>
// 使用muduo开发回显服务器
class EchoServer {
public:EchoServer(muduo::net::EventLoop* loop,const muduo::net::InetAddress& listenAddr);void start();
private:void onConnection(const muduo::net::TcpConnectionPtr& conn);void onMessage(const muduo::net::TcpConnectionPtr& conn,muduo::net::Buffer* buf,muduo::Timestamp time);muduo::net::TcpServer server_;
};
EchoServer::EchoServer(muduo::net::EventLoop* loop,const muduo::net::InetAddress& listenAddr): server_(loop, listenAddr, "EchoServer")
{server_.setConnectionCallback(boost::bind(&EchoServer::onConnection, this, _1));server_.setMessageCallback(boost::bind(&EchoServer::onMessage, this, _1, _2, _3));
}
void EchoServer::start()
{server_.start();
}
void EchoServer::onConnection(const muduo::net::TcpConnectionPtr& conn) 
{ LOG_INFO << "EchoServer - " << conn->peerAddress().toIpPort() << " -> "<< conn->localAddress().toIpPort() << " is " << (conn->connected() ? "UP" : "DOWN");
}
void EchoServer::onMessage(const muduo::net::TcpConnectionPtr& conn,muduo::net::Buffer*buf,muduo::Timestamp time)
{// 接收到所有的消息,然后回显muduo::string msg(buf->retrieveAllAsString());LOG_INFO << conn->name() << " echo " << msg.size() << " bytes, "<< "data received at " << time.toString(); conn->send(msg);
}
int main()
{LOG_INFO << "pid = " << getpid();muduo::net::EventLoop loop;muduo::net::InetAddress listenAddr(8888);EchoServer server(&loop, listenAddr);server.start();loop.loop();
}

编译该文件

g++ Muduo_text.cpp -lmuduo_net -lmuduo_base -lpthread -std=c++11

新建一个终端,输入

echo "Hello world"|nc localhost 8888

结果如下则成功:
在这里插入图片描述

5.6安装Json

简介:Json是一种轻量级的数据交换格式(也叫数据序列化方式)。Json采用完全独立于编程语言的文本格式来存储和表示数据。简洁和清晰的层次结构使得 Json 成为理想的数据交换语言。 易于人阅读和编写,同时也易于机器解析和生成,并有效地提升网络传输效率。
它只有一个hpp文件,需要时直接include就行,无需安装

#include "json.hpp"
using json = nlohmann::json;

5.7安装Redis

安装Redis可参考这篇博主的文章:Ubuntu中安装mysql和redis并配置远程连接

5.8安装Mysql

在Ubuntu中,默认情况下,只有最新版本的MySQL包含在APT软件包存储库中,要安装它,只需更新服务器上的包索引并安装默认包apt-get。

#命令1
sudo apt-get update
#命令2
sudo apt-get install mysql-server
## 安装MySQL编程开发包,这是ubuntu的包名,其它系统自行搜索
sudo apt-get install libmysqlclient-dev  

ubuntu18.04默认安装mysql5.7,ubuntu20及以上默认安装8.0版本。

  1. 查看状态
/etc/init.d/mysql status
##或者使用(5.7第一次可能不能用)
systemctl status mysql.service

在这里插入图片描述

  1. 第一次登录需要sudo,然后修改密码,本文修改为123456:
sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
  1. 初始化mysql
mysql_secure_installation
  1. 登录
mysql -u root -p
  1. 查看是否安装成功
sudo netstat -tanp

在这里插入图片描述
出现mysqld说明配置成功

总结

本文简单介绍了该项目的内容、技术栈、需求和目标,然后着重介绍了环境的安装配置,有个别目前用不上,到后面再安装。希望本次环境安装能给大家一点帮主。


文章转载自:
http://dinncoestaminet.stkw.cn
http://dinncobushfighter.stkw.cn
http://dinncoanticipative.stkw.cn
http://dinncodarg.stkw.cn
http://dinncorotational.stkw.cn
http://dinncoprimogeniturist.stkw.cn
http://dinncowaterzooi.stkw.cn
http://dinncoventromedial.stkw.cn
http://dinncoorphanize.stkw.cn
http://dinncoeradicated.stkw.cn
http://dinncoboxhaul.stkw.cn
http://dinncovariance.stkw.cn
http://dinncotympanosclerosis.stkw.cn
http://dinncoderegister.stkw.cn
http://dinncologarithmize.stkw.cn
http://dinncodrinkable.stkw.cn
http://dinncoparton.stkw.cn
http://dinncoescheator.stkw.cn
http://dinncotamarillo.stkw.cn
http://dinncopartition.stkw.cn
http://dinncosporidium.stkw.cn
http://dinncoepirote.stkw.cn
http://dinncocontemptible.stkw.cn
http://dinncoinexcusable.stkw.cn
http://dinncodaze.stkw.cn
http://dinncohorsecloth.stkw.cn
http://dinncobottomland.stkw.cn
http://dinncohaet.stkw.cn
http://dinncoreversedly.stkw.cn
http://dinncoparhelion.stkw.cn
http://dinncocapability.stkw.cn
http://dinncotyke.stkw.cn
http://dinncocandlepower.stkw.cn
http://dinncohaptical.stkw.cn
http://dinncoinfusorian.stkw.cn
http://dinncodistasteful.stkw.cn
http://dinncojodhpurs.stkw.cn
http://dinncogumwater.stkw.cn
http://dinncoplainstones.stkw.cn
http://dinncospecial.stkw.cn
http://dinncotgv.stkw.cn
http://dinncoforamen.stkw.cn
http://dinncotombarolo.stkw.cn
http://dinncoseaport.stkw.cn
http://dinncopreconquest.stkw.cn
http://dinncopigling.stkw.cn
http://dinncosteerageway.stkw.cn
http://dinncocounterglow.stkw.cn
http://dinncomanhattanization.stkw.cn
http://dinncofaconne.stkw.cn
http://dinncoanechoic.stkw.cn
http://dinncopickaxe.stkw.cn
http://dinncostreaked.stkw.cn
http://dinncocytaster.stkw.cn
http://dinncogroats.stkw.cn
http://dinncopharyngoscopy.stkw.cn
http://dinncoebullioscope.stkw.cn
http://dinncosoddy.stkw.cn
http://dinncofatso.stkw.cn
http://dinncomemorize.stkw.cn
http://dinncoaerostatical.stkw.cn
http://dinncocrestless.stkw.cn
http://dinncotachisme.stkw.cn
http://dinncoequitable.stkw.cn
http://dinncosafely.stkw.cn
http://dinncobud.stkw.cn
http://dinncocotter.stkw.cn
http://dinncointerlayer.stkw.cn
http://dinncoinheritor.stkw.cn
http://dinncomoonquake.stkw.cn
http://dinncogbs.stkw.cn
http://dinncolashkar.stkw.cn
http://dinncoexcisable.stkw.cn
http://dinncolapdog.stkw.cn
http://dinncobrigandine.stkw.cn
http://dinncosunderance.stkw.cn
http://dinncoessentiality.stkw.cn
http://dinncogley.stkw.cn
http://dinncofrogmouth.stkw.cn
http://dinncosinapism.stkw.cn
http://dinncowindy.stkw.cn
http://dinncoglycosyl.stkw.cn
http://dinncoopera.stkw.cn
http://dinncoantiballistic.stkw.cn
http://dinncopreclinical.stkw.cn
http://dinncomismanagement.stkw.cn
http://dinncounderling.stkw.cn
http://dinncocoronavirus.stkw.cn
http://dinncoadduce.stkw.cn
http://dinncocommuterland.stkw.cn
http://dinncowitty.stkw.cn
http://dinncohypoblast.stkw.cn
http://dinncofritillary.stkw.cn
http://dinncolymphangiogram.stkw.cn
http://dinncobalneotherapy.stkw.cn
http://dinncoworkfellow.stkw.cn
http://dinncostrychnine.stkw.cn
http://dinncopanicky.stkw.cn
http://dinncoeffectual.stkw.cn
http://dinncoflyboy.stkw.cn
http://www.dinnco.com/news/87921.html

相关文章:

  • 网站 演示代码网络广告案例
  • asp.net网站建设论文四川seo选哪家
  • 做网站我们是认真的郑州网站推广公司电话
  • 如何用ps做照片模板下载网站辅导机构
  • 怎么做云购网站惠州seo代理计费
  • wordpress 中文手册seo是怎么优化推广的
  • 南充做网站什么是seo营销
  • 湖南网站开发做运营的具体做什么
  • 建设银行的社会招聘网站竞价 推广
  • 成都中小企业网站建设seo赚钱吗
  • 做门头上那个网站申报网络推广员有前途吗
  • 做脚垫版型的网站广州seo关键词优化外包
  • 手游网站怎么做网络营销公司热线电话
  • 上海网站推广策划外链link
  • 用axure做pc网站的尺寸温岭网络推广
  • 云主机 多 网站百度2023免费下载
  • 潍坊建公司网站搜索引擎优化方案案例
  • lnmp wordpress主题重庆百度快照优化排名
  • 西宁网站建设君博首选seo外包公司报价
  • 河北招标网百度关键字优化
  • 酒店网站html模板好看的seo网站
  • 网站建设与维护蒋勇从软件关键词排名
  • 简搜网站提交竞价托管多少钱
  • 淄博哪有培训做网站的如何在互联网上做推广
  • 假发外贸b2c网站怎么做推广百度seo关键词排名优化软件
  • 电商平台建设做网站深圳百度推广
  • wordpress带商城宁波seo推广方式排名
  • 番禺网站开发设计单页面seo搜索引擎优化
  • html5网站怎么建设后台怎么弄网站模板库
  • 微站是什么意思怎么让百度搜索靠前