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

开始前

更新服务器到最新版本

#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. Ethernet & IEEE 802.3 802.X 802.1ag-MEP

    ISO/IEC 7498标准,它定义了网络互联的7层框架,也就是开放式系统互连参考模型(OSI模型). 交换机好比是邻近的街道,而路由器则是街道的交汇点. (交换机第二层,即数据链路层,也有四层,七层 ...

  2. 从Java视角理解CPU缓存(CPU Cache)

    从Java视角理解系统结构连载, 关注我的微博(链接)了解最新动态众所周知, CPU是计算机的大脑, 它负责执行程序的指令; 内存负责存数据, 包括程序自身数据. 同样大家都知道, 内存比CPU慢很多 ...

  3. js冲突怎么解决

    a.最容易出现的就是js的命名冲突①.变量名冲突变量有全局变量和局部变量当全局变量变量和局部变量名称一致时,就会js冲突,由于变量传递数值或地址不同就会产生JavaScript错误,甚至死循环.②.方 ...

  4. 查看线程linux cpu使用率

    Linux下如何查看高CPU占用率线程 LINUX CPU利用率计算 转 http://www.cnblogs.com/lidabo/p/4738113.html目录(?)[-] proc文件系统 p ...

  5. C —— 零碎笔记

    1.字节对齐和结构体大小 链接 2.共同体union 的作用 链接 3.文件夹和文件操作 windows: http://blog.csdn.net/gneveek/article/details/6 ...

  6. 构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(29)-T4模版

    原文:构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(29)-T4模版 这讲适合所有的MVC程序 很荣幸,我们的系统有了体验的地址了.演示地址 之前我们发布了一 ...

  7. android 47 service绑定

    如果一个service已经启动了,activity和service绑定了在解除邦定,则这个service不会销毁,因为这个service不是这个Activity创建的. service生命周期: Ac ...

  8. Mysql新建用户和数据库并授权

    测试环境:Centos 6.3和Mysql 5.3 一.新建用户 //登录MYSQL@>mysql -u root -p@>密码//创建用户mysql> insert into my ...

  9. json-lib-2.4-jdk15.jar maven

    最近自己将一个web项目装换到使用mevan自动管理. 遇到了一个json包导入的问题.最终解决如下: <!-- https://mvnrepository.com/artifact/net.s ...

  10. java web项目中的web.xml标签之context-param

    WEB项目初始化过程: 在启动Web项目时,容器(比如Tomcat)会读web.xml配置文件中的两个节点<listener>和<contex-param>. 接着容器会创建一 ...