Thanks to visit codestin.com
Credit goes to github.com

Skip to content

liumingli/backbone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

backbone

使用Tornado(Python)框架搭建网站的示例。

include

  • 7x24hs 是主站,单页网站,个人信息展示,Demo
  • qrcode 输入URL,获取二维码,Demo
  • kit (语keep in touch),各站点下面联系我的发送消息,通过发送email提醒站长, Demo

部署系统环境:

Linux CentOS 7.0 x86-64

Python 2.7.3

# yum install libtool -y
# yum install zlib zlib-devel -y
# yum install openssl -y
# yum install pcre -y
# yum install nginx -y
# yum install openssl-devel -y
# yum install python-devel -y

# pip install --upgrade tornado
# pip install --upgrade pymongo
# pip install --upgrade xlwt
# pip install --upgrade xhtml2pdf
# pip install --upgrade wechat-sdk
# pip install --upgrade qrcode
# yum install libjpeg-turbo-devel -y
# pip install --upgrade Image

Nginx配置

vi /etc/nginx/conf.d/7x24hs.com.conf

server {
    listen   80;
    root /root/nmapp2_venv;
    index main.py index.html;

    server_name 7x24hs.com;

    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_pass http://127.0.0.1:8001;
    }
}

server {
    listen   443 ssl;
    root /root/nmapp2_venv;
    index main.py index.html;

    server_name 7x24hs.com;

    ssl          on;
    ssl_certificate       /etc/nginx/sslkey/7x24hs.com_bundle.crt;
    ssl_certificate_key   /etc/nginx/sslkey/7x24hs.com.key;
    ssl_session_timeout   5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
    ssl_prefer_server_ciphers  on;

    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_pass http://127.0.0.1:8001;
    }
}

vi /etc/nginx/conf.d/kit.7x24hs.com.conf

server {
    listen   80;
    root /root/nmapp2_venv;
    index main.py index.html;

    server_name kit.7x24hs.com;

    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_pass http://127.0.0.1:8005;
    }
}

vi /etc/nginx/conf.d/qrcode.7x24hs.com.conf

server {
    listen   80;
    root /root/nmapp2_venv;
    index main.py index.html;

    server_name qrcode.7x24hs.com;

    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_pass http://127.0.0.1:8003;
    }
}

vi /etc/nginx/conf.d/ssl.conf

# HTTPS server
server {
    listen       443 ssl;
    server_name  localhost;

    ssl          on;
    ssl_certificate       /etc/nginx/sslkey/7x24hs.com_bundle.crt;
    ssl_certificate_key   /etc/nginx/sslkey/7x24hs.com.key;
    ssl_session_timeout   5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
    ssl_prefer_server_ciphers  on;

    location / {
        root   html;
        index  index.html index.htm;
    }
}

使用外部的smtp服务器发送mail

vi /etc/mail.rc

set [email protected]
set smtp=smtp.mxhichina.com
set [email protected]
set smtp-auth-password=need4sPeedno
set smtp-auth=login

然后通过命令来发送测试邮件

echo "hello word" | mail -s "title” [email protected]

About

basic micro service for others project. restful API for all.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors