升级安装 Lighttpd 1.4.30 和 MySQL 5.6.4 

前段时间,Lighttpd 发布了最新的1.4.30版本,修复早些时候的http_auth_mod 的漏洞,虽然对我影响不大,不过还是决定升级了~
之后,MySQL团队也发布了5.6.x 分支的第七个里程碑版本,考虑到我之前编译的5.6.3由于启用了全部的storage engine,导致服务开启后,内存占用过大,故而也打算果断升级。

正好看到PHP和nginx 也发布了新版本,于是便捎带升级一下。

下载对应的源码包:

28 wget http://nginx.org/download/nginx-1.1.11.tar.gz
29 wget http://download.lighttpd.net/lighttpd/r ... 30.tar.bz2
30 wget http://mirrors.dedipower.com/www.mysql. ... -m7.tar.gz
40 wget http://downloads.php.net/stas/php-5.4.0RC4.tar.bz2


别忘了删除旧的版本文件:
[root@PowerPC pub]# rm nginx*
rm:是否删除 一般文件 “nginx-1.1.10.tar.gz”? y
rm:是否删除 一般文件 “nginx-1.1.11.tar.gz”? n
[root@PowerPC pub]# rm lighttp*
rm:是否删除 一般文件 “lighttpd-1.4.29.tar.bz2”? y
rm:是否删除 一般文件 “lighttpd-1.4.30.tar.bz2”? n
[root@PowerPC pub]# rm mysql*
rm:是否删除 一般文件 “mysql-5.6.3-m6.tar.gz”? y
rm:是否删除 一般文件 “mysql-5.6.4-m7.tar.gz”? n
[root@PowerPC pub]# rm php*
rm:是否删除 一般文件 “php-5.4.0beta2.tar.bz2”? y
rm:是否删除 一般文件 “php-5.4.0RC4.tar.bz2”? n
rm:是否删除 一般文件 “phpinfo.php”? n

首先MySQL,解压,进入目录:
我的cmake的configure:
[root@PowerPC mysql-5.6.4-m7]# cmake . \
> -DCMAKE_BUILD_TYPE:STRING=Release \
> -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/mysql \
> -DCMAKE_USE_RELATIVE_PATHS:BOOL=ON \
> -DCOMMUNITY_BUILD:BOOL=ON \
> -DDISABLE_SHARED:BOOL=OFF \
> -DENABLED_PROFILING:BOOL=ON \
> -DENABLE_DOWNLOADS:BOOL=OFF \
> -DINNODB_COMPILER_HINTS:BOOL=OFF \
> -DINSTALL_BINDIR:STRING=../bin \
> -DINSTALL_DOCDIR:STRING=docs \
> -DINSTALL_DOCREADMEDIR:STRING=docs \
> -DINSTALL_INCLUDEDIR:STRING=include \
> -DINSTALL_INFODIR:STRING=docs \
> -DINSTALL_LAYOUT:STRING=STANDALONE \
> -DINSTALL_LIBDIR:STRING=lib \
> -DINSTALL_MANDIR:STRING=man \
> -DINSTALL_MYSQLDATADIR:STRING=data \
> -DINSTALL_MYSQLSHAREDIR:STRING=share \
> -DINSTALL_MYSQLTESTDIR:STRING=mysql-test \
> -DINSTALL_PLUGINDIR:STRING=lib/plugin \
> -DINSTALL_PLUGINTESTDIR:STRING=lib/plugin \
> -DINSTALL_SBINDIR:STRING=../sbin \
> -DINSTALL_SCRIPTDIR:STRING=scripts \
> -DINSTALL_SHAREDIR:STRING=share \
> -DINSTALL_SQLBENCHDIR:STRING=bench \
> -DINSTALL_SUPPORTFILESDIR:STRING=support-files \
> -DMANUFACTURER:STRING='Built from Source by Sharl' \
> -DMYSQL_DATADIR:PATH=/var/mysql \
> -DMYSQL_MAINTAINER_MODE:BOOL=OFF \
> -DOPTIMIZER_TRACE:BOOL=ON \
> -DSYSCONFDIR:PATH=/etc/sysconfig/mysql \
> -DWITHOUT_SERVER:BOOL=OFF \
> -DWITH_ARCHIVE_STORAGE_ENGINE:BOOL=OFF \
> -DWITH_BLACKHOLE_STORAGE_ENGINE:BOOL=OFF \
> -DWITH_DEBUG:BOOL=OFF \
> -DWITH_EMBEDDED_SERVER:BOOL=OFF \
> -DWITH_EXTRA_CHARSETS:STRING=all \
> -DWITH_FEDERATED_STORAGE_ENGINE:BOOL=OFF \
> -DWITH_INNOBASE_STORAGE_ENGINE:BOOL=ON \
> -DWITH_LIBEDIT:BOOL=ON \
> -DWITH_LIBWRAP:BOOL=ON \
> -DWITH_PARTITION_STORAGE_ENGINE:BOOL=OFF \
> -DWITH_PERFSCHEMA_STORAGE_ENGINE:BOOL=OFF \
> -DWITH_READLINE:BOOL=OFF \
> -DWITH_SSL:STRING=no \
> -DWITH_UNIT_TESTS:BOOL=OFF \
> -DWITH_ZLIB:STRING=bundled

检查依赖,没有问题。运行 make 开始编译,之后make install 安装。

完了之后,由于我删除了之前所有的数据库文件,首先运行 scripts 目录下的mysql_install_db 初始化数据库。

