centos lnmp环境搭建建Wordpress需要哪些缓存

手动编译安装LNMP环境,搭建wordpress博客 - 推酷
手动编译安装LNMP环境,搭建wordpress博客
日—编译安装
环境,搭建
.........................................
编译器及相关工具和依赖库
......................2
...................................
所需的支持库
................................
& & &3.2.1
...............................
& & &3.2.2
...................................
& & &3.3.3
fontconfig
.............................3
& & &3.3.4
..................................4
& & &3.3.5
....................................4
& & &3.3.6
.................................4
& & &3.3.7
...............................4
& & &3.3.8
..................................4
& & &3.3.9
.................................5
& & &3.3.10
..................................5
............................................
...........................
......................................
..............................................
.....................................
........................................
......................................
.....................................
操作步骤:
系统环境:
1.看下主机名、内核版本以及系统版本的信息
[root@tyk ~]# uname -a
Linux tyk 2.6.18-308.el5 #1 SMP Tue Feb 21 20:06:06 EST
x86_64 x86_64 GNU/Linux
[root@tyk ~]# lsb_release -a
LSB Version:
:core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: CentOS
Description:
CentOS release 5.8 (Final)
安装前提环境:
配置网络yum源
[root@tyk ~]# cd /etc/yum.repos.d/
[root@tyk yum.repos.d]# /bin/mv CentOS-Base.repo CentOS-Base.repo.ori
[root@tyk yum.repos.d]# wget /help/CentOS-Base-sohu.repo
[root@tyk yum.repos.d]# /bin/mv CentOS-Base-sohu.repo CentOS-Base.repo
做下时间同步:
[root@tyk ~]# crontab -l
*/5 * * * * /usr/sbin/ntpdate
&/dev/null 2&&1
不然后边有可能出现问题。
##升级一下yum源
[root@tyk ~]# yum update -y yum
安装gcc编译器及相关工具和依赖库:
[root@tyk ~]# 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
编译安装pcre库
PCRE(Perl Compatible Regular Expressions)是一个Perl库,包括 perl 兼容的正规表达式。Pcre的作用主要是使nginx支持HTTP rewrite模块。
创建一个指定放置压缩包的目录
[root@tyk ~]# mkdir -p /taokey/tools
[root@tyk ~]# cd /taokey/tools/
[root@tyk tools]# unzip pcre-8.33.zip
[root@tyk tools]# cd pcre-8.33
[root@tyk pcre-8.33]# ./configure
[root@tyk pcre-8.33]# make && make install
安装PHP所需的支持库:
编译安装FreeType
FreeType库是一个完全免费(开源)的、高质量的且可移植的字体引擎,它提供统一的接口来访问多种字体格式文件。
[root@tyk tools]# tar -jxvf freetype-2.4.12.tar.bz2
[root@tyk tools]# cd freetype-2.4.12
[root@tyk freetype-2.4.12]# ./configure --prefix=/usr/local/freetype
[root@tyk freetype-2.4.12]# make && make install
编译安装jpeg
Jpeg是一个基本的图像压缩方式。
[root@tyk tools]# tar -zxvf jpegsrc.v7.tar.gz
[root@tyk tools]# cd jpeg-7/
[root@tyk jpeg-7]# mkdir /usr/local/jpeg
[root@tyk jpeg-7]# mkdir /usr/local/jpeg/bin
[root@tyk jpeg-7]# mkdir /usr/local/jpeg/lib
[root@tyk jpeg-7]# mkdir /usr/local/jpeg/include
[root@tyk jpeg-7]# mkdir /usr/local/jpeg/man
[root@tyk jpeg-7]# mkdir /usr/local/jpeg/man/man1
[root@tyk jpeg-7]# ./configure --prefix=/usr/local/jpeg --with-freetype=/usr/local/freetype --enable-shared --enable-static
[root@tyk jpeg-7]# make && make install
安装fontconfig
fontconfig是提供系统范围内字体设置,定制和允许应用程序访问的函数库,Fontconfig负责字体的安装确认和匹配。
[root@tyk tools]# tar -zxvf fontconfig-2.4.2.tar.gz
[root@tyk tools]# cd fontconfig-2.4.2
[root@tyk fontconfig-2.4.2]# ./configure --prefix=/usr/local/fontconfig --with-freetype-config=/usr/local/freetype/bin/freetype-config
--with-expat-lib=/usr/lib64
[root@tyk fontconfig-2.4.2]#make && make install
注意:在这里要是
位系统,就必须加上参数
--with-expat-lib=/usr/lib64
安装libpng:
ibpng软件包包含 libpng 库.这些库被其他程式用于读写png文件
[root@tyk tools]# tar -jxf libpng-1.4.3.tar.bz2
[root@tyk tools]# cd libpng-1.4.3
[root@tyk libpng-1.4.3]# ./configure --prefix=/usr/local/libpng --enable-static --enable-shared
[root@tyk libpng-1.4.3]# make && make install
安装zlib:
zlib能使用一个gzip数据头,zlib数据头或者不使用数据头压缩数据。
[root@tyk tools]# tar -zxvf zlib-1.2.3.tar.gz
[root@tyk tools]# cd zlib-1.2.3
[root@tyk zlib-1.2.3]# ./configure --prefix=/usr/local/zlib
[root@tyk zlib-1.2.3]# make && make install
安装ncurses:
NCURSES不仅仅只是封装了底层的终端功能,而且提供了一个相当稳固的工作框架(Framework)用 以产生漂亮的界面。它包含了一些创建窗口的函数。
[root@tyk tools]# tar -zxf ncurses-5.6.tar.gz
[root@tyk tools]# cd ncurses-5.6
[root@tyk ncurses-5.6]# ./configure --prefix=/usr/local/ncurses
[root@tyk ncurses-5.6]# make && make install
安装libmcrypt
libmcrypt是加密算法扩展库。支持DES, 3DES, RIJNDAEL, Twofish, IDEA, GOST, CAST-256, ARCFOUR, SERPENT, SAFER+等算法。
[root@tyk tools]# tar -zxvf libmcrypt-2.5.7.tar.gz
[root@tyk libmcrypt-2.5.7]# ./configure --prefix=/usr/local/libmcrypt --enable-shared --enable-static --enable-dynamic-loading
[root@tyk libmcrypt-2.5.7]# make && make install
安装libxml
libxml是一个用来解析XML文档的函数库。它用C语言写成, 并且能为多种语言所调用,例如C语言,C++,XSH。C#,Python,Kylix/Delphi,Ruby,和PHP等。Perl中也可以使用XML::LibXML模块。libXML 代码可移植性非常好,因为它基于标准的ANSI C库, 并采用MIT许可证。
[root@tyk tools]# tar -zxvf libxml2-2.7.8.tar.gz
[root@tyk tools]# cd libxml2-2.7.8
[root@tyk libxml2-2.7.8]# ./configure --prefix=/usr/local/libxml2 --enable-shared --enable-static
[root@tyk libxml2-2.7.8]# make && make install
安装libiconv
对文本进行编码间的转换,用它来处理中文各种编码之间的转换。
[root@tyk tools]# tar -zxvf libiconv-1.14.tar.gz
[root@tyk tools]# cd libiconv-1.14
[root@tyk libiconv-1.14]# ./configure --prefix=/usr/local/libiconv-1.14
[root@tyk libiconv-1.14]# make && make install
[root@tyk tools]# tar -zxvf gd-2.0.33.tar.gz
[root@tyk tools]# cd gd-2.0.33
[root@tyk gd-2.0.33]# ./configure --prefix=/usr/local/gd --with-zlib=/usr/local/zlib --with-png=/usr/local/libpng --with-jpeg=/usr/local/jpeg --with-freetype=/usr/local/freetype --with-fontconfig=/usr/local/fontconfig
[root@tyk gd-2.0.33]# make && make install
4.安装nginx
[root@tyk tools]# useradd -s /sbin/nologin -M nginx
[root@tyk tools]# groupadd ngnix
[root@tyk tools]# tar -zxvf nginx-1.3.1.tar.gz
[root@tyk tools]# cd nginx-1.3.1
[root@tyk nginx-1.3.1]# ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx-1.3.1 --with-http_stub_status_module --with-http_ssl_module --with-pcre=/taokey/tools/pcre-8.33
[root@tyk nginx-1.3.1]# make && make install
[root@tyk nginx-1.3.1]# ln -s /usr/local/nginx-1.3.1 /usr/local/nginx
[root@tyk nginx-1.3.1]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx-1.3.1/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx-1.3.1/conf/nginx.conf test is successful
[root@tyk nginx-1.3.1]# netstat -anpt | grep nginx
0 0.0.0.0:80
15988/nginx
[root@tyk nginx-1.3.1]# ps -ef | grep nginx
00:00:00 nginx: master process /usr/local/nginx/sbin/nginx
00:00:00 nginx: worker process
0 23:14 pts/1
00:00:00 grep nginx
5.安装mysql数据库
首先创建mysql用户和组
[root@tyk tools]# groupadd mysql
[root@tyk tools]# useradd -s /sbin/nologin -g mysql -M mysql
[root@tyk tools]# tar -zxvf mysql-5.1.65.tar.gz
[root@tyk tools]# cd mysql-5.1.65
删除configure目录下的第52297行$RM &$cfgfile&,不然会报错。
[root@tyk mysql-5.1.65]# ./configure --prefix=/application/mysql5.1.65 --with-unix-socket-path=/application/mysql5.1.65/tmp/mysql.sock --localstatedir=/application/mysql5.1.65/data --enable-assembler --enable-thread-safe-client --with-mysqld-user=mysql --with-big-tables --without-debug --with-pthread --enable-assembler --with-extra-charsets=complex --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=partition,innobase --with-plugin-PLUGIN --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static
[root@tyk mysql-5.1.65]# make && make install
需要拷贝一个mysql的主配置文件,这个是必须拷贝的,我这里复制了一个small
[root@tyk mysql-5.1.65]# cp support-files/f /f
[root@tyk mysql-5.1.65]# ln -s /application/mysql5.1.65 /application/mysql
[root@tyk mysql-5.1.65]# mkdir -p /application/mysql/data
[root@tyk mysql-5.1.65]# /application/mysql/bin/mysql_install_db --basedir=/application/mysql --datadir=/application/mysql/data/ --user=mysql
[root@tyk mysql-5.1.65]# cp support-files/mysql.server /etc/init.d/mysqld
[root@tyk mysql-5.1.65]# chmod 700 /etc/init.d/mysqld
[root@tyk mysql-5.1.65]# chown -R root.mysql /application/mysql/bin/mysql
[root@tyk mysql-5.1.65]# echo &/application/mysql/lib/mysql& && /etc/ld.so.conf
[root@tyk mysql-5.1.65]# ldconfig
[root@tyk mysql-5.1.65]# /application/mysql/bin/mysqld_safe --user=mysql &
[root@tyk mysql-5.1.65]# netstat -anpt | grep mysqld
0 0.0.0.0:3306
26725/mysqld
[root@tyk mysql-5.1.65]# chmod +x /etc/init.d/mysqld
[root@tyk mysql-5.1.65]# chkconfig --add mysqld
[root@tyk mysql-5.1.65]# chkconfig mysqld on
[root@tyk mysql-5.1.65]# export PATH=$PATH:/application/mysql/bin
[root@tyk mysql-5.1.65]# echo &PATH=$PATH:/application/mysql/bin& &&/etc/profile
[root@tyk mysql-5.1.65]# source /etc/profile
[root@tyk mysql-5.1.65]# mysql
Welcome to the MySQL monitor.
Your MySQL connection id is 1
Server version: 5.1.65 Source distribution
Copyright (c) , Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
Type '' or '\h' for help. Type '\c' to clear the current input statement.
mysql& exit
6.安装php环境
[root@tyk tools]# tar -jxvf php-5.4.6.tar.bz2
[root@tyk php-5.4.6]# ./configure
--prefix=/usr/local/php5.4.6
--with-mysql=/application/mysql
--with-xmlrpc --with-openssl --with-zlib --with-freetype-dir=/usr/local/freetype --with-gd=/usr/local/gd --with-jpeg-dir=/usr/local/jpeg --with-png-dir=/usr/local/libpng --with-iconv=/usr/local/libiconv-1.14 --enable-short-tags --enable-sockets --enable-zend-multibyte --enable-soap --enable-mbstring --enable-static --enable-gd-native-ttf --with-curl --with-xsl --enable-ftp --with-libxml-dir=/usr/local/libxml2 --enable-gd-native-ttf --enable-zip --enable-fastcgi --enable-fpm
[root@tyk php-5.4.6]# make && make install
在make编译时,出现报错:
In file included from /usr/local/src/php-5.4.6/ext/gd/gd.c:103:
/usr/local/src/php-5.4.6/ext/gd/gd_ctx.c: 在函数‘_php_image_stream_putc’中:
/usr/local/src/php-5.4.6/ext/gd/gd_ctx.c:51: 错误:‘struct gdIOCtx’没有名为‘data’的成员
/usr/local/src/php-5.4.6/ext/gd/gd_ctx.c: 在函数‘_php_image_stream_putbuf’中:
/usr/local/src/php-5.4.6/ext/gd/gd_ctx.c:58: 错误:‘struct gdIOCtx’没有名为‘data’的成员
/usr/local/src/php-5.4.6/ext/gd/gd_ctx.c: 在函数‘_php_image_stream_ctxfree’中:
/usr/local/src/php-5.4.6/ext/gd/gd_ctx.c:67: 错误:‘struct gdIOCtx’没有名为‘data’的成员
/usr/local/src/php-5.4.6/ext/gd/gd_ctx.c:68: 错误:‘struct gdIOCtx’没有名为‘data’的成员
/usr/local/src/php-5.4.6/ext/gd/gd_ctx.c:69: 错误:‘struct gdIOCtx’没有名为‘data’的成员
In file included from /usr/local/src/php-5.4.6/ext/gd/gd.c:103:
/usr/local/src/php-5.4.6/ext/gd/gd_ctx.c: 在函数‘_php_image_output_ctx’中:
/usr/local/src/php-5.4.6/ext/gd/gd_ctx.c:153: 错误:‘gdIOCtx’没有名为‘data’的成员
make: *** [ext/gd/gd.lo] 错误 1
解决方法:
修改gd安装目录下的include/gd_io.h文件。
[root@spp php-5.4.15]# vi /usr/local/gd/include/gd_io.h修改为文件中的结构体为:
typedef struct gdIOCtx
int (*getC) (struct gdIOCtx *);
int (*getBuf) (struct gdIOCtx *, void *, int);
void (*putC) (struct gdIOCtx *, int);
int (*putBuf) (struct gdIOCtx *, const void *, int);
int (*seek) (struct gdIOCtx *, const int);
long (*tell) (struct gdIOCtx *);
void (*gd_free) (struct gdIOCtx *);
void (*data);
其中红色部分为添加的修改,其他不变。
[root@tyk php-5.4.6]# cd /usr/local/php5.4.6/etc/
[root@tyk etc]# cp php-fpm.conf.default php-fpm.conf
[root@tyk etc]# egrep -v &;|^$& php-fpm.conf
error_log = /var/log/php-fpm.log
log_level = notice
pid = /var/log/php/php-fpm.pid
user = nginx
group = nginx
listen = 127.0.0.1:9000
pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
[root@tyk etc]# mkdir /var/log/php
[27-Jun-:06] NOTICE: configuration file /usr/local/php5.4.6/etc/php-fpm.conf test is successful
[root@tyk etc]# ../sbin/php-fpm
[root@tyk etc]# ps -ef | grep php-fpm
00:00:00 php-fpm: master process (/usr/local/php5.4.6/etc/php-fpm.conf)
00:00:00 php-fpm: pool www
00:00:00 php-fpm: pool www
00:00:00 php-fpm: pool www
00:00:00 php-fpm: pool www
00:00:00 php-fpm: pool www
00:00:00 php-fpm: pool www
00:00:00 php-fpm: pool www
00:00:00 php-fpm: pool www
00:00:00 php-fpm: pool www
00:00:00 php-fpm: pool www
00:00:00 php-fpm: pool www
00:00:00 php-fpm: pool www
00:00:00 php-fpm: pool www
00:00:00 php-fpm: pool www
00:00:00 php-fpm: pool www
00:00:00 php-fpm: pool www
00:00:00 php-fpm: pool www
00:00:00 php-fpm: pool www
00:00:00 php-fpm: pool www
00:00:00 php-fpm: pool www
0 00:18 pts/1
00:00:00 grep php-fpm
[root@tyk local]# cat nginx/conf/nginx.conf
worker_processes
#error_log
logs/error.
#error_log
logs/error.
#error_log
logs/error.
error_log /app/logs/nginx_error.
logs/nginx.
worker_connections
default_type
application/octet-
log_format
'$remote_addr - $remote_user [$time_local] &$request& '
'$status $body_bytes_sent &$http_referer& '
'&$http_user_agent& &$http_x_forwarded_for&';
#access_log
logs/access.
#keepalive_timeout
keepalive_timeout
#charset koi8-r;
#access_log
logs/host.access.
location / {
/data/www/
index.php index.html index.
#error_page
# redirect server error pages to the static page /50x.html
error_page
500 502 503 504
location = /50x.html {
location ~ .*\.(php|php5)?$ {
root /data/www/
fastcgi_pass
127.0.0.1:9000;
fastcgi_index
fastcgi_param
SCRIPT_FILENAME $document_root$fastcgi_script_
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#location ~ \.php$ {
proxy_pass
http://127.0.0.1;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#location ~ \.php$ {
fastcgi_pass
127.0.0.1:9000;
fastcgi_index
fastcgi_param
SCRIPT_FILENAME
/scripts$fastcgi_script_
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#location ~ /\.ht {
# another virtual host using mix of IP-, name-, and port-based configuration
somename:8080;
server_name
location / {
index.html index.
# HTTPS server
ssl_certificate
ssl_certificate_key
ssl_session_timeout
ssl_protocols
SSLv2 SSLv3 TLSv1;
ssl_ciphers
HIGH:!aNULL:!MD5;
ssl_prefer_server_
location / {
index.html index.
[root@tyk local]# nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx-1.3.1/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx-1.3.1/conf/nginx.conf test is successful
[root@tyk local]# nginx/sbin/nginx -s reload
[root@tyk php-5.4.6]# grep short_open_tag /usr/local/php5.4.6/php.ini
; short_open_tag
short_open_tag = On
测试下php和数据库是否成功
[root@tyk www]# cat test.php
phpinfo();
[root@tyk www]# cat testdb.php
$link=mysql_connect('localhost','root','');
if ($link)
echo &successful&;
echo &Faile&;
mysql_close();
[root@tyk nginx]# sbin/nginx -s reload
此时页面会出现successful的字样,说明成功了。
下载wordpress,然后解压,在数据库上创建一个数据库,账号和密码,然后给用户赋予权限,就可以安装wordpress博客了。
如图所示:
看下Curl头部信息:
到此实验结束,谢谢大家阅读!!!
已发表评论数()
已收藏到推刊!
请填写推刊名
描述不能大于100个字符!
权限设置: 公开
仅自己可见
正文不准确
排版有问题
没有分页内容
视频无法显示
图片无法显示LNMP环境搭建——Nginx篇 - 博客 - 伯乐在线
& LNMP环境搭建——Nginx篇
1.Nginx配置文件测试
root@kallen:/usr/local/nginx/sbin# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf
syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
2.Nginx启动
[root@kallen ~]# /usr/local/nginx/sbin/nginx
3.Nginx负载均衡
Nginx Architecture:
Nginx LoadBalance:
Nginx High Availability:
Nginx Access Process:
Nginx 的 upstream 目前支持4 种方式的分配——
(1)轮询(默认) :
每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器down掉,能自动剔除。
(2)weight :
指定轮询几率,weight 和访问比率成正比,用于后端服务器性能不均的情况。
(3)ip_hash :
每个请求按访问ip 的hash 结果分配,这样每个访客固定访问一个后端服务器,可以解决session 的问题。可以针对同一个C 类地址段中的客户端选择同一个后端服务器,除非那个后端服务器宕了才会换一个。
(4)fair(第三方):
按后端服务器的响应时间来分配请求,响应时间短的优先分配。
(5)url_hash(第三方):
按访问url 的hash 结果来分配请求,使每个url 定向到同一个后端服务器,后端服务器为缓存时比较有效。
4.Nginx安装及配置
(1) nginx源码安装
[root@kallen ~]# cd /usr/local/src/
[root@kallen ~]# wget /downloads/linux/nginx-0.9.6.tar.gz
[root@kallen ~]# tar zxvf nginx-0.9.6.tar.gz
[root@kallen ~]# cd nginx-0.9.6
./configure --prefix=/usr/local/nginx
--sbin-path=/usr/local/nginx/sbin/nginx
--conf-path=/usr/local/nginx/conf/nginx.conf
--error-log-path=/usr/local/nginx/logs/error.log
--http-log-path=/usr/local/nginx/logs/access.log
--pid-path=/usr/local/nginx/var/nginx.pid
--lock-path=/usr/local/nginx/var/nginx.lock
--http-client-body-temp-path=/dev/shm/nginx_temp/client_body
--http-proxy-temp-path=/dev/shm/nginx_temp/proxy
--http-fastcgi-temp-path=/dev/shm/nginx_temp/fastcgi
--user=www --group=www
--with-cpu-opt=pentium4F
--without-select_module
--without-poll_module
--with-http_realip_module
--with-http_sub_module
--with-http_gzip_static_module
--with-http_stub_status_module
--without-http_ssi_module
--without-http_userid_module
--without-http_geo_module
--without-http_memcached_module
--without-http_map_module
--without-mail_pop3_module
--without-mail_imap_module
--without-mail_smtp_module
--with-pcre=/usr/local/src/pcre-8.32/
--with-zlib=/usr/local/zlib
[root@kallen ~]# make && make install
[root@kallen ~]# mkdir /dev/shm/nginx_temp
有的nginx版本编译时会因为pcre编译不过去,需要修改一下
--with-pcre=/usr/local/src/pcre-8.32,前提是已经下载了pcre源码包pcre-7.8.tar.gz,并解压到/usr/local/src/pcre-8.32,不需要编译pcre.
在实际安装过程中可能需要手动安装以下依赖包:
a. 安装依赖软件
[root@kallen ~]# apt-get --install-suggests install gcc g++ make
b. 下载相关软件
wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz
wget http://zlib.net/zlib-1.2.8.tar.gz
wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz
wget /download/jemalloc/jemalloc-3.6.0.tar.bz2
wget http://tengine.taobao.org/download/tengine-2.0.2.tar.gz
c. 安装Pcre
tar zxvf pcre-8.35.tar.gz
cd pcre-8.35
./configure --prefix=/usr/local/pcre-8.35
make && make install
d. 安装Zlib
tar zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure --prefix=/usr/local/zlib-1.2.8
make && make install
[ERROR]-1:
./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=&path& option
[ERROR]-2:
configure: error: You need a C++ compiler for C++ support.
make[1]: *** [/usr/local/src/pcre-8.32/Makefile] Error 1
make[1]: Leaving directory /home/kallen/MyDOC/nginx-1.8.0
make: *** [build] Error 2
安装完成后的配置信息如下:
[Nginx Configuration Summary]
Configuration summary
+ using PCRE library: /usr/local/src/pcre-8.32
+ OpenSSL library is not used
+ using builtin md5 code
+ sha1 library is not found
+ using zlib library: /usr/local/zlib
nginx path prefix:&/usr/local/nginx&
nginx binary file:&/usr/local/nginx/sbin/nginx&
nginx configuration prefix:&/usr/local/nginx/conf&
nginx configuration file:&/usr/local/nginx/conf/nginx.conf&
nginx pid file:&/usr/local/nginx/var/nginx.pid&
nginx error log file:&/usr/local/nginx/logs/error.log&
nginx http access log file:&/usr/local/nginx/logs/access.log&
nginx http client request body temporary files:&/dev/shm/nginx_temp/client_body&
nginx http proxy temporary files:&/dev/shm/nginx_temp/proxy&
nginx http fastcgi temporary files:&/dev/shm/nginx_temp/fastcgi&
nginx http uwsgi temporary files:&uwsgi_temp&
nginx http scgi temporary files:&scgi_temp&
(2) 编写nginx启动脚本
[root@kallen init.d]# vi /etc/init.d/nginx
写入以下内容:
#!/bin/bash
# Startup script for the Nginx HTTP Server
# Kallen Ding, Apr 23 2015
NGINX_PATH=&/usr/local/nginx/&
OPTIONS=&-c ${NGINX_PATH}conf/nginx.conf&
prog=nginx
nginx=${NGINX_PATH}sbin/nginx
pidfile=/var/run/nginx.pid
# Source function library.
. /etc/rc.d/init.d/functions
echo -n &Starting $prog: &
daemon --pidfile=${pidfile} $nginx $OPTIONS
return $RETVAL
echo -n &Stopping $prog: &
killproc -p ${pidfile} $nginx
reload() {
echo -n $&Reloading $prog: &
killproc -p ${pidfile} $nginx -HUP
# See how we were called.
case &$1& in
status $prog
echo &Usage: $prog {start|stop|restart|reload|status}&
exit $RETVAL
保存后,更改/etc/init.d/nginx的权限
[root@kallen ~]# chmod 755 /etc/init.d/nginx
[root@kallen ~]# chkconfig --add nginx
[root@kallen ~]# chkconfig nginx on
可能感兴趣的话题
关于伯乐在线博客
在这个信息爆炸的时代,人们已然被大量、快速并且简短的信息所包围。然而,我们相信:过多“快餐”式的阅读只会令人“虚胖”,缺乏实质的内涵。伯乐在线博客团队正试图以我们微薄的力量,把优秀的原创/译文分享给读者,做一个小而精的精选博客,为“快餐”添加一些“营养”元素。
新浪微博:
推荐微信号
(加好友请注明来意)
– 好的话题、有启发的回复、值得信赖的圈子
– 分享和发现有价值的内容与观点
– 为IT单身男女服务的征婚传播平台
– 优秀的工具资源导航
– 翻译传播优秀的外文文章
– 国内外的精选文章
– UI,网页,交互和用户体验
– 专注iOS技术分享
– 专注Android技术分享
– JavaScript, HTML5, CSS
– 专注Java技术分享
– 专注Python技术分享
& 2016 伯乐在线
赞助云主机

我要回帖

更多关于 lnmp环境搭建视频教程 的文章

 

随机推荐