admin avatar

Tetua - an open source lightweight cms program based on golang and mysql, with installation and configuration

🕢 by admin





Tetua - an open source lightweight cms program based on golang and mysql,

with installation and configuration tutorials attached

Tetua - open source lightweight cms program based on golang and mysql

Use mysql database storage, temporarily support github account login. After registration, you can only comment and post permission.

The article editor uses markdown syntax. The best thing is that Tetua also supports cloud storage.

In theory, storage compatible with the S3 protocol can be stored as article attachments.

The following is the Tetua installation and configuration tutorial, first you need to install the mysql database

Not described in detail here, then create a database.

CREATE DATABASE myblog;//Create a database

DROP DATABASE myblog;//Delete a database

1
2
3
4
5
6
7
//The technology is limited. I wanted to download the source code and compile it, but a lot of errors were reported, so here I can use the binary file compiled by the author.
git clone https://github.com/ngocphuongnb/tetua.git
//tetua needs front-end files, remember to put the tetua executor in the same directory as the front-end files
wget https://github.com/ngocphuongnb/tetua/releases/download/v0.0.5-alpha/tetua_0.0.5-alpha_Linux_x86_64.tar.gz
tar zxvf *.tar.gz
cd tetua
./tetua init //Initialize the configuration file

Modify the configuration file

vi config.json

There is a problem here. Spaces are prone to cause problems when copying and pasting. Therefore, it is recommended to manually re-enter the code one by one.

1
2
3
4
5
6
7
8
9
10
{
 "app_env": "production",
 "app_key": "{APP_KEY}",
 "app_port": "3000",
 "db_dsn": "root:[email protected](127.0.0.1:3306)/myblog?charset=utf8mb4&collation=utf8mb4_unicode_ci&parseTime=true", //fill in your mysql database account password and address here
 "github_client_id": "", //These two must be filled in
 "github_client_secret": "",//These two must be filled in
//https://github.com/settings/apps //Create relevant keys here by yourself
 "db_query_logging": false
}

Create a user name and password. If no error is reported, the installation is successful.

./tetua setup -u admin -p password

./tetua run //Run Tetua, if successful, the following information will be displayed

1
2
3
4
5
6
7
8
9
┌────────────────────────────────────────────────── ──┐
 │ Tetua Community │
 │ Fiber v2.30.0 │
 │ http://127.0.0.1:3000 │
 │ (bound on host 0.0.0.0 and port 3000) │
 │ │
 │ Handlers ........... 553 Processes ........... 1 │
 │ Prefork ....... Disabled PID ............. 30014 │
 └────────────────────────────────────────────────── ──┘

At present, the bug is found, that is, Tetua can only be built locally, and then it can be used normally through the front-end nginx or apache reverse proxy.

Tetua's daemon implementation uses supervisor to guard Tetua.

1
2
3
4
5
6
7
8
9
10
11
12
[program:tetua]
directory=/var/lib/tetua
command=/var/lib/tetua run
autostart=true
autorestart=true
startretries=5
user=www
group=www
#redirect_stderr=true
#stdout_logfile=/var/log/supervisor/tetua.log # the name of the log file.
#stdout_logfile_maxbytes=50MB
#stdout_logfile_backups=10

supervisorctl update && supervisorctl reload

Now use nginx or apache to reverse proxy to 127.0.0.1:3000

The following is the configuration of nginx proxy Tetua

1
2
3
4
5
6
7
8
9
location / {
        proxy_pass_header Server;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:3000;
    }

Note that you must first create a topic, which is a topic, in order to publish an article.

iShot_2022-05-17_21.08.45.png

Official Blog

https://tetua.net/?src=vpslala.com

Official GitHub

https://github.com/ngocphuongnb/tetua





💘 相关文章

写一条评论

Based on Golang + fastHTTP + sdb | go1.18.3 Processed in 2ms