centOS 部署伺服器(二)

來源:互聯網
上載者:User

標籤:

(1)安裝nginx

  1.: http://nginx.org/en/download.html ,並解壓到目錄下

  2.安裝依賴包 yum -y install pcre*  yum -y install openssl*

  3.執行./configure --prefix=/usr/local/nginx

               編譯make,make install(如果是非root使用者 make 和sudo make install 分開 同理,其他的安裝包也是這樣)  4. 建立軟連結:# ln -s /usr/local/nginx/sbin/nginx /usr/local/bin/  5. 進入/usr/local/nginx/conf目錄,建立虛擬機器主機配置目錄,並將此目錄匯入到nginx.conf中

  # mkdir vhost

  # vim ./nginx.conf (在最後大括弧前添加一行並儲存退出: include vhost/*.conf; )

  6. 可在vhost目錄內建立虛擬機器主機設定檔,以.conf結尾,內容可參考nginx.conf中的server部分

(2)安裝php:

  1.:http://php.net/downloads.php

  2.安裝依賴包 :yum -y install libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel

  3. 由於centOS沒有libmcrypt,所以要先下載第三方源

          wget http://www.atomicorp.com/installers/atomic          sh ./atomic     yum install php-mcrypt libmcrypt-devel  4.  ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysqli --with-iconv --with-freetype-dir --with-jpeg-dir --with-     png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop     --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-      mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip      --enable-soap --without-pear --with-zlib --enable-pdo --with-pdo-mysql --enable-opcache  5. 進入到php安裝目錄下:
    
    cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
    cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
    修改www.conf 下面user=wwww,group=www
    最後ps -aux | grep php-fpm就可以啟動了
    
    
(3)安裝composer
    curl -sS https://getcomposer.org/installer | php
      執行這個命令前要建立php的軟串連,ln -s /usr/local/php/bin/php /usr/local/bin
       mv composer.phar /usr/local/bin/composer
(4)安裝redis
 

centOS 部署伺服器(二)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.