真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

saltstack部署nginx+php-創(chuàng)新互聯(lián)

因?yàn)榛旧仙a(chǎn)環(huán)境中都是nginx+php的環(huán)境,所以就不單獨(dú)列出salt部署php的過(guò)程了,這里就結(jié)合我在生產(chǎn)環(huán)境中的腳本進(jìn)行nginx+php環(huán)境的部署。

創(chuàng)新互聯(lián)堅(jiān)持“要么做到,要么別承諾”的工作理念,服務(wù)領(lǐng)域包括:成都網(wǎng)站設(shè)計(jì)、網(wǎng)站建設(shè)、外貿(mào)網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣等服務(wù),滿(mǎn)足客戶(hù)于互聯(lián)網(wǎng)時(shí)代的平泉網(wǎng)站設(shè)計(jì)、移動(dòng)媒體設(shè)計(jì)的需求,幫助企業(yè)找到有效的互聯(lián)網(wǎng)解決方案。努力成為您成熟可靠的網(wǎng)絡(luò)建設(shè)合作伙伴!

部署規(guī)劃:

1)編譯安裝libiconv、libmcrypt、mhash以及mcrypt

2)編譯安裝php

3)添加啟動(dòng)停止腳本

4)添加到系統(tǒng)服務(wù)并設(shè)置開(kāi)機(jī)啟動(dòng)

5)拷貝日志切割腳本

6)添加日志切割定時(shí)任務(wù)

7)安裝memcached/redis/protobuf擴(kuò)展

8)修改php.ini加載php擴(kuò)展

salt部署目錄架構(gòu):

[root@salt-master ~]# tree /srv/salt/base/ /srv/salt/base/ ├── cron │   ├── files │   │   ├── nginx_cut_log.sh │   │   └── php_cut_log.sh │   ├── nginx.sls │   └── php.sls ├── nginx │   ├── files │   │   ├── nginx │   │   ├── nginx-1.6.3.tar.gz │   │   └── nginx.conf │   ├── install.sls │   └── service.sls ├── packages │   └── install.sls ├── pcre │   ├── files │   │   └── pcre-8.37.tar.gz │   └── install.sls ├── php │   ├── extension.sls │   ├── files │   │   ├── libmemcached-1.0.18.tar.gz │   │   ├── memcached-2.2.0.tgz │   │   ├── php-5.6.16.tar.gz │   │   ├── php-fpm │   │   ├── php-fpm.conf │   │   ├── php.ini │   │   ├── phpredis-2.2.4.tar.gz │   │   └── protobuf.so │   ├── install.sls │   ├── libiconv │   │   └── files │   │       └── libiconv-1.14.tar.gz │   ├── libiconv.sls │   ├── libmcrypt │   │   └── files │   │       └── libmcrypt-2.5.8.tar.gz │   ├── libmcrypt.sls │   ├── mcrypt │   │   └── files │   │       └── mcrypt-2.6.8.tar.gz │   ├── mcrypt.sls │   ├── mhash │   │   └── files │   │       └── mhash-0.9.9.9.tar.gz │   ├── mhash.sls │   └── service.sls ├── top.sls └── user     ├── nginx.sls     └── php.sls 18 directories, 34 files

安裝libiconv:

[root@salt-master base]# cat php/libiconv.sls  libiconv-source-install:   file.managed:     - name: /opt/tools/libiconv-1.14.tar.gz     - source: salt://php/libiconv/files/libiconv-1.14.tar.gz     - user: root     - group: root     - mode: 755   cmd.run:     - name: cd /opt/tools/ && tar -zxf libiconv-1.14.tar.gz && cd libiconv-1.14 && ./configure --prefix=/usr/local && make && make install && /sbin/ldconfig      - unless: test -e /usr/local/lib/libiconv.so.2.5.1     - require:       - file: libiconv-source-install

安裝limcrypt:

