Code Monkey home page Code Monkey logo

backbone's Introduction

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]

backbone's People

Contributors

thomaszh avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.