服务器部署

 

 

建立目录/data/src:用于存放软件源码
下载tengine源码:http://tengine.taobao.org/download/tengine-2.2.1.tar.gz
解压tengine:tar -xzvf tengine-2.2.1.tar.gz
编译tengine
./configure --prefix=/usr/local/tengine --with-http_concat_module --with-http_realip_module --with-http_addition_module --with-http_gzip_static_module --with-http_random_index_module --with-http_stub_status_module --with-http_sub_module --with-http_dav_modulephp

报错html

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.mysql

http://www.pcre.org/
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.bz2linux

tar -xjvf pcre-8.38.tar.bz2nginx

报错
tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting nowc++

yum -y install bzip2redis

tar -xjvf pcre-8.38.tar.bz2sql

./configure --prefix=/usr/local/tengine --with-http_concat_module --with-http_realip_module --with-http_addition_module --with-http_gzip_static_module --with-http_random_index_module --with-http_stub_status_module --with-http_sub_module --with-http_dav_module --with-pcre=/data/src/pcre-8.38数据库

报错
./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.express

yum -y install openssl openssl-devel 
或者
wget http://www.openssl.org/source/openssl-0.9.8l.tar.gz
下载openssl 编辑参数加 -with-openssl=

还可能报错缺乏zlib库
wget https://jaist.dl.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz

编译
./configure --prefix=/usr/local/tengine --with-http_concat_module --with-http_realip_module --with-http_addition_module --with-http_gzip_static_module --with-http_random_index_module --with-http_stub_status_module --with-http_sub_module --with-http_dav_module --with-pcre=/data/src/pcre-8.38 --with-zlib=/data/src/zlib-1.2.11

Configuration summary
+ using PCRE library: /data/src/pcre-8.38
+ using system OpenSSL library
+ md5: using OpenSSL library
+ sha1: using OpenSSL library
+ using zlib library: /data/src/zlib-1.2.11
+ jemalloc library is disabled

nginx path prefix: "/usr/local/tengine"
nginx binary file: "/usr/local/tengine/sbin/nginx"
nginx configuration prefix: "/usr/local/tengine/conf"
nginx configuration file: "/usr/local/tengine/conf/nginx.conf"
nginx pid file: "/usr/local/tengine/logs/nginx.pid"
nginx error log file: "/usr/local/tengine/logs/error.log"
nginx http access log file: "/usr/local/tengine/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx dso module path: "/usr/local/tengine/modules/"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"


make test

configure: error: You need a C++ compiler for C++ support.

yum install -y gcc gcc-c++

make test

/bin/sh: prove: command not found
make[1]: *** [test] Error 127
make[1]: Leaving directory `/data/src/tengine-2.2.1'
make: *** [test] Error 2

# https://www.cnblogs.com/antarctican/p/3759816.html

不用解决也能安装成功

make

make test

make install

在/usr/local/tengine/conf/nginx.conf后加入
http{
...
include vhosts/*.conf;
}
mkdir vhosts


yum install lrzsz

nginx启动/usr/local/tengine/sbin/nginx -c /usr/local/tengine/conf/nginx.conf

useradd www
passwd www
txn!@#1234

nginx配置文件
user www www;
error_log /var/logs/tengine/error.log;

 

 

 

 

安装php
http://www.php.net/

http://am1.php.net/distributions/php-7.1.11.tar.gz

./configure --prefix=/usr/local/php72 --with-config-file-path=/usr/local/php72/etc --enable-fpm --with-mcrypt --enable-mbstring --disable-pdo --with-curl --disable-debug --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex --with-mysqli --with-gd --with-png-dir --with-jpeg-dir --with-iconv=/usr/local/libiconv --with-freetype-dir=/usr --enable-pdo --with-pdo-mysql=mysqlnd --without-pdo-sqlite --with-openssl


去掉=/usr/local/libiconv

./configure --prefix=/usr/local/php72 --with-config-file-path=/usr/local/php72/etc --enable-fpm --with-mcrypt --enable-mbstring --disable-pdo --with-curl --disable-debug --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex --with-mysqli --with-gd --with-png-dir --with-jpeg-dir --with-iconv --with-freetype-dir=/usr --enable-pdo --with-pdo-mysql=mysqlnd --without-pdo-sqlite --with-openssl

configure: error: xml2-config not found. Please check your libxml2 installation.

yum install libxml2
yum install libxml2-devel

configure: error: Please reinstall the BZip2 distribution
yum install bzip2 bzip2-devel

http://blog.sina.com.cn/s/blog_75a07c3b0101kcwb.html

configure: error: mcrypt.h not found. Please reinstall libmcrypt.
yum install libmcrypt libmcrypt-devel

configure: error: jpeglib.h not found.
yum -y install libjpeg-devel

configure: error: png.h not found.
yum -y install libpng-devel

If configure fails try --with-xpm-dir=<DIR>
configure: error: freetype-config not found.
yum -y install freetype-devel

checking for cURL in default path... not found
which: no dpkg-architecture in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
./configure: line 410: test: please: integer expression expected
configure: error: reinstall
./configure: line 299: return: please: numeric argument required
./configure: line 309: exit: please: numeric argument required

yum install curl-devel

make
make test


/usr/local/php7/bin/php -v

 


php-fpm
检查配置文件
/usr/local/php7/sbin/php-fpm -t

cp php-fpm.conf.default php-fpm.conf

[26-Nov-2017 12:54:24] ERROR: failed to open configuration file '/usr/local/php7/etc/php-fpm.conf': No such file or directory (2)
[26-Nov-2017 12:54:24] ERROR: failed to load configuration file '/usr/local/php7/etc/php-fpm.conf'
[26-Nov-2017 12:54:24] ERROR: FPM initialization failed


php.ini-production在安装目录里

2017/11/26 13:16:39 [error] 6906#0: *15 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 221.219.65.125, server: www.guguchinese.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.guguchinese.com"

www目录改成可读

 

 

 

数据库安装
http://www.linuxidc.com/Linux/2016-03/128880.htm

yum -y install mariadb mariadb-server
启动
systemctl start mariadb
开机启动
systemctl enable mariadb
初始化配置
mysql_secure_installation
txnMysql
配置文件 /etc/my.cnf


/usr/local/php7/sbin/php-fpm

http://blog.csdn.net/u013474436/article/details/49910015

 


grant all privileges on gugu.* to 'gugu'@'%' identified by 'gugu1234mysql' with grant option;
flush privileges ;

 

 

redis

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

配置文件路径: /usr/local/etc/redis.conf

相关文章
相关标签/搜索