[root@salt-master base]# cat php/libmcrypt.sls  libmcrypt-source-install:   file.managed:     - name: /opt/tools/libmcrypt-2.5.8.tar.gz     - source: salt://php/libmcrypt/files/libmcrypt-2.5.8.tar.gz     - user: root     - group: root     - mode: 755   cmd.run:     - name: cd /opt/tools && tar -zxf libmcrypt-2.5.8.tar.gz && cd libmcrypt-2.5.8 && ./configure && make && make install && ldconfig && cd libltdl && ./configure --enable-ltdl-install && make && make install && /sbin/ldconfig     - unless: test -e /usr/local/lib/libmcrypt.so.4.4.8     - require:       - file: libmcrypt-source-install

安裝mhash:

[root@salt-master base]# cat php/mhash.sls  mhash-source-install:   file.managed:     - name: /opt/tools/mhash-0.9.9.9.tar.gz     - source: salt://php/mhash/files/mhash-0.9.9.9.tar.gz     - user: root     - group: root     - mode: 755   cmd.run:     - name: cd /opt/tools/ && tar -zxf mhash-0.9.9.9.tar.gz && cd mhash-0.9.9.9 && ./configure && make && make install && ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la && ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so && ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4 && ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8 && ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a && ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la && ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so && ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2 && ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1 && ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config     - unless: test -e /usr/local/lib/libmhash.a     - require:       - file: mhash-source-install

安裝mcrypt:

[root@salt-master base]# cat php/mcrypt.sls  mcrypt-source-install:   file.managed:     - name: /opt/tools/mcrypt-2.6.8.tar.gz     - source: salt://php/mcrypt/files/mcrypt-2.6.8.tar.gz     - user: root     - group: root     - mode: 644   cmd.run:     - name: cd /opt/tools/ && tar -zxf mcrypt-2.6.8.tar.gz && cd mcrypt-2.6.8 && /sbin/ldconfig && ./configure && make && make install     - unless: test -e /usr/local/bin/mcrypt     - require:       - file: mcrypt-source-install

安裝php:

[root@salt-master base]# cat php/install.sls  include:   - packages.install   - user.php   - php.libiconv   - php.libmcrypt   - php.mhash   - php.mcrypt php-source-install:   file.managed:     - name: /opt/tools/php-5.6.16.tar.gz     - source: salt://php/files/php-5.6.16.tar.gz     - user: root     - group: root     - mode: 755   cmd.run:     - name: cd /opt/tools/ && tar -zxf php-5.6.16.tar.gz && cd php-5.6.16 && ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-libxml-dir --enable-xml --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-bcmath --enable-mbstring --enable-gd-native-ttf --enable-sockets --enable-mysqlnd --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-zip --enable-inline-optimization --with-gd --with-bz2 --with-zlib --with-mcrypt --with-mhash --with-openssl --with-xmlrpc --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --without-pear --disable-ipv6 --disable-pdo --with-gettext --disable-debug --without-pdo-sqlite --disable-rpath --enable-shmop --enable-sysvsem --with-curl --with-curlwrappers --enable-mbregex --enable-pcntl --enable-soap --enable-sigchild --enable-pdo && make ZEND_EXTRA_LIBS='-liconv' && make install     - unless: test -d /usr/local/php     - require:       - file: php-source-install       - user: php-user-group       - cmd: libiconv-source-install       - cmd: libmcrypt-source-install       - cmd: mcrypt-source-install       - cmd: mhash-source-install

配置php服務(wù):

[root@salt-master base]# cat php/service.sls  include:   - php.install   - cron.php /usr/local/php/etc:   file.directory:     - user: www     - group: www     - mode: 644     - makedirs: True /usr/local/php/etc/php-fpm.conf:   file.managed:     - source: salt://php/files/php-fpm.conf     - user: www     - group: www     - mode: 644 /etc/php.ini:   file.managed:     - source: salt://php/files/php.ini     - user: www     - group: www     - mode: 644 /etc/profile:   file.append:     - text:       - export PATH=$PATH:/usr/local/php/bin:/usr/local/php/sbin php-init:   file.managed:     - name: /etc/init.d/php-fpm     - source: salt://php/files/php-fpm     - user: root     - group: root     - mode: 755   cmd.run:     - name: chkconfig --add php-fpm && source /etc/profile     - unless: chkconfig --list|grep php-fpm     - require:       - file: php-init php-service:   service.running:     - name: php-fpm     - enable: True     - restart: True     - require:       - cmd: php-init     - watch:       - file: /etc/php.ini       - file: /usr/local/php/etc/php-fpm.conf

