又要重新装一台阿里云服务器。开始想用脚本,但发现脚本的程序版本都比较低  还是手动编译最新版本

开始前

更新服务器到最新版本

#yum makecache

#yum update

//分区挂数据盘

#df -h //查是否分区

#fdisk -l  //查硬盘

#fdisk /dev/xvdb1   (n,p ...w,q)

#mkfs.ext4 /dev/xvdb1   //格式化  ext4

#echo '/dev/xvdb1 /server etx4 defaults 0 0' >> /etc/fstab

#mount -a

#cd /root/soft    //新建一个下载软件目录


nginx 1.8  稳定版

#wget http://nginx.org/download/nginx-1.8.0.tar.gz

#tar zxvf nginx-1.8.0.tar.gz

#cd nginx-1.8.0

#wget http://zlib.net/zlib-1.2.8.tar.gz

#tar zxvf zlib-1.2.8.tar.gz

#cd zlib-1.2.8

#./configure

#make && make

#wget http://ncu.dl.sourceforge.net/project/pcre/pcre/8.37/pcre-8.37.tar.gz

#tar zxvf pcre-8.37.tar.gz

#cd pcre-8.37

#./configure

#make && make

#wget http://www.openssl.org/source/openssl-1.0.2b.tar.gz

#tar zxvf openssl-1.0.2b.tar.gz

#./configure

#make && make

#./configure --user==nobody --group=nobody --prefix=/server/nginx --with-http_stub_status_module --without-http-cache --with-openssl=../openssl-1.0.2b --with-http_ssl_module --with-http_gzip_static_module --conf-path=/server/nginx/nginx.conf --error-log-path=/server/log/nginx/error.log --http-log-path=/server/log/nginx/access.log

#make

#make install

#cd /server/nginx/sbin

#ln -s /sbin/nginx /server/nginx/sbin/nginx

#nginx   //运行nginx

如果报错{

(error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory)

#ldd $(which /server/nginx/sbin/nginx)   //查看缺少的库文件位置

#ln -s /lib64/libpcre.so.1 /lib64/libpcre.so.0.0.1

}

#nginx -t   //检查通过.

#nginx -s stop   //停止NGINX



PHP5.6.10

#wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

#tar zxvf libiconv-1.14.tar.gz

# cd libiconv-1.14

# ./configure --prefix=/usr/local

#make -j 2

#make install

#wget http://download.savannah.gnu.org/releases/freetype/freetype-2.6.tar.gz

#tar zxvf freetype-2.6.tar.gz

#cd freetype-2.6

#./configure --prefix=/usr/local/freetype.2.6

#make && make install

#wget http://download.sourceforge.net/libpng/libpng-1.6.17.tar.gz

#tar zxvf libpng-1.6.17.tar.gz

#cd libpng-1.6.17

#./configure

#make

