Skip to content

A WebServer written by C++, which could be suitable for beginners to learn.

Notifications You must be signed in to change notification settings

sirius-zyj/WebServer-sirius

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

WebServer-sirius

A WebServer written in C++, which could be suitable for beginners to learn.

What does sirius contain?

  • epoll and reactor
  • one loop for one thread
  • sql connection pool combined with RAII(soci)
  • redis connection pool combined with RAII(redis++)

What is the directory structure of sirius?

structure

How to establish?

To clone the repository, you can run:

git clone https://github.com/sirius-zyj/WebServer-sirius.git
  • Setup boost

Make sure your compuer have setup boost and libmysql, you can run:

sudo apt-get install libboost-all-dev
sudo apt-get install libmysqlclient-dev
  • Setup mysql

Make sure your computer have setup mysql5.7 or 8.0. Then create your own account and modify the content in the file sirius/plugin/config.cpp accordingly. To create a simple database, you can run:

create database sirius;

USE sirius;
CREATE TABLE user(
    username char(50) NULL,
    password char(50) NULL
)ENGINE=InnoDB;

INSERT INTO user(username, password) VALUES('name', 'password');
  • Setup redis

Make sure your computer have setup redis, you can run:

sudo apt install redis-server
sudo systemctl status redis
  • Make and run

To make the object in your computer, you can run:

cd sirius
sh make.sh

To run the established object, you can run:

sh run.sh

Reference

About

A WebServer written by C++, which could be suitable for beginners to learn.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published