欧美一区2区三区4区公司二百,国产精品婷婷午夜在线观看,自拍偷拍亚洲精品,国产美女诱惑一区二区

歡迎來到云服務(wù)器

服務(wù)器租用

Debian 8.2系統(tǒng)安裝配置Nginx PHP MySQL Java Tomcat環(huán)境

劇本一鍵安裝好之后的目次布局:

/data

    /nginx

        /html

            /phpmyadmin

            html/php文件位置

    /tomcat

        /tomcat1

        /tomcat2

    /soft

        /nginx

            nginx措施/設(shè)置文件位置

        /php

            php措施/設(shè)置文件位置

        /src

            下載的源碼文件

以下除了utils.py不需要運(yùn)行外,香港網(wǎng)存空間 北京主機(jī),其他劇本由上到下依次運(yùn)行即可

首先要舉辦編譯情況安裝

utils

# coding:utf-8
import os
__author__ = 'gavin'
def apt_install():
    os.system("apt-get -y install gcc g++ automake autoconf libtool make build-essential pkg-config")
    if not os.path.exists("/data"):
        os.mkdir("/data")
        os.mkdir("/data/soft")
        os.mkdir("/data/soft/src")
        pass
    if not os.path.exists("/data/soft"):
        os.mkdir("/data/soft")
        os.mkdir("/data/soft/src")
        pass
    if not os.path.exists("/data/soft/src"):
        os.mkdir("/data/soft/src")
if __name__ == "__main__":
    pass

mysql安裝

# coding:utf-8
import os
__author__ = 'gavin'
def apt_install():
    os.system("apt-get install mysql-server  mysql-client")
    pass
def config_cha(user, passwd):
    command = '''myslq -u%s -p%s -e " SET character_set_client = utf8 ;SET character_set_connection = utf8 ;SET character_set_database = utf8 ;SET character_set_results = utf8 ;SET character_set_server = utf8 ; "''' % (
        user, passwd)
    os.system(command)
if __name__ == "__main__":
    apt_install()
    config_cha("root", "xxxx")
    pass

nginx安裝

# coding:utf-8
__author__ = 'gavin'
import os
import utils
def apt_prepare():
    utils.apt_install()
    os.chdir("/data/soft/src")
    if not os.path.exists("/data/soft/src/pcre-8.38.tar.gz"):
        os.system("wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz")
    os.system("tar -zxf pcre-8.38.tar.gz")
    os.chdir("/data/soft/src/pcre-8.38")
    os.system("./configure")
    os.system("make")
    os.system("make install")
    os.chdir("/data/soft/src")
    if not os.path.exists("/data/soft/src/zlib-1.2.8.tar.gz"):
        os.system("wget http://zlib.net/zlib-1.2.8.tar.gz")
    os.system("tar -zxf zlib-1.2.8.tar.gz")
    os.chdir("/data/soft/src/zlib-1.2.8")
    os.system("./configure")
    os.system("make")
    os.system("make install")
    os.chdir("/data/soft/src")
    if not os.path.exists("/data/soft/src/openssl-1.0.1s.tar.gz"):
        os.system("wget http://www.openssl.org/source/openssl-1.0.1s.tar.gz")
    os.system("tar -zxf openssl-1.0.1s.tar.gz")
    os.chdir("/data/soft/src/openssl-1.0.1s")
    # os.system("./config --prefix=/usr/local --openssldir=/usr/local/ssl")
    os.system("./config")
    os.system("make")
    os.system("make install")
    # os.system("./config shared --prefix=/usr/local --openssldir=/usr/local/ssl")
    # os.system("make clean")
    # os.system("make")
    # os.system("make install")
    pass
def apt_install():
    os.chdir("/data/soft/src")
    if not os.path.exists("/data/soft/src/nginx-1.9.9.tar.gz"):
        os.system("wget http://nginx.org/download/nginx-1.9.9.tar.gz")
    os.system("tar -zxf nginx-1.9.9.tar.gz")
    os.chdir("/data/soft/src/nginx-1.9.9")
    os.system("./configure --sbin-path=/data/soft/nginx/nginx "
              "--prefix=/data/nginx "
              "--conf-path=/data/soft/nginx/nginx.conf "
              "--pid-path=/data/soft/nginx/nginx.pid "
              "--error-log-path=/data/soft/nginx/logs/error.log "
              "--http-log-path=/data/soft/nginx/logs/access.log "
              "--with-http_ssl_module "
              "--with-pcre=/data/soft/src/pcre-8.38 "
              "--with-zlib=/data/soft/src/zlib-1.2.8 "
              "--with-openssl=/data/soft/src/openssl-1.0.1s")
    os.system("make")
    os.system("make install")
    os.system("echo "/data/soft/nginx/nginx" >> /etc/rc.local")
    os.system("/data/soft/nginx/nginx")
    pass
def config():
    newstrs = '''
#user  nobody;
worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    include vhost/*.conf;
    server {
        listen       80;
        server_name  localhost;
        location / {
            root   html;
            index  index.html index.htm index.php;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
        location ~ .php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include fastcgi_params;
        }
    }
}'''
    if not os.path.exists("/data/soft/nginx/nginx.conf.back"):
        os.system("cp /data/soft/nginx/nginx.conf /data/soft/nginx/nginx.conf.back")
        pass
    if not os.path.exists("/data/soft/nginx/vhost"):
        os.mkdir("/data/soft/nginx/vhost")
        pass
    fw = file("/data/soft/nginx/nginx.conf", 'w')
    fw.write(newstrs)
    fw.close()
    os.system("/data/soft/nginx/nginx -s reload")
if __name__ == "__main__":
    apt_prepare()
    apt_install()
    config()
    pass

php安裝

騰訊云代理

Copyright © 2003-2021 MFISP.COM. 國外vps服務(wù)器租用 夢飛云服務(wù)器租用 版權(quán)所有 ? 粵ICP備11019662號

主站蜘蛛池模板: 阆中市| 镇宁| 五峰| 金堂县| 罗田县| 海门市| 渑池县| 定远县| 徐州市| 肃北| 绥江县| 沈丘县| 和林格尔县| 淮安市| 安陆市| 阿克陶县| 丘北县| 金湖县| 金秀| 江陵县| 西宁市| 虞城县| 岳池县| 通道| 安龙县| 太保市| 察哈| 尖扎县| 南岸区| 九寨沟县| 江达县| 托里县| 浪卡子县| 海南省| 大理市| 安图县| 天峻县| 绿春县| 梨树县| 天水市| 勐海县|