报错{

/root/soft/libpng-1.6./contrib/tools/pngfix.c:: undefined reference to `inflateReset2'
collect2: ld returned exit status
make[]: *** [pngfix] Error
make[]: *** Waiting for unfinished jobs....
make[]: Leaving directory `/root/soft/libpng-1.6.'
make: *** [all] Error

#find / -name "libz.so"

删除查找出的libz.so

重新编泽zlib(nginx那一节)

#wget http://www.ijg.org/files/jpegsrc.v9a.tar.gz

#wget http://cn2.php.net/distributions/php-5.6.10.tar.xz

#xz -d php-5.6.10.tar.xz

#tar xvf php-5.6.10.tar

#cd php-5.6.10

#./configure --prefix=/server/php --with-config-file-path=/server/php/etc --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-fpm --enable-static --enable-inline-optimization --enable-sockets --enable-wddx --enable-zip --without-pear --enable-calendar --enable-bcmath --enable-soap --with-zlib --with-iconv --with-gd --with-xmlrpc --enable-mbstring --with-curl --enable-ftp --with-mcrypt --with-freetype-dir=/usr/local/freetype.2.6 --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --disable-ipv6 --disable-debug --with-openssl --disable-maintainer-zts  --disable-fileinfo --disable-short-tags

报错{

checking libxml2 install dir... no
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.

#yum install libxml2-devel.x86_64

checking for RAND_egd... no
checking for pkg-config... /usr/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>

将装NGINX时的OPENSSL再编译安装一次。

checking for cURL support... yes
checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/

#wget http://curl.haxx.se/download/curl-7.42.1.tar.gz

#tar zxvf curl-7.42.1.tar.gz

#cd curl-7.42.1

#./configure

#make && make install

checking for stdarg.h... (cached) yes
checking for mcrypt support... yes
configure: error: mcrypt.h not found. Please reinstall libmcrypt.

#yum install libmcrypt.x86_64 libmcrypt-devel.x86_64

make: *** [sapi/fpm/php-fpm] 错误 

进入上面的libiconv-1.14目录

#cd ../libiconv-1.14

#make uninstall

删除libiconv

参考:http://blog.fbbin.com/archives/1258

}

#make ZEND_EXTRA_LIBS='-liconv' -j 2    //最后的2是指CPU的核数,自已修改。    编译php  出错,请BAIDU  PS:最好翻墙用GOOGLE

#make install

#cp php.ini-production /server/php/etc/php.ini

#vi /server/php/etc/php.ini

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

extension_dir = "/server/php/lib/php/extensions/no-debug-non-zts-20121212/

upload_max_filesize = 64M

date.timezone = PRC

max_execution_time = 300

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#cp /server/etc/php-fpm.conf.default /server/etc/php-fpm.conf

#vi /server/etc/php-fpm.conf

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

pm.min_spare_servers = 5

pm.max_spare_servers = 35

pm.max_children = 100

pm.start_servers = 20

opcache.enable=1

pid = run/php-fpm.pid

error_log = /log/php/php-fpm.log

slowlog = /log/php/\$pool.log.slow

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#install -v -m755 ./php-5.6.10/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

#/etc/init.d/php-fpm start


[mysql]

#wget http://zy-res.oss-cn-hangzhou.aliyuncs.com/mysql/mysql-5.6.21-linux-glibc2.5-x86_64.tar.gz
#tar -xzvf mysql-5.6.21-linux-glibc2.5-x86_64.tar.gz

#mv mysql-5.6.21-linux-glibc2.5-x86_64/* /server/mysql

#groupadd mysql
#useradd -g mysql -s /sbin/nologin mysql
#/server/mysql/scripts/mysql_install_db --datadir=/server/mysql/data/ --basedir=/server/mysql --user=mysql
#chown -R mysql:mysql /server/mysql/
#chown -R mysql:mysql /server/mysql/data/
#chown -R mysql:mysql /alidata/log/mysql
#cp -f /server/mysql/support-files/mysql.server /etc/init.d/mysqld
#sed -i 's#^basedir=$#basedir=/server/mysql#' /etc/init.d/mysqld
#sed -i 's#^datadir=$#datadir=/server/mysql/data#' /etc/init.d/mysqld
#cat > /etc/my.cnf <<END
[client]
port            = 3306
socket          = /tmp/mysql.sock
[mysqld]
port            = 3306
socket          = /tmp/mysql.sock
skip-external-locking
log-error=/log/mysql/error.log
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

log-bin=mysql-bin
binlog_format=mixed
server-id       = 1

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout
END

#chmod 755 /etc/init.d/mysqld
#/etc/init.d/mysqld start

//mysql  用户名:root 密码:默认为空。


配置

#vi /server/nginx/nginx.conf

user  nobody nobody;
worker_processes ; error_log logs/error.log; pid logs/nginx.pid; events {
worker_connections ;
} http {
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
server_tokens off;
keepalive_timeout ;
gzip on;
include /server/nginx/conf/vhosts/*.conf;
}

#vi /server/nginx/confi/vhost/test.conf

server {
listen ;
server_name test;
include /server/nginx/conf/rewrite/test.conf; //手动创新文件
access_log /log/nginx/test.access.log; root /www/test/web;
index index.html index.htm index.php; error_page /.html; error_page /50x.html;
location = /50x.html {
root 50x;
} location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm-test.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /web$fastcgi_script_name;
include fastcgi_params;
} }

#cp /server/php/etc/php-fpm.conf /server/php/etc/php-fpm-test.conf

#vi /server/php/etc/php-fpm-test.conf

修改
25 pid = run/php-fpm-test.pid
error_log =/log/php/php-fpm-test.log
listen = /var/run/php-fpm-test.sock
listen.owner = nobody
listen.group = nobody
chroot = /www/test/web

#cp /etc/init.d/php-fpm /etc/init.d/php-fpm-test

#vi /etc/init.d/php-fpm-test

 php_fpm_BIN=${exec_prefix}/sbin/php-fpm
php_fpm_CONF=${prefix}/etc/php-fpm-test.conf
php_fpm_PID=${prefix}/var/run/php-fpm-test.pid

设置启动..

#chkconfig --level 235 php-fpm-test on

#chkconfig --level 235 mysqld on

#cat nginx >> /etc/rc.local

参考https://gir.me.uk/nginx-php-fpm-with-chroot/

nginx1.8+php5.6.10 服务器编译安装备忘2015-06的更多相关文章

  1. windows下matplotlib编译安装备忘

    windows下,codeblocks,mingw安装matplotlib. python下一些源码的编译安装,备忘. matplotlib官网编译好的版本只支持到3.3.我不慎刚下了python3. ...

  2. Linux服务器软件安装备忘

    1.Centos安装Mysql --安装 yum install mysql-server 卸载 yum -e mysql-server --设置为开机启动 chkconfig mysqld on - ...

  3. 安装 CentOS 后的系统配置及软件安装备忘

    安装 CentOS 后的系统配置及软件安装备忘 // */ // ]]>   安装 CentOS 后的系统配置及软件安装备忘 Table of Contents 1 Linux 自举过程 1.1 ...

  4. MSDE2008安装备忘

    MSDE2008安装备忘(适用于WIN7 8 10) 1.系统中必须要VC8.0,即VC2005运行库.2.系统中必须要有.net framework2.0.3.5.4.6运行库.3.windows防 ...

  5. CentOS安装备忘2

    CentOS7安装备忘2 安装过程中不联网,安装完成也不要立刻联网,先关闭远程的服务后再联网更新.安装默认使用English,目的是生成的Home下所有文件夹都是英文的,方便使用. ========= ...

  6. Sublime Text4(Build 4126) 安装备忘

    Sublime Text4(Build 4126) 安装备忘 sublime text 4126 PJ已测可用 打开浏览器进入网站https://hexed.it 打开sublime text4安装目 ...

  7. CentOS7安装备忘

    ======1 下载CentOS镜像文件:https://www.centos.org/download/http://isoredirect.centos.org/centos/7/isos/x86 ...

  8. oracle 驱动安装备忘

    ubuntu 从oracle官网下载两个必须的rpm包(这里选择的是version12.1.0.2.0, 64位操作系统) oracle-instantclient12.1-basic-12.1.0. ...

  9. WRF 安装备忘

    ▶ n 年前在笔记本上安装 WRF 的一个过程 ● 安装 cpp,csh,m4,quota,samba # apt-get install cpp csh m4 quota samba ● 网上教程有 ...

随机推荐

  1. [cocos2d-x3.0]Android+NDK+Eclipse环境搭建及编译步骤~

    1: 必要准备 1): jdk&jre 2): adt-bundle 3): android ndk r9 4): python2.7 5): cocos2d-x 3.0 alpha0 2: ...

  2. cobbler常见问题

    http://@@http_server@@/cblr/links/CentOS-6.4-x86_64 cobbler cblr/svc 四.配置文件 cobbler有许多的配置文件,但是只有少部分基 ...

  3. c#基础语言编程-按值类型和引用类型传递参数

    引言 在介绍传递参数介绍前,请明白参数类型和传递方式是不同的.传递方式分为按值类型和引用类型传递参数.参数类型有值类型和引用类型,这个和C++是不同的.这里的传递方式对应c++中的深复制和浅复制. 两 ...

  4. Delphi中WebBrowser拦截网页Alert对话框消息(转)

    interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, O ...

  5. Scope Chain(作用域链)

    本章,我们讨论一下ECMAScript中的作用域链 , 开门见山. 什么是作用域链 i.ECMAScript是允许创建内部函数的,甚至能从父函数中返回这些函数.作用域链正是内部上下文中所有变量对象(及 ...

  6. clearTimeout(timeoutfunc) 是否有必要执行

    当使用 setTimeout() 方法的时候,是否必须执行 clearTimeout() ? 在 setTimeout() 内的函数执行之前,如果想要阻止执行该方法,是有必要执行 cleartTime ...

  7. WKWebView使用过程中的那些坑

    问题产生背景: 新开发的页面中有一部分的界面是需要展示后端接口返回的HTML代码,包括文字和图片.所以就自然而然的要使用iOS原生的WebKit. 鉴于Xcode 8发布以后,编译器支持的最低版本(D ...

  8. 使用PowerShell读、写、删除注册表键值

    访问注册表键值 在PowerShell中,用户可以通过类似于HKCU:(作为HKEY_CURRENT_USER)和HKLM:(代表HKEY_LOCAL_MATCHINE)的虚拟驱动器访问注册表键值. ...

  9. inverse 相关设置

    <set name="students" table = "student" inverse="true"> <!-- 指 ...

  10. 第四篇:python 高级之面向对象初级

    python 高级之面向对象初级   python 高级之面向对象初级 本节内容 类的创建 类的构造方法 面向对象之封装 面向对象之继承 面向对象之多态 面向对象之成员 property 1.类的创建 ...