一、环境要求
centos6.5 x64
mysql5.6.19
php5.5
lighttpd1.4.28
二、安装步骤
install mysql5.6.19 from source:
0. preparation
yum install gcc gcc-c++ ncurses-devel perl
1. install cmake
wget http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz
tar -xzvf cmake-2.8.10.2.tar.gz
cd cmake-2.8.10.2
./bootstrap ; make ; make install
cd ~
2. cmake the source file and config the posible options
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_INNOBASE_STORAGE_ENGINE=1 -WITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_INNODB_MEMCACHED=ON -DWITH_LIBEVENT=system -DMYSQL_DATADIR=/var/lib/mysql -DMYSQL_TCP_PORT=3306 -DENABLE_DOWNLOADS=1
3. make the source
$ make
4. make install the binary files
$ make install
5. fufill the mysql tables
groupadd mysql
useradd -r -g mysql mysql
cd /usr/local/mysql
scripts/mysql_install_db –user=mysql –datadir=/data/mysqldb
6. change owner of the posible directorys
chown mysql:mysql /var/lib/mysql
7. config the mysqld.server and the my.cnf files
cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysqld
php install :
get the source file from site: http://cn2.php.net/distributions/php-5.5.28.tar.bz2
then install these:
1. fcgi
UpLoad fcgi-2.4.0.tar.gz, unzip, then:
cd fcgi-2.4.0
./configure
make
make install
2. curl
UpLoad curl-VERSION.tar.gz, unzip, then:
./configure –with-openssl
make
make install
3. php
UpLoad php-VERSION.tar.gz, unzip, then:
./configure –with-mysql –with-curl –enable-ftp –enable-soap –enable-sockets –enable-mbstring
make
make install
4. lighttpd
1> UpLoad pcre-8.11.tar.gz , unzip, then:
./configure
make
make install
2> UpLoad lighttpd-1.4.28.tar.gz, unzip, then:
./configure –with-openssl –prefix=/usr/local/lighttpd
make
make install
config the lighttpd file like this:
server.max-fds = 10240 server.max-connections = 4096 server.max-keep-alive-requests = 0 server.event-handler = "linux-sysepoll" server.network-backend = "linux-sendfile" server.modules = ( "mod_cgi", "mod_fastcgi", "mod_accesslog", "mod_expire", "mod_access", "mod_compress", "mod_rewrite" ) server.document-root = "/root/www/" server.port= 80 server.errorlog = "/usr/local/lighttpd/log/error.log" accesslog.filename = "/usr/local/lighttpd/log/access.log" server.core-files = "enable" index-file.names = ( "index.php", "index.html" ) mimetype.assign = ( ".gz" => "application/x-gzip", ".swf" => "application/x-shockwave-flash", ".tar.gz" => "application/x-tgz", ".tgz" => "application/x-tgz", ".tar" => "application/x-tar", ".zip" => "application/zip", ".mp3" => "audio/mpeg", ".m3u" => "audio/x-mpegurl", ".wma" => "audio/x-ms-wma", ".wax" => "audio/x-ms-wax", ".wav" => "audio/x-wav", ".gif" => "image/gif", ".jpg" => "image/jpeg", ".jpeg" => "image/jpeg", ".png" => "image/png", ".css" => "text/css", ".html" => "text/html", ".htm" => "text/html", ".js" => "text/javascript", ".text" => "text/plain", ".txt" => "text/plain", ".dtd" => "text/xml", ".xml" => "text/xml", ".mpeg" => "video/mpeg", ".mpg" => "video/mpeg", ".avi" => "video/x-msvideo", ".wmv" => "video/x-ms-wmv", ".bz2" => "application/x-bzip", ".tbz" => "application/x-bzip-compressed-tar", ".tar.bz2" => "application/x-bzip-compressed-tar" ) static-file.exclude-extensions = ( ".fcgi", ".php", ".cgi", ".pl" ) cgi.assign = ( # ".pl" => "/usr/bin/perl", ".php" => "/usr/local/bin/php-cgi" ) fastcgi.server = ( ".php" => ( "localhost" => ( "host" => "127.0.0.1", "port" => 1026, "bin-path" => "/usr/local/bin/php-cgi" ) ) ) url.rewrite-once = ( "^/wiki/upload/(.+)" => "/wiki/upload/$1", "^/$" => "/w/index.php", "^/wiki/([^?]*)(?:\?(.*))?" => "/w/index.php?title=$1&$2" ) expire.url = ( "/images/" => "access 1 months", "/scripts/" => "access 1 months", "/img/" => "access 1 months", "/js/" => "access 1 months", "/css/" => "access 1 months"
剩下的操作就是启动lighttpd然后再配置wordpress的相关配置项,这里就不列出了。
三、测试结果
四、参考
wordpress中文版下载: https://cn.wordpress.org/wordpress-4.2.2-zh_CN.zip
原文链接:https://www.cnblogs.com/forilen/p/4747632.html