web 环境一整套安装

一.install  nginx #web server

1)get  nginx.tar.gz 的压缩包

2)tar -zjxf  nginx.tar.gz

3.安装编译时的一来包

yum -y install  gcc   pcre pcre-devel  zlib zlib-devel   openssl openssl-devel

3)cd  nginx目录下并开始编译

##编译时./configure --help 查看编译时需要哪些选项;  

./configure  --prefix=/usr/local/webserver/nginx  --sbin-path=/usr/local/webserver/nginx/sbin/nginx --conf-path=/usr/local/webserver/nginx/conf/nginx.conf --error-log-path=/data1/logs/nginx/error.log  --http-log-path=/data1/logs/nginx/access.log  --pid-path=/usr/local/webserver/nginx/var/run/nginx/nginx.pid --lock-path=/usr/local/webserver/nginx/var/lock/nginx.lock  --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module --http-client-body-temp-path=/usr/local/webserver/nginx/var/tmp/nginx/client/ --http-proxy-temp-path=/usr/local/webserver/nginx/var/tmp/nginx/proxy/ --http-fastcgi-temp-path=/usr/local/webserver/nginx/var/tmp/nginx/fcgi/ --http-uwsgi-temp-path=/usr/local/webserver/nginx/var/tmp/nginx/uwsgi --http-scgi-temp-path=/usr/local/webserver/nginx/var/tmp/nginx/scgi --with-pcre

4) make && make install

5)配置文件nginx.conf 的定义

6)启动文件的配置#service  nginx   start

二.install  php  

1)get  php版本的压缩包

2)安装编译环境依赖

yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers gd gd2 gd-devel gd2-devel perl-CPAN pcre-devel

3)tar php.5.5.xx的压缩包

./configure \
--prefix=/usr/local/webserver/php \
--with-config-file-path=/etc \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-opcache \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-gettext \
--enable-mbstring \
--with-iconv \
--with-mcrypt \
--with-mhash \
--with-openssl \
--enable-bcmath \
--enable-soap \
--with-libxml-dir \
--enable-pcntl \
--enable-shmop \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-sockets \
--with-curl \
--with-zlib \
--enable-zip \
--with-bz2 \
--with-readline \
--without-sqlite3 \
--without-pdo-sqlite \
--with-pear

4)make && make install

5)配置文件相关的修改

6)配置文件php-fpm.conf 的修改

7)配置启动文件service php-fpm  start

三.安装 ImageMagick

1)get  ImageMagick-6.8.8-1.tar.gz

2)tar xf ImageMagick-6.8.8-1.tar.gz   && cd  ImageMagick-6.8.8-1

3)cd ImageMagick-6.8.8-1 && ./configure --prefix=/usr/local/imagemagick  

4)yum install ImageMagick-devel   如果没有安装

四.安装 imagick

1)安装时的依赖包

yum install wget  make gcc gcc-c++ gtk+-devel zlib-devel openssl openssl-devel pcre-devel kernel keyutils  patch perl

1)tar xf imagick-3.1.2.tgz  &&  ./configure  --with-php-config=/usr/local/webserver/php/bin/php-config --with-imagick=/usr/local/include/ImageMagick/

3)ln -s /usr/local/imagemagick/include/ImageMagick-6   /usr/local/include/ImageMagick  若这步没有做会包下面错误

报错:checking ImageMagick MagickWand API configuration program... configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.

4) 可以安装redis.so  & memcached.so 的文件直接拷贝到/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20121212/

5.chmod +x redis.so    & memached.so

 

五)memcached 扩展:

1、wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz

2、tar -zxvf libmemcached-1.0.18.tar.gz 

    ./configure     make && make install

3、 wget http://pecl.php.net/get/memcached-2.2.0.tgz

tar -zxvf  memcached-2.2.0.tgz

phpize

        ./configure     make && make install

vi /etc/php/php.ini

extension = memcached.so


redis扩展:

1、https://github.com/phpredis/phpredis.git

cd phpredis/

/usr/local/php/bin/phpize

./configure --with-php-config=/usr/local/php/bin/php-config

make && make install

vi /etc/php/php.ini

extension=redis.so

 

mongo扩展:

1、wget http://pecl.php.net/get/mongo-1.5.8.tgz

tar -zxvf mongo-1.5.8.tgz 

/usr/local/php/bin/phpize

       ./configure --with-php-config=/usr/local/php/bin/php-config

      make

      make install

vi /etc/php/php.ini

         extension=mongo.so

 

posted @ 2017-11-29 11:29  运维之洞见  阅读(113)  评论(0编辑  收藏  举报