部署定時(shí)任務(wù):

[root@salt-master base]# cat cron/php.sls  php-crond-job:   file.managed:     - name: /opt/tools/scripts/php_cut_log.sh     - source: salt://cron/files/php_cut_log.sh     - user: root     - group: root     - mode: 755 /bin/bash /opt/tools/scripts/php_cut_log.sh >/dev/null 2>&1:   cron.present:     - identifier: cut php daily logs job     - user: root     - minute: '0'     - hour: '0'     - require:       - file: php-crond-job

安裝php擴(kuò)展:

[root@salt-master base]# cat php/extension.sls  include:   - php.service libmemcached-source-install:   file.managed:     - name: /opt/tools/libmemcached-1.0.18.tar.gz     - source: salt://php/files/libmemcached-1.0.18.tar.gz     - user: root     - group: root     - mode: 644   cmd.run:     - name: cd /opt/tools && tar -zxf libmemcached-1.0.18.tar.gz && cd libmemcached-1.0.18 && ./configure --prefix=/usr/local/libmemcached --with-memcached && make && make install     - unless: test -d /usr/local/libmemcached     - require:       - file: libmemcached-source-install memcached-source-install:   file.managed:     - name: /opt/tools/memcached-2.2.0.tgz     - source: salt://php/files/memcached-2.2.0.tgz     - user: root     - group: root     - mode: 644   cmd.run:     - name: cd /opt/tools/ && tar -zxf memcached-2.2.0.tgz && cd memcached-2.2.0 && /usr/local/php/bin/phpize && ./configure --enable-memcached --with-php-config=/usr/local/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached && make && make install     - unless: test -x /usr/bin/memcached     - require:       - file: memcached-source-install phpredis-source-install:   file.managed:     - name: /opt/tools/phpredis-2.2.4.tar.gz     - source: salt://php/files/phpredis-2.2.4.tar.gz     - user: root     - group: root     - mode: 644   cmd.run:     - name: cd /opt/tools && tar -zxf phpredis-2.2.4.tar.gz && cd phpredis-2.2.4 && /usr/local/php/bin/phpize && ./configure --with-php-config=/usr/local/php/bin/php-config && make && make install     - unless: test -e /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/redis.so     - require:       - file: phpredis-source-install protobuf-extension:   file.managed:     - name: /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/protobuf.so     - source: salt://php/files/protobuf.so     - user: www     - group: www     - mode: 755 extension-init:   file.managed:     - name: /usr/local/php/etc/php.ini     - source: salt://php/files/php.ini     - user: www     - group: www     - replace: True     - mode: 644   cmd.run:     - name: chown -R www:www /usr/local/php && source /etc/profile     - require:       - file: protobuf-extension       - file: extension-init     - watch:        - file: /usr/local/php/etc/php.ini

top.sls文件:

[root@salt-master base]# cat top.sls  base:   'salt-minion02.contoso.com':     - nginx.service     - php.service     - php.extension

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線(xiàn),公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性?xún)r(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專(zhuān)為企業(yè)上云打造定制,能夠滿(mǎn)足用戶(hù)豐富、多元化的應(yīng)用場(chǎng)景需求。


本文標(biāo)題:saltstack部署nginx+php-創(chuàng)新互聯(lián)
文章網(wǎng)址:http://weahome.cn/article/ddhsdj.html

其他資訊

在線(xiàn)咨詢(xún)

微信咨詢(xún)

電話(huà)咨詢(xún)

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部