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

歡迎來到夢(mèng)飛科技

服務(wù)器租用

當(dāng)前優(yōu)惠活動(dòng):

Debian 8.2系統(tǒng)安裝設(shè)置Nginx PHP MySQL Java Tomcat情況

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

/data

    /nginx

        /html

            /phpmyadmin

            html/php文件位置

    /tomcat

        /tomcat1

        /tomcat2

    /soft

        /nginx

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

        /php

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

        /src

            下載的源碼文件

以下除了utils.py不需要運(yùn)行外,其他劇本由上到下依次運(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安裝

夢(mèng)飛科技 - 全球數(shù)據(jù)中心基礎(chǔ)服務(wù)領(lǐng)先供應(yīng)商

Copyright © 2003-2019 MFISP.COM. 國(guó)外服務(wù)器租用 IDC公司 版權(quán)所有 ? 粵ICP備11019662號(hào)

主站蜘蛛池模板: 富蕴县| 双辽市| 喜德县| 宝山区| 屏山县| 瓮安县| 德钦县| 开平市| 阳西县| 长治市| 天峨县| 汤原县| 河源市| 卢湾区| 岚皋县| 孝义市| 九江县| 河池市| 乌什县| 临海市| 昌都县| 抚宁县| 宁安市| 吉安县| 鲁山县| 化州市| 郯城县| 丹巴县| 岳阳县| 临沭县| 涡阳县| 襄汾县| 张北县| 正宁县| 石嘴山市| 开阳县| 柘城县| 长春市| 景泰县| 峨眉山市| 海盐县|