VPS 折腾全记录-part 4 

好了,值得庆贺的是,本篇是这次中篇连载记录手稿的最后一集了。

:-)

太棒了。

现在就剩下 lighttpd 和 nginx 这两台 http server 了。

先是lighttpd,解压,进入目录:
我的configure:

[root@PowerPC lighttpd-1.4.32]# ./configure \
> --prefix=/opt/lighttpd \
> --disable-lfs \
> --disable-ipv6 \
> --with-mysql=/opt/mysql/bin/mysql_config \
> --with-attr \
> --with-pcre \
> --with-zlib \
> --with-bzip2 \
> --with-fam


检查依赖,没有任何问题。下面是编译程序给出的概况:

Plugins:

enabled:
mod_access
mod_accesslog
mod_alias
mod_auth
mod_cgi
mod_compress
mod_dirlisting
mod_evhost
mod_expire
mod_extforward
mod_fastcgi
mod_flv_streaming
mod_indexfile
mod_mysql_vhost
mod_proxy
mod_redirect
mod_rewrite
mod_rrdtool
mod_scgi
mod_secdownload
mod_setenv
mod_simple_vhost
mod_ssi
mod_staticfile
mod_status
mod_trigger_b4_dl
mod_userdir
mod_usertrack
mod_webdav
disabled:
mod_cml
mod_magnet

Features:

enabled:
auth-crypt
compress-bzip2
compress-deflate
compress-gzip
regex-conditionals
stat-cache-fam
disabled:
auth-ldap
large-files
network-ipv6
network-openssl
storage-gdbm
storage-memcache
webdav-locks
webdav-properties


确认没有问题后,开始编译,安装。

之后,恢复配置文件。下面问题来了。

尝试启动 lighttpd,出错。

2013-04-23 17:15:11: (plugin.c.169) dlopen() failed for: /opt/lighttpd/lib/mod_mysql_vhost.so libmysqlclient.so.18: cannot open shared object file: No such file or directory
2013-04-23 17:15:11: (server.c.676) loading plugins finally failed


提示找不到mysql 的动态链接库。为啥?因为没有在系统里面注册。因为这次的包括mysql 在内的所有软件都没有使用传统的 /usr/local/ 路径,所以各自.so 文件所在的目录路径,系统自然不知道。
解决方案:
编辑位于 /etc 下的ld.so.conf 文件,加入各自的lib 目录路径。
我的ld.so.conf:

[root@PowerPC src]# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib
/usr/local/libevent/lib
/opt/lighttpd/lib
/opt/mysql/lib


保存之后,ldconfig -v,刷新所有库。
注:这里说点题外话,关于动态链接库的添加,有人建议就像BIN $PATH 一样,追加到系统的 $LD_LIBRARY_PATH 变量里,我个人是不建议这么做的。

再次运行 lighttpd,果然没有问题了。

打印出lighttpd 的版本信息:

[root@PowerPC ~]# lighttpd -V
lighttpd/1.4.32 - a light and fast webserver
Build-Date: Apr 23 2013 16:12:29

Event Handlers:

+ select (generic)
+ poll (Unix)
- rt-signals (Linux 2.4+)
+ epoll (Linux 2.6)
- /dev/poll (Solaris)
- eventports (Solaris)
- kqueue (FreeBSD)
- libev (generic)

Network handler:

+ linux-sendfile
- freebsd-sendfile
- solaris-sendfilev
+ writev
+ write
- mmap support

Features:

- IPv6 support
+ zlib support
+ bzip2 support
+ crypt support
- SSL Support
+ PCRE support
+ mySQL support
- LDAP support
- memcached support
+ FAM support
- LUA support
- xml support
- SQLite support
- GDBM support


搞定了lighttpd,接下来就是 nginx 了,这是剩下的最后一个了。

解压源码,进入源码主目录,
我的configure:

[root@PowerPC nginx-1.3.16]# ./configure \
> --prefix=/opt/nginx \
> --sbin-path=/opt/nginx/sbin/nginx \
> --conf-path=/opt/nginx/etc/nginx.conf \
> --error-log-path=/opt/nginx/var/error.log \
> --pid-path=/opt/nginx/var/nginx.pid \
> --lock-path=/opt/nginx/var/nginx.lock \
> --user=http \
> --group=web \
> --with-poll_module \
> --with-file-aio \
> --with-http_spdy_module \
> --with-http_realip_module \
> --with-http_addition_module \
> --with-http_image_filter_module \
> --with-http_flv_module \
> --with-http_mp4_module \
> --with-http_gunzip_module \
> --with-http_gzip_static_module \
> --without-http_fastcgi_module \
> --without-http_uwsgi_module \
> --without-http_scgi_module \
> --http-log-path=/opt/nginx/var/access.log \
> --http-client-body-temp-path=/tmp/nginx/request \
> --http-proxy-temp-path=/tmp/nginx/proxy \
> --without-mail_pop3_module \
> --without-mail_imap_module \
> --without-mail_smtp_module


检查依赖,一次通过。同样,和lighttpd 一样,编译程序给出了编译概况,见下:

Configuration summary
+ using system PCRE library
+ OpenSSL library is not used
+ md5: using system crypto library
+ sha1: using system crypto library
+ using system zlib library

nginx path prefix: "/opt/nginx"
nginx binary file: "/opt/nginx/sbin/nginx"
nginx configuration prefix: "/opt/nginx/etc"
nginx configuration file: "/opt/nginx/etc/nginx.conf"
nginx pid file: "/opt/nginx/var/nginx.pid"
nginx error log file: "/opt/nginx/var/error.log"
nginx http access log file: "/opt/nginx/var/access.log"
nginx http client request body temporary files: "/tmp/nginx/request"
nginx http proxy temporary files: "/tmp/nginx/proxy"


确认没有问题,make && make install 开始编译和安装。
一切都很顺利。在最后别忘了恢复下配置文件。
主要就是个 nginx.conf 文件。

好了,至此,这次的VPS升级、折腾手记全文完。

谢谢观赏。:)

_全剧终_
[ ] ( 3607 次浏览 ) 永久链接 ( 3 / 2682 )

<< <上一页 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 下一页> >>