初始化好了后,由于MySQL 5.6.x 默认使用InnoDB 作为默认数据引擎。编辑my.cnf 配置文件,加入"ignore-builtin-innodb" 以禁用掉innodb 数据引擎.
再加上
"default-storage-engine=MyISAM" 和 "default_tmp_storage_engine=MyISAM" 把默认存储引擎改成MyISAM.

保存。这样的话就可以启动mysqld 了。内存占用也还可以接受,InnoDB 伤不起~

紧接着,运行mysql_secure_installation 设置root密码,删除测试表,刷新权限表等等~

再然后就可以导入之前备份的数据库SQL文件了。

登陆mysql终端,查看数据库列表:

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| bbpress |
| lighttpd |
| mysql |
| performance_schema |
| phpbb |
| typecho |
| vsftpd |
+--------------------+
8 rows in set (0.01 sec)


一切OK.

查看引擎列表:

mysql> mysql> show engines;
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| CSV | YES | CSV storage engine | NO | NO | NO |
| InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |(忽略后,应该不显示)
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| MyISAM | DEFAULT | MyISAM storage engine | NO | NO | NO |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
5 rows in set (0.00 sec)


之后再对对应的库、表重新授权下,就完了。
注:以上操作参考了一下文档
http://dev.mysql.com/doc/refman/5.6/en/ ... tin-innodb
http://dev.mysql.com/doc/refman/5.6/en/ ... gines.html

接下来是PHP,解压,进入目录
我的configure:
[root@PowerPC php-5.4.0RC4]# ./configure \
> --prefix=/usr/local/php \
> --exec-prefix=/usr/local \
> --sysconfdir=/etc/sysconfig/php \
> --localstatedir=/var \
> --disable-cli \
> --enable-fpm \
> --with-fpm-user=http \
> --with-fpm-group=web \
> --with-config-file-path=/etc/sysconfig/php/php.ini \
> --with-config-file-scan-dir=/etc/sysconfig/php \
> --enable-sigchild \
> --disable-ipv6 \
> --with-zlib \
> --with-bz2 \
> --enable-calendar \
> --with-curl \
> --enable-dba=shared \
> --enable-exif \
> --enable-ftp \
> --with-gd \
> --enable-gd-native-ttf \
> --with-mhash \
> --enable-mbstring \
> --with-mcrypt \
> --with-mysql=/usr/local/mysql \
> --with-mysql-sock=/tmp/mysql.sock \
> --with-mysqli=/usr/local/mysql/bin/mysql_config \
> --disable-pdo \
> --with-libedit \
> --enable-soap \
> --enable-sockets \
> --enable-wddx \
> --with-xmlrpc \
> --enable-zip \
> --without-pear

检查依赖,无问题。然后 make && make install 编译安装。
恢复下备份好的配置文件php.ini 和 php-fpm.conf 即可。

然后就是nginx,解压,进入目录
[root@PowerPC nginx-1.1.11]# ./configure \
> --prefix=/usr/local/nginx \
> --sbin-path=/usr/local/sbin/nginx \
> --conf-path=/etc/sysconfig/nginx/nginx.conf \
> --error-log-path=/var/log/nginx/error.log \
> --pid-path=/var/run/nginx.pid \
> --lock-path=/var/run/nginx.lock \
> --user=http \
> --group=web \
> --with-select_module \
> --with-poll_module \
> --with-http_image_filter_module \
> --with-http_dav_module \
> --with-http_flv_module \
> --with-http_mp4_module \
> --with-http_gzip_static_module \
> --without-http_fastcgi_module \
> --without-http_uwsgi_module \
> --without-http_scgi_module \
> --http-log-path=/var/log/nginx/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 \
> --with-pcre

检查依赖,一切顺利。编译工具给出了配置概况如下:

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: "/usr/local/nginx"
nginx binary file: "/usr/local/sbin/nginx"
nginx configuration prefix: "/etc/sysconfig/nginx"
nginx configuration file: "/etc/sysconfig/nginx/nginx.conf"
nginx pid file: "/var/run/nginx.pid"
nginx error log file: "/var/log/nginx/error.log"
nginx http access log file: "/var/log/nginx/access.log"
nginx http client request body temporary files: "/tmp/nginx/request"
nginx http proxy temporary files: "/tmp/nginx/proxy"


确认正确后,开始编译安装.make && make install.
好了后,也是恢复下配置文件,为了保险,最好再测试下配置文件。

最后是lighttpd,解压,进入目录
我的configure:
[root@PowerPC lighttpd-1.4.30]# ./configure \
> --prefix=/usr/local/lighttpd \
> --exec-prefix=/usr/local \
> --sysconfdir=/etc/sysconfig/lighttpd \
> --localstatedir=/var \
> --disable-lfs \
> --disable-ipv6 \
> --with-mysql=/usr/local/mysql/bin/mysql_config \
> --with-attr \
> --with-pcre \
> --with-zlib \
> --with-bzip2

检查依赖,完全满足。同样,编译工具也给出了配置概况如下:

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
disabled:
auth-ldap
large-files
network-ipv6
network-openssl
stat-cache-fam
storage-gdbm
storage-memcache
webdav-locks
webdav-properties


确认OK后,编译、安装. make && make install.
还有,恢复下之前的配置文件。再测试下,没问题。

所有一切完成后,就可以重新启动所有的服务了。至此服务器升级到此完成。
还有一点要注意的是,一旦MySQL重新安装后,基于MySQL验证的pam_mysql 模块必须重新编译一次。
[ ] ( 2084 次浏览 ) 永久链接 ( 3.1 / 2563 )

<< <上一页 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 下一页> >>