赞
踩
一、数据库的操作
CREATE DATABASE Yearning CHARACTER SET utf8 COLLATE utf8_bin;
二、软件的配置
目录 /opt/Yearning-go
配置文件
- #/opt/Yearning-go# cat conf.toml
- [Mysql]
- Db = "Yearning"
- Host = "127.0.0.1"
- Port = "3306"
- Password = "xxxxxx"
- User = "root"
- [General]
- SecretKey = "4BGhf4s1Y4d4UWVU"
三、软件的管理
管理软件的安装配置
- #apt-get install python3-pip
- #pip3 install supervisor
- #echo_supervisord_conf > /etc/supervisord.conf
- #mkdir -p /etc/supervisord
- #ess /etc/supervisord.conf 修改如下部分
- [include]
- files = /etc/supervisord/*.conf
服务管理脚本
- # cat /etc/supervisord/Yearning.conf
- [program:Yearning]
- command = /opt/Yearning-go/Yearning -s -b "sql.deepwise.com" -p "9000"
- directory = /opt/Yearning-go/
- process_name = %(program_name)s_%(process_num)s
- numprocs = 1
- autorestart = true
- startsecs = 1
- stdout_logfile_maxbytes = 50MB
- stdout_logfile_backups = 20
- stdout_logfile = /var/log/Yearning.log
- stderr_logfile = /var/log/Yearning.log
最后 nginx的配置
- # cat /soft/openresty/nginx/conf/vhosts/sql.deepwise.com.conf
- upstream sql {
- server 127.0.0.1:9000;
- }
- server {
- listen 80;
- server_name sql.deepwise.com;
- location / {
- proxy_set_header Host $host;
- proxy_set_header X-Forward-For $remote_addr;
- proxy_pass http://sql;
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。