1. 程式人生 > 實用技巧 >linux命令:編譯安裝httpd、mysql、php等LAMP環境xcache快取PHP

linux命令:編譯安裝httpd、mysql、php等LAMP環境xcache快取PHP

MySQL伺服器維護了兩類變數:

伺服器變數:

定義MySQL伺服器執行特性

SHOW GLOBAL VARIABLES [LIKE 'STRING'];

狀態變數:

儲存了MySQL伺服器執行統計資料

SHOW GLOBAL STATUS [LIKE 'STRING']


MySQL萬用字元:

_: 匹配任意單個字元

%:匹配任意長度的任意字元


Httpd 2.4新特性:

1、MPM可於執行時裝載: --enable-mpms-shared=all --with-mpm=event 編譯安裝是指定MPM執行模組為event

2、Event MPM 支援event新的多路處理模組

3、非同步讀寫

4、在每模組及每目錄上指定日誌級別

5、每請求配置: <If>,<ElseIf>,<Else>;

6、增強的表示式分析器;

7、毫秒級的Keepalive Timeout;

8、基於域名的虛擬主機不再需要NameVirtualHost指令;

9、降低了記憶體佔用;

10、支援在配置檔案中使用自定義變數;

11、對於基於IP的訪問控制不再支援order all,deny allow from all

而是支援Require user

Usage:

Require user USERNAME

Require group GRPNAME

Require ip IPADDR 允許該IP地址訪問

Require not ip IPADDR 拒絕該IP地址訪問

IP

NETWORK/NETMASK

NETWORK/LENGTH

NET

172.16.0.0/255.255.0.0=172.16.0.0/16=172.16

Require host HOSTNAME

HOSTNAME : www.linux.com

DOMAIN : .linux.com

允許所有主機訪問:

Require all granted

拒絕所有主機訪問:

Require all deny


--enable-modules=most

新增的模組:

mod_proxy(之前版本也有)

mod_proxy_fcgi

mod_proxy_scgi

mod_proxy_express

mod_remoteip

mod_sesslon

mod_ratelimit

mod_request

等等


通過編譯安裝LAMP環境:

安裝順序:httpd --> mysql --> php --> xcache(php快取程式)

Linux,Apache,Mysql,Php

以下演示安裝httpd:2.4.4 php:5.4.13 Mysql:5.5(通用二進位制格式,解壓後即可使用)


1、 安裝httpd 2.4.4需安裝高版本的apr1.4以上的版本apr-util1.4版本以上

------------------------------------------------------------------------

[[email protected] ~]# rpm -q apr

apr-1.3.9-3.el6.x86_64

[[email protected] ~]# rpm -q apr-util

apr-util-1.3.9-3.el6.x86_64

*所以需要下載更高版本的arp和apr-util,但是原來的安裝程式不能解除安裝,因為他們被其他程式依賴

需通過編譯安裝在其他目錄下即可。


把apr和apr-util安裝在/usr/local目錄下,這個目錄為第三方軟體安裝目錄:


[[email protected] ~]# ls

anaconda-ks.cfg apr-util-1.4.1.tar.bz2 install.log

apr-1.4.6.tar.gz httpd-2.4.4.tar.gz install.log.syslog


安裝順序:apr-1.4.6 --> apr-util-1.4.1 --> httpd-2.4.4


[[email protected] ~]# tar -zxf apr-1.4.6.tar.gz

[[email protected] ~]# tar -xf apr-util-1.4.1.tar.bz2

[[email protected] ~]# tar -xf httpd-2.4.4.tar.gz

[[email protected] ~]# ls

anaconda-ks.cfg apr-util-1.4.1 install.log apr-1.4.6

apr-util-1.4.1.tar.bz2 apr-1.4.6.tar.gz httpd-2.4.4.tar.gz httpd-2.4.4


安裝前需確認開發環境組是否安裝:Development Tools(開發工具)和Development Libraries(開發庫)

[[email protected] ~]# yum groupinstall "Development Tools"

Loaded plugins: refresh-packagekit, rhnplugin

This system is not registered with RHN.

RHN support will be disabled.

Setting up Group Process

[[email protected] ~]#yum groupinstall "Development Libraries"


[[email protected] ~]#cd apr-1.4.6

[[email protected] apr-1.4.6]# ./configure --prefix=/usr/local/apr #編譯安裝前,

--prefix指定編譯安裝路徑

[[email protected] apr-1.4.6]# make

[[email protected] apr-1.4.6]# make install #至此編譯安裝apr完成(刪除編譯安裝的軟體,只需要把安裝目錄刪除即可)

[[email protected] apr-1.4.6]# cd ~/apr-util-1.4.1

[[email protected] apr-util-1.4.1]#./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr #編譯安裝apr-util需通過--prefix指定安裝目錄,以及--with-apr指定apr的安裝路徑。(必須2者都指定) 至此apr-util-1.4.1安裝成功

[[email protected] apr-util-1.4.1]#cd ~/httpd-2.4.4

[[email protected] httpd-2.4.4]#./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-rewrite --enable-ssl --enable-cgi --enable-cgid --enable-modules=most --enable-mods-shared=most --enable-mpms-shared=all --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util #編譯安裝httpd需指定安裝目錄--prefix,主配置檔案目錄--sysconfdir

還需開通很多功能,--enable-so等功能,且必須指定apr和apr-util編譯安裝的位置。

checking how to run the C preprocessor... gcc -E

checking for gcc option to accept ISO C99... -std=gnu99

checking for pcre-config... false

configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/ #這裡報錯提示pcre-config沒有安裝,需安裝pcre-devel

[[email protected] httpd-2.4.4]# yum install pcre-devel #安裝pcre-devel

Loaded plugins: refresh-packagekit, rhnplugin

This system is not registered with RHN.

RHN support will be disabled.

Server | 3.7 kB 00:00

...

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package pcre-devel.x86_64 0:7.8-3.1.el6 set to be updated

--> Finished Dependency Resolution

......

Running Transaction

Installing : pcre-devel-7.8-3.1.el6.x86_64 1/1

Installed:

pcre-devel.x86_64 0:7.8-3.1.el6

Complete!

[[email protected] httpd-2.4.4]#./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-rewrite --enable-ssl --enable-cgi --enable-cgid --enable-modules=most --enable-mods-shared=most --enable-mpms-shared=all --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util #再重新執行一次編譯

.......

checking for OpenSSL... checking for user-provided OpenSSL base directory... none

checking for OpenSSL version >= 0.9.7... FAILED #提示openssl version 錯誤,解決方法

安裝openssl-devel

configure: WARNING: OpenSSL version is too old

no

checking whether to enable mod_ssl... configure: error: mod_ssl has been requested but can not be built due to prerequisite failures

[[email protected] httpd-2.4.4]# yum install openssl-devel #安裝openssl-devel

Loaded plugins: refresh-packagekit, rhnplugin

This system is not registered with RHN.

RHN support will be disabled.

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package openssl-devel.x86_64

..........

Installed:

openssl-devel.x86_64 0:1.0.0-4.el6

Dependency Installed:

keyutils-libs-devel.x86_64 0:1.4-1.el6 krb5-devel.x86_64 0:1.8.2-3.el6 libcom_err-devel.x86_64 0:1.41.12-3.el6 libselinux-devel.x86_64 0:2.0.94-2.el6 libsepol-devel.x86_64 0:2.0.41-3.el6 zlib-devel.x86_64 0:1.2.3-25.el6

Complete!

[[email protected] httpd-2.4.4]#./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-rewrite --enable-ssl --enable-cgi --enable-cgid --enable-modules=most --enable-mods-shared=most --enable-mpms-shared=all --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util #再重新執行一次編譯

.........

config.status: creating build/rules.mk

config.status: creating build/pkg/pkginfo

config.status: creating build/config_vars.sh

config.status: creating include/ap_config_auto.h

config.status: executing default commands #直到編譯安裝不再出現報錯可以繼續執行make

[[email protected] httpd-2.4.4]# make #一般./configure 編譯報錯都解決後,make和make一般都會成功

直接執行make和make install就可以了

[[email protected] httpd-2.4.4]#make install

......

Installing man pages and online manual

mkdir /usr/local/apache/man

mkdir /usr/local/apache/man/man1

mkdir /usr/local/apache/man/man8

mkdir /usr/local/apache/manual

make[1]: Leaving directory `/root/httpd-2.4.4' #至此httpd編譯安裝完成


啟動httpd前需把selinux關閉,否則無法啟動:

[[email protected] httpd-2.4.4]# getenforce #檢視selinux當前狀態

Enforcing

[[email protected] httpd-2.4.4]# setenforce 0 #臨時關閉selinux,重啟失效。

[[email protected] httpd-2.4.4]# vim /etc/selinux/config #編輯selinux配置文件,使設定永久有效

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

# enforcing - SELinux security policy is enforced.

# permissive - SELinux prints warnings instead of enforcing.

# disabled - No SELinux policy is loaded.

SELINUX=permissive #這項改成permissive或者disabled(建議改成permissive)

# SELINUXTYPE= can take one of these two values:

# targeted - Targeted processes are protected,

# mls - Multi Level Security protection.

SELINUXTYPE=targeted

[[email protected] httpd-2.4.4]#getenforce

Permissive #狀態變為permissive

[[email protected] httpd-2.4.4]# cd /usr/local/apache

[[email protected] apache]# ls

bin build cgi-bin error htdocs icons include logs man manual modules


[[email protected] apache]# bin/apachectl start #測試啟動apache服務

[[email protected] apache]# netstat -tlnp #檢視監聽的埠號

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name

tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1325/rpcbind

tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 1809/dnsmasq

tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1572/sshd

tcp 0 0 :::111 :::* LISTEN 1325/rpcbind

tcp 0 0 :::80 :::* LISTEN 14642/httpd


至此httpd服務就啟動了,通過客戶端訪問ip即可

wKioL1ikETSQ4jYfAAFC8dnKxII098.jpg

修改httpd.conf配置文件使得httpd.pid(httpd程序啟動生成的文件,服務關閉後文檔消失)文件生成路徑修改為/var/run/httpd.pid,

[[email protected] apache]# bin/apachectl stop #停止httpd服務

[[email protected] apache]# vim /etc/httpd/httpd.conf #配置檔案路徑為編譯安裝httpd的時候設定的路徑

..........

# least PidFile.

#

ServerRoot "/usr/local/apache"

PidFile "/var/run/httpd.pid" #新增該行內容(必須先停止httpd服務)

.........


***為了使得httpd可以通過service httpd stop|start|restart管理方式,需在/etc/init.d/新建一個指令碼httpd啟動指令碼,指令碼內容如下:


[[email protected] apache]#vim /etc/init.d/httpd

#!/bin/bash

#

# httpd Startup script for the Apache HTTP Server

#

# chkconfig: - 85 15

# description: Apache is a World Wide Web server. It is used to server

# HTML files and CGI.

# processname: httpd

# config: /etc/httpd/conf/httpd.conf

# config: /etc/sysconfig/httpd

# pidfile: /var/run/httpd.pid

# Source function library.

. /etc/rc.d/init.d/functions

if [ -f /etc/sysconfig/httpd ]; then

. /etc/sysconfig/httpd

fi

# Start httpd in the C locale by default.

HTTPD_LANG=${HTTPD_LANG-"C"}

# This will prevent initlog from swallowing up a pass-phrase prompt if

# mod_ssl needs a pass-phrase from the user.

INITLOG_ARGS=""

# Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server

# with the thread-based "worker" MPM; BE WARNED that some modules may not

# work correctly with a thread-based MPM; notably PHP will refuse to start.

# Path to the apachectl script, server binary, and short-form for messages.

apachectl=/usr/local/apache/bin/apachectl

httpd=${HTTPD-/usr/local/apache/bin/httpd}

prog=httpd

pidfile=${PIDFILE-/var/run/httpd.pid}

lockfile=${LOCKFILE-/var/lock/subsys/httpd}

RETVAL=0

start() {

echo -n $"Starting $prog: "

LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS

RETVAL=$?

echo

[ $RETVAL = 0 ] && touch ${lockfile}

return $RETVAL

}

stop() {

echo -n $"Stopping $prog: "

killproc -p ${pidfile} -d 10 $httpd

RETVAL=$?

echo

[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}

}

reload() {

echo -n $"Reloading $prog: "

if ! LANG=$HTTPD_LANG $httpd $OPTIONS -t >& /dev/null; then

RETVAL=$?

echo $"not reloading due to configuration syntax error"

failure $"not reloading $httpd due to configuration syntax error"

else

kellproc -p ${pidfile} $httpd -HUP

RETVAL=$?

fi

echo

}

# See how we were called.

case "$1" in

start)

start

;;

stop)

stop

;;

status)

status -p ${pidfile} $httpd

RETVAL=$?

;;

restart)

stop

start

;;

condrestart)

if [ -f ${pidfile} ] ; then

stop

start

fi

;;

reload)

reload

;;

graceful|help|configtest|fullstatus)

$apachectl [email protected]

RETVAL=$?

;;

*)

echo $"Usage: $prog{start|stop|restart|condrestart|reload|status|fullstatus|graceful|help| configtest}"

exit 1

esac

exit $RETVAL


[[email protected] apache]# chmod +x /etc/init.d/httpd #賦予執行許可權

[[email protected] apache]# service httpd restart #通過啟用服務方式成功重新啟動httpd服務

停止 httpd: [確定]

正在啟動 httpd: [確定]

[[email protected] apache]# chkconfig --add httpd #把httpd服務新增到開機啟動列表中

[[email protected] apache]# chkconfig --list #檢視開機啟動列表

NetworkManager 0:關閉1:關閉2:啟用3:啟用4:啟用5:啟用6:關閉

ebtables 0:關閉1:關閉2:關閉3:關閉4:關閉5:關閉6:關閉

firstboot 0:關閉1:關閉2:關閉3:關閉4:關閉5:關閉6:關閉

gfs2 0:關閉1:關閉2:關閉3:關閉4:關閉5:關閉6:關閉

haldaemon 0:關閉1:關閉2:關閉3:啟用4:啟用5:啟用6:關閉

httpd 0:關閉1:關閉2:關閉3:關閉4:關閉5:關閉6:關閉 #預設開機不啟動

ip6tables 0:關閉1:關閉2:啟用3:啟用4:啟用5:啟用6:關閉

[[email protected] apache]#chkconfig httpd on #設定httpd服務在級別2345預設開機啟動(或者指定chkconfig --level 35 httpd on設定服務在級別35開機啟動)

[[email protected] apache]#chkconfig --list #檢視開機啟動列表

NetworkManager0:關閉1:關閉2:啟用3:啟用4:啟用5:啟用6:關閉

ebtables 0:關閉1:關閉2:關閉3:關閉4:關閉5:關閉6:關閉

firstboot 0:關閉1:關閉2:關閉3:關閉4:關閉5:關閉6:關閉

gfs2 0:關閉1:關閉2:關閉3:關閉4:關閉5:關閉6:關閉

haldaemon 0:關閉1:關閉2:關閉3:啟用4:啟用5:啟用6:關閉

httpd 0:關閉1:關閉2:啟用3:啟用4:啟用5:啟用6:關閉 #預設開機啟動

ip6tables 0:關閉1:關閉2:啟用3:啟用4:啟用5:啟用6:關閉

[[email protected] apache]# cd

[[email protected] ~]#vim /etc/profile.d/httpd.sh #把/usr/local/httpd/bin執行指令碼命令路徑放置在PATH變數中,使得該路徑中的命令可以直接執行。

export PATH=$PATH:/usr/local/apache/bin #增加該行內容


然後重新登入下系統,/usr/local/apache/bin中的命令都可以直接執行,而不用加路徑

[[email protected] ~]#httpd -t #檢查httpd配置檔案是否有語法錯誤

Syntax OK

[[email protected] ~]# echo $PATH

/usr/lib64/qt3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/apache/bin:/root/bin #已經把/usr/local/apache/bin目錄加到了PATH變數中

[[email protected] ~]# vim /etc/httpd/httpd.conf #修改主配置文件中下面2行內容

wKioL1ilD0uzju7nAAYcFsfxVjk533.jpg[[email protected] ~]# httpd -t

Syntax OK

[[email protected] ~]# service httpd restart

停止 httpd: [確定]

正在啟動 httpd: [確定]

[[email protected] ~]# httpd -M #檢視當前啟用的模組

Loaded Modules:

.......

headers_module (shared)

setenvif_module (shared)

version_module (shared)

mpm_prefork_module (shared) #預設模組已經修改為prefork模組了(以後需要切換其他模組只需 要修改主配置文件中上一步驟的內容即可)

unixd_module (shared)

status_module (shared)

........
-----------------------------------------------------------------------------------

2、開始安裝mysql5.5.54版本

--------------------------------------------------------------------------------

[[email protected] ~]# ls

anaconda-ks.cfg apr-util-1.4.1.tar.bz2 install.log.syslog httpd-2.4.4 mysql-5.5.54-linux2.6-x86_64.tar.gz

[[email protected] ~]# tar xfmysql-5.5.54-linux2.6-x86_64.tar.gz -C /usr/local #-C 指定解壓目錄

[[email protected] ~]# cd /usr/local

[[email protected] local]# ls

apache apr-util etc include lost+found mysql-5.5.54-linux2.6-x86_64

[[email protected] local]# ln -sv mysql-5.5.54-linux2.6-x86_64 mysql #建立軟連結mysql

"mysql" -> "mysql-5.5.54-linux2.6-x86_64"

[[email protected] local]#ls

apache apr-util etc include lib64 mysql-5.5.54-linux2.6-x86_64

apr bin games lib libexec mysql

[[email protected] local]# cd mysql

[[email protected] mysql]# groupadd -r -g 306 mysql #-r指建立系統組,-g指定組ID

[[email protected] mysql]# useradd -r -g 306 -u 306 mysql #-r建立系統使用者(不能登入系統的使用者)

-u指定UID

[[email protected] mysql]# id mysql #檢視使用者資訊,UID GID

uid=306(mysql) gid=306(mysql) 組=306(mysql)

[[email protected] mysql]# ls /home

donggen

[[email protected] mysql]# ll

總用量 72

drwxr-xr-x. 2 root root 4096 2月 17 09:33 bin

-rw-r--r--. 1 7161 31415 17987 11月 28 20:32 COPYING

drwxr-xr-x. 3 root root 4096 2月 17 09:33 data

drwxr-xr-x. 2 root root 4096 2月 17 09:33 docs

drwxr-xr-x. 3 root root 4096 2月 17 09:33 include

-rw-r--r--. 1 7161 31415 301 11月 28 20:32 INSTALL-BINARY

drwxr-xr-x. 3 root root 4096 2月 17 09:33 lib

drwxr-xr-x. 4 root root 4096 2月 17 09:33 man

drwxr-xr-x. 10 root root 4096 2月 17 09:34 mysql-test

-rw-r--r--. 1 7161 31415 2496 11月 28 20:32 README

drwxr-xr-x. 2 root root 4096 2月 17 09:33 scripts

drwxr-xr-x. 27 root root 4096 2月 17 09:33 share

drwxr-xr-x. 4 root root 4096 2月 17 09:33 sql-bench

drwxr-xr-x. 2 root root 4096 2月 17 09:33 support-files

[[email protected] mysql]# chown -R mysql.mysql /usr/local/mysql/* #-R遞迴把mysql目錄下的所有文件 或目錄都修改為mysql使用者和mysql組

[[email protected] mysql]# ll

總用量 72

drwxr-xr-x. 2 mysql mysql 4096 2月 17 09:33 bin

-rw-r--r--. 1 mysql mysql 17987 11月 28 20:32 COPYING

drwxr-xr-x. 3 mysql mysql 4096 2月 17 09:33 data

drwxr-xr-x. 2 mysql mysql 4096 2月 17 09:33 docs

drwxr-xr-x. 3 mysql mysql 4096 2月 17 09:33 include

-rw-r--r--. 1 mysql mysql 301 11月 28 20:32 INSTALL-BINARY

drwxr-xr-x. 3 mysql mysql 4096 2月 17 09:33 lib

drwxr-xr-x. 4 mysql mysql 4096 2月 17 09:33 man

drwxr-xr-x. 10 mysql mysql 4096 2月 17 09:34 mysql-test

-rw-r--r--. 1mysql mysql 2496 11月 28 20:32 README

drwxr-xr-x. 2mysql mysql 4096 2月 17 09:33 scripts

drwxr-xr-x. 27 mysql mysql 4096 2月 17 09:33 share

drwxr-xr-x. 4 mysql mysql 4096 2月 17 09:33 sql-bench

drwxr-xr-x. 2 mysql mysql 4096 2月 17 09:33 support-files

[[email protected] mysql]#


** 由於mysql資料庫隨著時間的增長,資料會越來越大,所以應該把資料庫資料放置在一個單獨的可擴充套件的分割槽捲上,以便後期管理和備份,掛載在邏輯卷是比較好的方法如下:


[[email protected] ~]# fdisk /dev/sdb #新建分割槽

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel with disk identifier 0xef7e9b34.

Changes will remain in memory only, until you decide to write them.

After that, of course, the previous content won't be recoverable.


Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)


WARNING: DOS-compatible mode is deprecated. It's strongly recommended to

switch off the mode (command 'c') and change display units to

sectors (command 'u').


Command (m for help): p


Disk /dev/sdb: 21.5 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0xef7e9b34


Device Boot Start End Blocks Id System


Command (m for help): n

Command action

e extended

p primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-2610, default 1):

Using default value 1

Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610): +10G


Command (m for help): T

Selected partition 1

Hex code (type L to list codes): 8e

Changed system type of partition 1 to 8e (Linux LVM)


Command (m for help): p


Disk /dev/sdb: 21.5 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0xef7e9b34


Device Boot Start End Blocks Id System

/dev/sdb1 1 1306 10490413+ 8e Linux LVM


Command (m for help): w

The partition table has been altered!


Calling ioctl() to re-read partition table.

Syncing disks.

[[email protected] ~]# partprobe /dev/sdb #通知核心重讀sdb分割槽

[[email protected] ~]# pvcreate /dev/sdb1 #先把/dev/sdb1分割槽建立一個pv物理卷

Physical volume "/dev/sdb1" successfully created

[[email protected] ~]# pvs #檢視物理卷

PV VG Fmt Attr PSize PFree

/dev/sdb1 lvm2 a- 10.00g 10.00g

[[email protected] ~]# vgcreate myvg /dev/sdb1 #以/dev/sdb1分割槽建立myvg卷組

Volume group "myvg" successfully created

[[email protected] ~]#vgs #檢視卷組

VG #PV #LV #SN Attr VSize VFree

myvg 1 0 0 wz--n- 10.00g 10.00g

[[email protected] ~]# lvcreate -n mydata -L 5G myvg #在卷組myvg中建立一個大小為5G,

名稱為mydata 的邏輯卷

Logical volume "mydata" created

[[email protected] ~]# lvs #檢視邏輯卷

LV VG Attr LSize Origin Snap% Move Log Copy% Convert

mydata myvg -wi-a- 5.00g

[[email protected] ~]# mke2fs -t ext4 /dev/myvg/mydata #格式化mydata邏輯卷

mke2fs 1.41.12 (17-May-2010)

檔案系統標籤=

作業系統:Linux

塊大小=4096 (log=2)

分塊大小=4096 (log=2)

Stride=0 blocks, Stripe width=0 blocks

327680 inodes, 1310720 blocks

65536 blocks (5.00%) reserved for the super user

第一個資料塊=0

Maximum filesystem blocks=1342177280

40 block groups

32768 blocks per group, 32768 fragments per group

8192 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736


正在寫入inode表: 完成

Creating journal (32768 blocks): 完成

Writing superblocks and filesystem accounting information: 完成

[[email protected] ~]# mkdir /mydata #建立一個目錄作為掛載點

[[email protected] ~]# vim /etc/fstab #設定邏輯捲開機自動掛載

# /etc/fstab

# Created by anaconda on Tue Feb 14 01:11:01 2017

#

# Accessible filesystems, by reference, are maintained under '/dev/disk'

# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info

#


tmpfs /dev/shm tmpfs defaults 0 0

devpts /dev/pts devpts gid=5,mode=620 0 0

sysfs /sys sysfs defaults 0 0

proc /proc proc defaults 0 0

/dev/myvg/mydata /mydata ext4 defaults 0 0 #新增該行內容

[[email protected] ~]# mount -a #重讀/etc/fstab硬碟掛載檔案,使得新增的分割槽掛載成功

[[email protected] ~]# mount #檢視已經掛載的分割槽

/dev/sda2 on / type ext4 (rw)

proc on /proc type proc (rw)

sysfs on /sys type sysfs (rw)

devpts on /dev/pts type devpts (rw,gid=5,mode=620)

tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")

/dev/sda1 on /boot type ext4 (rw)

/dev/sda5 on /home type ext4 (rw)

/dev/sda3 on /usr/local type ext4 (rw)

/dev/sda6 on /var type ext4 (rw)

none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

/dev/mapper/myvg-mydata on /mydata type ext4 (rw) #邏輯卷mydata已經掛載到/mydata目錄

[[email protected] ~]# mkdir /mydata/data

[[email protected] ~]# ll /mydata

總用量 20

drwxr-xr-x. 2 root root 4096 2月 17 17:30 data

drwx------. 2 root root 16384 2月 17 15:11 lost+found

[[email protected] ~]# chown -R mysql.mysql /mydata/data/ #更改資料夾屬主和屬組-R遞迴

[[email protected] ~]# ll /mydata

總用量 20

drwxr-xr-x. 2 mysql mysql 4096 2月 17 17:30 data

drwx------. 2 root root 16384 2月 17 15:11 lost+found

[[email protected] ~]#chmod o-rx /mydata/data/ #刪除/data組其他人的讀和執行許可權

[[email protected] ~]# ll /mydata

總用量 20

drwxr-x---. 2 mysql mysql 4096 2月 17 17:30 data

drwx------. 2 root root 16384 2月 17 15:11 lost+found

[[email protected] ~]# cd /usr/local/mysql

[[email protected] mysql]# pwd

/usr/local/mysql

[[email protected] mysql]# scripts/mysql_install_db --user=mysql --datadir=/mydata/data/ #初始化mysql,以mysql使用者,且資料目錄需修改為/mydata/data目錄

Installing MySQL system tables...

.........

To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:


./bin/mysqladmin -u root password 'new-password'

./bin/mysqladmin -u root -h lamp.com password 'new-password'


Alternatively you can run:

./bin/mysql_secure_installation


which will also give you the option of removing the test

databases and anonymous user created by default. This is

strongly recommended for production servers.


See the manual for more instructions.


You can start the MySQL daemon with:

cd . ; ./bin/mysqld_safe &


You can test the MySQL daemon with mysql-test-run.pl

cd ./mysql-test ; perl mysql-test-run.pl


Please report any problems at http://bugs.mysql.com/ #初始化完成

[[email protected] mysql]#ll #由於mysql目錄內的檔案和目錄都為mysql屬主,很容易被破解,所以把 mysql目錄內的檔案和目錄屬主修改為root

drwxr-xr-x. 2 mysql mysql 4096 2月 17 09:33 bin

-rw-r--r--. 1 mysql mysql 17987 11月 28 20:32 COPYING

drwxr-xr-x. 3 mysql mysql 4096 2月 17 09:33 data

drwxr-xr-x. 2 mysql mysql 4096 2月 17 09:33 docs

drwxr-xr-x. 3 mysql mysql 4096 2月 17 09:33 include

-rw-r--r--. 1 mysql mysql 301 11月 28 20:32 INSTALL-BINARY

drwxr-xr-x. 3 mysql mysql 4096 2月 17 09:33 lib

drwxr-xr-x. 4 mysql mysql 4096 2月 17 09:33 man

drwxr-xr-x. 10 mysql mysql 4096 2月 17 09:34 mysql-test

-rw-r--r--. 1 mysql mysql 2496 11月 28 20:32 README

drwxr-xr-x. 2 mysql mysql 4096 2月 17 09:33 scripts

drwxr-xr-x. 27 mysql mysql 4096 2月 17 09:33 share

drwxr-xr-x. 4 mysql mysql 4096 2月 17 09:33 sql-bench

drwxr-xr-x. 2 mysql mysql 4096 2月 17 09:33 support-files

[[email protected] mysql]# chown -R root ./* #-R遞迴更改當前目錄中所有檔案和目錄的屬主為root

[[email protected] mysql]# ll

drwxr-xr-x. 2 root mysql 4096 2月 17 09:33 bin

-rw-r--r--. 1 root mysql 17987 11月 28 20:32 COPYING

drwxr-xr-x. 3 root mysql 4096 2月 17 09:33 data #由於data資料資料夾已經修改為/mydata/data目錄,所以此處不需要把屬主修改為mysql,否則如果沒有修改data路徑需修改為mysql

drwxr-xr-x. 2 root mysql 4096 2月 17 09:33 docs

drwxr-xr-x. 3 root mysql 4096 2月 17 09:33 include

-rw-r--r--. 1 root mysql 301 11月 28 20:32 INSTALL-BINARY

drwxr-xr-x. 3 root mysql 4096 2月 17 09:33 lib

drwxr-xr-x. 4 root mysql 4096 2月 17 09:33 man

drwxr-xr-x. 10 root mysql 4096 2月 17 09:34 mysql-test

-rw-r--r--. 1 root mysql 2496 11月 28 20:32 README

drwxr-xr-x. 2 root mysql 4096 2月 17 09:33 scripts

drwxr-xr-x. 27 root mysql 4096 2月 17 09:33 share

drwxr-xr-x. 4 root mysql 4096 2月 17 09:33 sql-bench

drwxr-xr-x. 2 root mysql 4096 2月 17 09:33 support-files

[[email protected] mysql]# ls support-files/

binary-configure magic my-medium.cnf mysql.server(mysql的服務啟動指令碼)

config.medium.ini my-innodb-heavy-4G.cnf mysqld_multi.server

[[email protected] mysql]# cp support-files/mysql.server /etc/init.d/mysqld #把啟動指令碼複製到 linux系統預設服務啟動的init.d目錄中,並修改名稱為mysqld

[[email protected] mysql]# ll /etc/init.d/mysqld #檢視mysqld是否有執行的許可權

-rwxr-xr-x. 1 root root 10875 2月 18 09:21 /etc/init.d/mysqld

[[email protected] mysql]# chkconfig --add mysqld #把mysqld程序新增到開機啟動列表

[[email protected] mysql]# chkconfig --list mysqld #檢視開機啟動列表中mysqld是否設定為開機啟動

mysqld 0:關閉1:關閉2:啟用3:啟用4:啟用5:啟用6:關閉


至此mysql啟動程序,資料資料夾等都設定完成,接下來配置mysql的配置文件相關內容:

MYsql配置檔案路徑:/etc/my.cnf

[[email protected] mysql]# ll support-files/

總用量 96

-rwxr-xr-x. 1 root mysql 1153 11月 29 00:10 binary-configure

-rw-r--r--. 1 root mysql 4691 11月 29 00:10 my-huge.cnf #配置檔案

-rw-r--r--. 1 root mysql 19759 11月 29 00:10 my-innodb-heavy-4G.cnf#配置檔案

-rw-r--r--. 1 root mysql 4665 11月 29 00:10 my-large.cnf #配置檔案

-rw-r--r--. 1 root mysql 4676 11月 29 00:10 my-medium.cnf #配置檔案

-rw-r--r--. 1 root mysql 2840 11月 29 00:10 my-small.cnf#配置檔案

..........

以上5個都是配置文件模板,具體使用哪個作為自己mysql為配置檔案,需根據自己的記憶體大小定義:

記憶體小於64M選擇small.cnf 記憶體128M選擇medium.cnf 記憶體為512M選擇large.cnf 記憶體1-2G選擇

huge.cnf作為配置檔案。

[[email protected] mysql]# free -m #檢視記憶體大小,記憶體大小為2G,所以選擇

total used free shared buffers cached

Mem: 2007 239 1767 0 16 71

-/+ buffers/cache: 151 1855

Swap: 1499 0 1499

[[email protected] mysql]# cp support-files/my-huge.cnf /etc/my.cnf

[[email protected] mysql]# vim /etc/my.cnf #修改配置檔案,紅色部分為修改過的

...........

[mysqld]

port = 3306

socket = /tmp/mysql.sock

skip-external-locking

key_buffer_size = 384M

max_allowed_packet = 1M

table_open_cache = 512

sort_buffer_size = 2M

read_buffer_size = 2M

read_rnd_buffer_size = 8M

myisam_sort_buffer_size = 64M

thread_cache_size = 8

query_cache_size = 32M

# Try number of CPU's*2 for thread_concurrency

thread_concurrency = 4 #修改為4,數值為CPU的個數*2

datadir = /mydata/data #新增該行,指定資料目錄為/mydata/data

至此就可以啟動mysql服務了

[[email protected] mysql]#service mysqld start #啟動mysqld服務

Starting MySQL.. SUCCESS!

[[email protected] mysql]# service mysqld restart #重啟mysqld服務

Shutting down MySQL. SUCCESS!

Starting MySQL.. SUCCESS!

[[email protected] mysql]#netstat -tlnp |grep mysqld

tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 6954/mysqld #已啟動


[[email protected] mysql]# mysql #啟用mysql客戶端,無法啟動,提示命令沒發現(預設PATH變數沒mysql 所在路徑)

-bash: mysql: command not found

[[email protected] mysql]#vim /etc/profile.d/mysql.sh #新建mysql.sh把mysql的啟動命令路徑加到 PATH變數中

export PATH=$PATH:/usr/local/mysql/bin #新增該行內容


重新登入系統後再測試mysql命令,如下:


[[email protected] ~]# msyql #成功登入到mysql客戶端

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.5.54-log MySQL Community Server (GPL)

Copyright (c) 2000, 2016, 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

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>


至此mysql已經配置完成,為了使得可以通過man命令檢視mysql需修改/etc/man.conf配置文件

[[email protected] ~]# vim /etc/man.config

....

MANPATH /usr/man

MANPATH /usr/share/man

MANPATH /usr/local/man

MANPATH /usr/local/share/man

MANPATH /usr/X11R6/man

MANPATH /usr/local/mysql/man #新增該行,使得幫助文件能通過man找到

[[email protected] ~]# vim /etc/ld.so.conf.d/mysql.conf #新建mysql庫路徑檔案,使得系統能夠識別到

/usr/local/mysql/lib #新增該行內容


[[email protected] ~]# ldconfig -v #通知系統重新讀取庫檔案,-v顯示重讀過程

............

libxklavier.so.15 -> libxklavier.so.15.0.0

liblcms.so.1 -> liblcms.so.1.0.19

/lib64/tls: (hwcap: 0x8000000000000000)

/usr/lib64/sse2: (hwcap: 0x0000000004000000)

/usr/lib64/tls: (hwcap: 0x8000000000000000)

[[email protected] ~]# ln -sv /usr/local/mysql/include /usr/include/mysql #建立mysql的標頭檔案目錄鏈 接,使得可以直接輸出標頭檔案

"/usr/include/mysql" -> "/usr/local/mysql/include"

[[email protected] ~]#ls /usr/include/mysql/

decimal.h my_attribute.h my_global.h mysqld_ername.h my_sys.h

my_alloc.h my_getopt.h mysql_com.h mysql_version.h sql_common.h

------------------------------------------------------------------------------

至此MySQL已經安裝配置完成。


3、編譯安裝PHP

lftp [email protected]:/> get php-5.4.23.tar.bz2

12251671 bytes transferred in 1 second (11.10M/s)

lftp [email protected]:/> bye #從ftp伺服器上下載php或者從文章最後地址下載

[[email protected] ~]#ls

anaconda-ks.cfg apr-util-1.4.1.tar.bz2 install.log.syslog

apr-1.4.6.tar.gz httpd-2.4.4.tar.gz php-5.4.23.tar.bz2

[[email protected] ~]# tar xf php-5.4.23.tar.bz2

[[email protected] ~]# cd php-5.4.23

[[email protected] php-5.4.23]# ls

........

buildconf.bat makedist README.MAILINGLIST_RULES

CODING_STANDARDS Makefile.frag README.namespaces

header php.ini-development README.UNIX-BUILD-SYSTEM

.......


這裡為了演示event模組,所以這裡需修改httpd的配置文件把模組修改為event模組

[[email protected] php-5.4.23]# vim /etc/httpd/httpd.conf

.......

#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so #註釋掉該行

LoadModule mpm_event_module modules/mod_mpm_event.so #增加該行內容使用event模組

........
[[email protected] php-5.4.23]# httpd -M
#檢視httpd目前啟用的模組型別有哪些

...........

env_module (shared)

headers_module (shared)

setenvif_module (shared)

version_module (shared)

mpm_event_module (shared) #已經修改為event模組型別了

...............


[[email protected] php-5.4.23]#./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql

--with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml

--enable-sockets --with-apxs2=/usr/local/apache/bin/apxs --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2 --enable-maintainer-zts #指定安裝路徑,mysql安裝路徑,支援各種功能和介面,為了支援apache的worker和event這兩個MPM多處理模組,編譯時使用--enable-maintainer-zts選項,如果apache使用的是prefork模組則不需要使用該選項。

...........

checking for strftime... (cached) yes

checking which regex library to use... php

checking whether to enable LIBXML support... yes

checking libxml2 install dir... /usr

checking for xml2-config path...

configure: error: xml2-config not found. Please check your libxml2 installation. #編譯是提示錯誤,先查詢是否安裝過libxml2,如果安裝看是否安裝了libxml2-devel


[[email protected] php-5.4.23]# rpm -qa|grep libxml2 #2個主程式已經安裝

libxml2-2.7.6-1.el6.x86_64

libxml2-python-2.7.6-1.el6.x86_64

[[email protected] php-5.4.23]# yum list all | grep libxml*

This system is not registered with RHN.

RHN support will be disabled.

libxml2.x86_64 2.7.6-1.el6 @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0

libxml2-python.x86_64 2.7.6-1.el6 @anaconda-RedHatEnterpriseLinux-

libxml2.i686 2.7.6-1.el6 Server

libxml2-devel.i686 2.7.6-1.el6 Server

libxml2-devel.x86_64 2.7.6-1.el6 Server #64位系統安裝

perl-libxml-perl.noarch 0.08-10.el6 Server


[[email protected] php-5.4.23]# yum install libxml2-devel.x86_64

Loaded plugins: refresh-packagekit, rhnplugin

This system is not registered with RHN.

RHN support will be disabled.

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package libxml2-devel.x86_64 0:2.7.6-1.el6 set to be updated

--> Finished Dependency Resolution


Dependencies Resolved


=====================================================================================================

Package Arch Version Repository Size

=====================================================================================================

Installing:

libxml2-devel x86_64 2.7.6-1.el6 Server 1.1 M


Transaction Summary

=====================================================================================================

Install 1 Package(s)

Upgrade 0 Package(s)


Total download size: 1.1 M

Installed size: 8.5 M

Is this ok [y/N]: y

Downloading Packages:

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : libxml2-devel-2.7.6-1.el6.x86_64 1/1


Installed:

libxml2-devel.x86_64 0:2.7.6-1.el6

Complete! #libxml2-devel安裝完成


*再次執行PHP編譯./configure

[[email protected] php-5.4.23]# ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-openssl -with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --with-apxs2=/usr/local/apache/bin/apxs --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2 --enable-maintainer-zts

.........

checking for gzgets in -lz... yes

checking whether to enable bc style precision math functions... no

checking for BZip2 support... yes

checking for BZip2 in default path... not found

configure: error: Please reinstall the BZip2 distribution #提示BZip2報錯

[[email protected] php-5.4.23]# yum list all |grep bzip2* #查詢是否缺少bzip2組建

This system is not registered with RHN.

RHN support will be disabled.

bzip2.x86_64 1.0.5-6.1.el6 @anaconda-RedHatEnterpriseLinux

bzip2-libs.x86_64 1.0.5-6.1.el6 @anaconda-RedHatEnterpriseLinux

bzip2-devel.i686 1.0.5-6.1.el6 Server

bzip2-devel.x86_64 1.0.5-6.1.el6 Server #該組建未安裝

[[email protected] php-5.4.23]# yum installbzip2-devel.x86_64 #安裝bzip-devel組建

Loaded plugins: refresh-packagekit, rhnplugin

This system is not registered with RHN.

RHN support will be disabled.

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package bzip2-devel.x86_64 0:1.0.5-6.1.el6 set to be updated

--> Finished Dependency Resolution


Dependencies Resolved


=====================================================================================================

Package Arch Version Repository Size

=====================================================================================================

Installing:

bzip2-devel x86_64 1.0.5-6.1.el6 Server 250 k


Transaction Summary

=====================================================================================================

Install 1 Package(s)

Upgrade 0 Package(s)


Total download size: 250 k

Installed size: 412 k

Is this ok [y/N]: y

Downloading Packages:

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : bzip2-devel-1.0.5-6.1.el6.x86_64 1/1


Installed:

bzip2-devel.x86_64 0:1.0.5-6.1.el6

Complete! #安裝bzip2-devel成功


*再次執行PHP編譯./configure

[[email protected] php-5.4.23]#./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-openssl -with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --with-apxs2=/usr/local/apache/bin/apxs --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2 --enable-maintainer-zts

....................

checking for alloca... (cached) yes

checking for working memcmp... yes

checking for stdarg.h... (cached) yes

checking for mcrypt support... yes

configure: error: mcrypt.h not found. Please reinstall libmcrypt.#提示libmcrypt未安裝,

需安裝mhash-0.9.9.2.rpm mhash-devel-0.9.2.rpm libmcrypt-2.5.7.rpm libmcrypt-devel-2.5.7.rpm

[[email protected] ~]#ls

apr-1.4.6 libmcrypt-2.5.8-9.el6.x86_64.rpm apr-1.4.6.tar.gz

libmcrypt-devel-2.5.8-9.el6.x86_64.rpm mhash-0.9.9-2.3.x86_64.rpm

apr-util-1.4.1.tar.bz2 mhash-devel-0.9.9-2.3.x86_64.rpm

[[email protected] ~]# rpm -ivh *.rpm #安裝當前目錄下,所有.rpm包

warning: libmcrypt-2.5.8-9.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY

warning: mhash-0.9.9-2.3.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 04b8b50a: NOKEY

Preparing... ########################################### [100%]

1:mhash ########################################### [ 25%]

2:libmcrypt ########################################### [ 50%]

3:libmcrypt-devel ########################################### [ 75%]

4:mhash-devel ########################################### [100%]


*再次執行PHP編譯./configure

[[email protected] php-5.4.23]#./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-openssl -with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --with-apxs2=/usr/local/apache/bin/apxs --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2 --enable-maintainer-zts

#需注意幾個地方 --with-apxs2=/usr/local/apache/bin/apxs 這個表示把php做成httpd的模組方式即不用啟動指令碼的,如果需要把php做成fcgi,則該項需修改為--enable-fpm,兩項不能同時使用。

.................

Generating files

configure: creating ./config.status

creating main/internal_functions.c

creating main/internal_functions_cli.c

+--------------------------------------------------------------------+

| License: |

| This software is subject to the PHP License, available in this |

| distribution in the file LICENSE. By continuing this installation |

| process, you are bound by the terms of this license agreement. |

| If you do not agree with the terms of this license, you must abort |

| the installation process at this point. |

+--------------------------------------------------------------------+


Thank you for using PHP.


config.status: creating php5.spec

config.status: creating main/build-defs.h

config.status: creating scripts/phpize

config.status: creating scripts/man1/phpize.1

config.status: creating scripts/php-config

config.status: creating scripts/man1/php-config.1

config.status: creating sapi/cli/php.1

config.status: creating sapi/cgi/php-cgi.1

config.status: creating ext/phar/phar.1

config.status: creating ext/phar/phar.phar.1

config.status: creating main/php_config.h

config.status: main/php_config.h is unchanged

config.status: executing default commands #至此第一步./configure完成

[[email protected] php-5.4.23]#make

[[email protected] php-5.4.23]#make install

.............

Wrote PEAR system config file at: /usr/local/php/etc/pear.conf

You may want to add: /usr/local/php/lib/php to your php.ini include_path

[PEAR] Structures_Graph- installed: 1.0.4

[PEAR] XML_Util - installed: 1.2.1

/root/php-5.4.23/build/shtool install -c ext/phar/phar.phar /usr/local/php/bin

ln -s -f /usr/local/php/bin/phar.phar /usr/local/php/bin/phar

Installing PDO headers: /usr/local/php/include/php/ext/pdo/

至此php編譯安裝完成,接下來對php相關配置進行設定


[[email protected] php-5.4.23]# pwd #確認當前路徑,需把編譯安裝路徑下的配置文件複製到對應路徑

/root/php-5.4.23

[[email protected] php-5.4.23]# ls

acinclude.m4 INSTALL NEWS README.TESTING

aclocal.m4 install-sh pear README.TESTING2

build libphp5.la php5.spec README.UNIX-BUILD-SYSTEM

buildconf libs php5.spec.in README.WIN32-BUILD-SYSTEM

buildconf.bat libtool run-tests.php

CODING_STANDARDS LICENSE php.ini-development(開發環境下的php配置檔案)

php.ini-production(生產環境的php配置檔案) scripts

[[email protected] php-5.4.23]# cp php.ini-production /etc/php.ini #複製生產環境的php配置檔案到編譯安裝php時指定的路徑--with-config-file-path=/etc中並改名


接下來就是編輯php配置檔案,使得php能跟httpd結合起來工作:

[[email protected] ~]# vim /etc/httpd/httpd.conf #編輯httpd配置文件,紅色部分為修改或者新增

.............

AddType application/x-compress .Z

AddType application/x-gzip .gz .tgz

AddType application/x-httpd-php .php #新增該行

AddType application/x-httpd-php-source .phps #新增該行


<IfModule dir_module>

DirectoryIndex index.php index.html #增加支援index.php主頁網頁

</IfModule>

修改以上2個地方後,php就可以測試運行了。


[[email protected] ~]# httpd -t #檢測httpd配置檔案是否有語法錯誤

Syntax OK

[[email protected] ~]# service httpd restart #重啟httpd服務

停止 httpd: [確定]

正在啟動 httpd: [確定]

[[email protected] ~]# cd /usr/local/apache/htdocs/ #進入httpd網頁存放目錄

[[email protected] htdocs]# ls

index.html

[[email protected] htdocs]# mv index.html index.php

[[email protected] htdocs]# vim index.php #編輯主頁檔案,內容如下,儲存並退出。

<html><body><h1>It works!test</h1></body></html>

<?php

phpinfo();

?>

[[email protected] htdocs]#

在客戶端瀏覽器中測試是否php啟動生效,測試結果如下,php和httpd服務關聯運行了

wKiom1iqqwzSSSI5AAG8A0Up9Fk930.jpg


修改index.php文件內容,測試php是否與mysql關聯執行:

[[email protected] htdocs]#vim index.php #內容如下

<html><body><h1>It works! My Apache!</h1></body></html>

<?php

$conn=mysql_connect('localhost','root',''); #('localhost'表示本地mysql主機,root為mysql 使用者名稱,''中間為空:表示目前使用者沒有設定密碼)

if ($conn)

echo "Success....";

else

echo "Failure....";

?>

在客戶端瀏覽器中測試php和mysql服務是否關聯執行,測試結果如下:

mysqld服務啟動時,測試結果如下:

wKioL1iqq_Kh8thRAAH1QOTYzpo927.jpg

先停止mysqld服務:

[[email protected] htdocs]# service mysqld stop #關閉mysqld服務

Shutting down MySQL.. SUCCESS! #關閉成功

mysqld服務停止時,測試結果如下:

wKiom1iqrN7TB4z-AAHDr9lHinA412.jpg


4、安裝php擴充套件功能xcache,為PHP加速:

先下載xcache軟體,下載地址文章結尾有地址:

安裝步驟:

1、tar xf xcache-2.0.1.tar.gz

2、cd xcache-2.0.1

3、/usr/local/php/bin/phpize (必須在解壓縮目錄中執行該指令碼,以便能關聯對應的php程式)

4、./configure --enable-xcache --with-php-config=/usr/local/php/bin/php-config

5、make && make install

[[email protected] ~]# ls

anaconda-ks.cfg install.log php-5.4.23

apr-1.4.6 install.log.syslog php-5.4.23.tar.bz2

apr-1.4.6.tar.gz libmcrypt-2.5.8-9.el6.x86_64.rpm xcache-2.0.1.tar.gz

[[email protected] ~]# tar xf xcache-2.0.1.tar.gz

[[email protected] ~]# cd xcache-2.0.1

[[email protected] xcache-2.0.1]# pwd

/root/xcache-2.0.1

[[email protected] xcache-2.0.1]# /usr/local/php/bin/phpize #執行該指令碼載入xcache到php中

Configuring for:

PHP Api Version: 20100412

Zend Module Api No: 20100525

Zend Extension Api No: 220100525

[[email protected] xcache-2.0.1]#./configure --enable-xcache --with-php-config=/usr/local/php/bin

/php-config編譯xcache,--enable-xcache啟用xcache功能,--with-php-config指定php配置文件路徑 .........

checking for grep that handles long lines and -e... /bin/grep

checking for egrep... /bin/grep -E

checking for a sed that does not truncate output... /bin/sed

checking for cc... cc

..........

appending configuration tag "CXX" to libtool

configure: creating ./config.status

config.status: creating config.h

[[email protected] xcache-2.0.1]# make

............


See any operating system documentation about shared libraries for

more information, such as the ld(1) and ld.so(8) manual pages.

----------------------------------------------------------------------

Build complete.

Don't forget to run 'make test'.

[[email protected] xcache-2.0.1]# make install

Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-zts-20100525/

#提示安裝共享擴充套件在php庫擴充套件路徑中,該路徑後面配置xcache配置文件時需提供。

[[email protected] xcache-2.0.1]# mkdir /etc/php.d

[[email protected] xcache-2.0.1]# cp xcache.ini /etc/php.d/ #把xcache配置文件複製到php.d路徑中

[[email protected] xcache-2.0.1]# vim /etc/php.d/xcache.ini #編輯xcache配置文件,紅色部分為修改內容


wKioL1irl92h5BE8AAJnoiAMzDA275.jpg

wKiom1irmLnQH47IAAEhlQ0jp_Y136.jpg


其他選項預設設定即可,設定完後儲存退出,重啟httpd服務後,xcache才會生效。

[[email protected] xcache-2.0.1]# service httpd restart #重啟httpd服務,使得相關配置生效

停止 httpd: [確定]

正在啟動 httpd: [確定]

[[email protected] xcache-2.0.1]# vim /usr/local/apache/htdocs/index.php #編輯配置文件

wKiom1irmwyykEhhAAGImI8ks6w167.jpg

在客戶端訪問測試,xcache是否關聯成功:

wKioL1irnjzCyZdgAANH1q2Qcmc887.jpg



5、編譯安裝的httpad如何配置使用虛擬主機功能:

先在httpd主配置文件中,關閉中心主機,啟用virtualhost功能

[[email protected] xcache-2.0.1]# cd /etc/httpd/

[[email protected] httpd]# vim httpd.conf #編輯httpd主配置文件,修改內容如下圖,註釋中心主機配 置,啟用虛擬主機配置功能。

wKiom1irocOBHNgcAALcGBHQeuw812.jpg

wKiom1irocPAcnvpAAC70d4BHmo449.jpg

[[email protected] httpd]#vim extra/httpd-vhosts.conf

wKioL1iro_ngS55VAAIyCJlEjfc163.jpg

[[email protected] httpd]# vim httpd.conf #檢視httpd主配置文件是否啟用mod_log模組。

wKioL1irpJ6D_4tHAAE2wJ3agT4117.jpg

[[email protected] ~]# mkdir /web/www/{a.org,b.net} -pv #建立單獨的目錄存放網頁內容

mkdir: 已建立目錄 "/web/www"

mkdir: 已建立目錄 "/web/www/a.org"

mkdir: 已建立目錄 "/web/www/b.net"

[[email protected] httpd]#vim extra/httpd-vhosts.conf #編輯虛擬主機配置文件

日誌資訊格式:combined顯示更詳細資訊,common一般顯示資訊


wKiom1irq42Q4u3CAAOyiWE8cKk179.jpg

[[email protected] httpd]# mkdir /var/log/httpd #建立日誌目錄

[[email protected] httpd]# httpd -t #檢查httpd配置檔案是否有語法錯誤

Syntax OK

[[email protected] httpd]# service httpd restart #重啟httpd服務

停止 httpd: [確定]

正在啟動 httpd: [確定]


[[email protected] httpd]#vim extra/httpd-vhosts.conf #編輯虛擬主機配置文件,

明確定義可以允許訪問許可權.


wKiom1irr7HB1sP4AAL6Kgy4hO0255.jpg

儲存退出。

[[email protected] httpd]#httpd -t #檢查httpd配置檔案是否有語法錯誤

Syntax OK

[[email protected] httpd]#service httpd restart #重啟httpd服務

停止 httpd: [確定]

正在啟動 httpd: [確定]

通過客戶端瀏覽器訪問如下:

wKioL1irsFXDEJqaAADuQIKWHgs553.jpg

wKiom1irsFajoWy2AAEWwUh96Hc712.jpg

[[email protected] httpd]# cd /usr/local/apache

[[email protected] apache]# pwd

/usr/local/apache

[[email protected] apache]# ab -c 100 -n 1000 http://127.0.0.1/index.php#測試本機httpd伺服器的壓力測試 ,ab為apache自帶的一個壓力測試指令碼,-c:指併發數(即一次接受多少個請求)-n: 指請求總 數(總共接受多少個請求)

This is ApacheBench, Version 2.3 <$Revision: 1430300 $>

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)

Completed 100 requests

Completed 200 requests

Completed 300 requests

Completed 400 requests

Completed 500 requests

Completed 600 requests

Completed 700 requests

Completed 800 requests

Completed 900 requests

Completed 1000 requests

Finished 1000 requests


Server Software: Apache/2.4.4

Server Hostname: 127.0.0.1

Server Port: 80


Document Path: /index.php

Document Length: 53 bytes


Concurrency Level: 100

Time taken for tests: 0.288 seconds

Complete requests: 1000

Failed requests: 0

Write errors: 0

Total transferred: 239000 bytes

HTML transferred: 53000 bytes

Requests per second: 3472.81 [#/sec] (mean)

Time per request: 28.795 [ms] (mean)

Time per request: 0.288 [ms] (mean, across all concurrent requests)

Transfer rate: 810.55 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 6 13 3.8 12 24

Processing: 3 15 16.0 12 173

Waiting: 2 13 15.8 11 170

Total: 16 28 16.2 23 183

Percentage of the requests served within a certain time (ms)

50% 23

66% 27

75% 31

80% 34

90% 37

95% 41

98% 45

99% 136

100% 183 (longest request)


使用ab命令測試apache伺服器效能:

========================================================

-c concurrency: 一次性發起的請求格式,預設為1;

-i:測試時使用HEAD方法,預設為GET;

-k:啟用HTTP長連線請求方式;

-n requests:發起的模擬請求的總個數,預設為1個,請求數要大於等於併發連線數;

-q:靜默模式,在請求數大於150個時不輸出請求完成百分比;

輸出結果:

Time taken for tests: 從第一個請求連線建立到收到最後一個請求的響應保溫結束所經歷的時長;

Complete requests: 成功的請求數;


6、下載安裝phpMyAdmin軟體:下載地址文章結尾處有

[[email protected] ~]#ls

apr-util-1.4.1.tar.bz2 mysql-5.5.54-linux2.6-x86_64.tar.gz install.log

httpd-2.4.4 php-5.4.23 phpMyAdmin-4.0.10.19-all-languages.tar.gz

[[email protected] ~]# tar xf phpMyAdmin-4.0.10.19-all-languages.tar.gz -C /web/www/a.org

#-C指定加壓到那個目錄下

[[email protected] ~]# cd /web/www/a.org/

[[email protected] a.org]# mvphpMyAdmin-4.0.10.19-all-languages pma

[[email protected] a.org]# cd pma

[[email protected] pma]# mv config.sample.inc.php config.inc.php #修改名稱

[[email protected] pma]# openssl rand -base64 10 #通過openssl生成編碼為base64且長度為10的隨機數

TM9OWK5xzr9RKg==

[[email protected] pma]# vim config.inc.php #編輯phpMyAdmin的配置檔案,把剛生成的隨機數寫入,如下圖:

wKioL1ir6pKiRHQ-AAJ7VtiR7Qw302.jpg

[[email protected] pma]# mysqladmin -uroot password 'redhat' #給mysql的root使用者設定密碼,空密碼不允許登入phpmyadmin

[[email protected] pma]# mysqladmin -uroot -p flush-privileges #測試新設定的密碼是否正確有效

Enter password:

[[email protected] pma]#

在客戶端瀏覽器輸入地址測試是否能正常登入:

wKiom1ir7OnifKRjAAK87Q4QIws698.jpg

wKioL1ir7Ozxk1ppAAWx-FsbwoM618.jpg

測試訪問正常。


7、編譯安裝的apache如何實現ssl功能:

[[email protected] ~]# vim /etc/httpd/httpd.conf #編輯httpd配置文件,啟用ssl模組和功能

wKiom1ir9iTyw7sRAAF5dHh37mw244.jpg

wKioL1ir9iXj7MDLAAFZXY5x-dI375.jpg

[[email protected] ~]#vim /etc/httpd/extra/httpd-ssl.conf

wKioL1ir_SzRJJmpAAL7LrEHgVQ850.jpg

wKiom1ir_TaDbHw6AAO1r_ommno926.jpg

[[email protected] ~]# httpd -t #檢查httpd配置文件是否有語法錯誤

AH00526: Syntax error on line 76 of /etc/httpd/extra/httpd-ssl.conf:

SSLSessionCache: 'shmcb' session cache not supported (known names: ). Maybe you need to load the appropriate socache module (mod_socache_shmcb?). #提示需要開啟mod_socache模組

[[email protected] ~]#vim /etc/httpd/httpd.conf #編輯httpd配置文件,啟用mod_socache模組

wKioL1ir_cvS88e1AAFLHExMaXM718.jpg

[[email protected] ~]#httpd -t #再次檢查httpd配置文件是否有語法錯誤

AH00526: Syntax error on line 105 of /etc/httpd/extra/httpd-ssl.conf:

SSLCertificateFile: file '/etc/httpd/server.crt' does not exist or is empty #提示自簽證書檔案為空或者不存在,因為我們沒有建立自簽證書服務和生成金鑰。


8、登入第二臺伺服器做CA證書伺服器(10.109.134.236伺服器)並配置好:

[[email protected] ~]# cd /etc/pki

[[email protected] pki]# cd CA

[[email protected] CA]# pwd

/etc/pki/CA

[[email protected] CA]# (umask 077; openssl genrsa -out private/cakey.pem 2048)#生成私鑰;umask077表示生產私鑰許可權為600,genrsa證書加密格式,-out儲存路徑及檔名 2048私鑰長度

Generating RSA private key, 2048 bit long modulus

...............................................+++

.......+++

e is 65537 (0x10001)

[[email protected] CA]#vim /etc/pki/tls/openssl.cnf #編輯openssl配置檔案,紅色部分是更改的地方

[ req_distinguished_name ]

countryName = Country Name (2 letter code)

countryName_default =CN #國家

countryName_min = 2

countryName_max = 2


stateOrProvinceName = State or Province Name (full name)

stateOrProvinceName_default =Jiangsu #省份


localityName = Locality Name (eg, city)

localityName_default =Kunshan #城市

0.organizationName = Organization Name (eg, company)

0.organizationName_default =XueLinux #組織

# we can do this but it is not needed normally :-)

#1.organizationName = Second Organization Name (eg, company)

#1.organizationName_default = World Wide Web Pty Ltd

organizationalUnitName = Organizational Unit Name (eg, section)

organizationalUnitName_default=Tech #部門

[[email protected] CA]#vim /etc/pki/tls/openssl.cnf#修改CA證書路徑為絕對路徑

wKiom1h676eC0vHiAAHgYhvWdvg015.jpg

[[email protected] CA]#openssl req -new -x509 -key private/cakey.pem -out cacert.pem -days 3655 #跟據cakey.pem私鑰生成自簽證書cacert.pem,其他預設格式,-days是證書有效期(天)

wKiom1h67AKB0TOFAATM7FQMx7s077.jpg

[[email protected] CA]#mkdir certs crl newcerts #建立3個證書相關的目錄

[[email protected] CA]#touchindex.txt
[[email protected] CA]#echo01 > serial #下一個證書編號為01
[[email protected] CA]# ls #確保/etc/pki/CA目錄下有以下檔案及目錄
cacert.pemcertscrl index.txtnewcertsprivate serial


9、重新登入到httpd伺服器(10.109.134.237)端,進行相關私鑰的設定:

[[email protected] ~]#cd /etc/httpd

[[email protected] httpd]#ls

extra httpd.conf httpd.conf.bak magic mime.types original

[[email protected] httpd]#mkdir ssl #建立ssl目錄

[[email protected] httpd]#cd ssl/

[[email protected] ssl]#(umask 077; openssl genrsa 1024 > httpd.key) #生成私鑰檔案

Generating RSA private key, 1024 bit long modulus

.............................++++++

..............................................++++++

e is 65537 (0x10001)

[[email protected] ssl]#openssl req -new -key httpd.key -out httpd.csr #生成證書籤核請求

wKioL1h7DrSz6NG7AAXxJL7ufJk298.jpg

[[email protected] ssl]# ls

httpd.csr httpd.key

[[email protected] ssl]#scp httpd.csr10.109.134.236:/tmp #把生成的證書籤核請求檔案複製

到CA證書伺服器的/tmp目錄下

[email protected]'s password:

httpd.csr 100% 692 0.7KB/s 00:00


10、登入CA證書伺服器端(10.109.134.236),對生成的證書籤核請求進行籤核:

[[email protected] ~]# cd /tmp

[[email protected] tmp]# ls

httpd.csr lost+found

[[email protected] tmp]#openssl ca -in /tmp/httpd.csr -out /tmp/httpd.crt -days 3650 #籤核證書申請,並生成證書檔案httpd.crt,-days證書有效期,如提示以下錯誤,需修改配置檔案

wKioL1h7GBjgiKICAAJdYR-D2jM107.jpg

[[email protected] tmp]#cd /etc/pki/CA

[[email protected] CA]#vim /etc/pki/tls/openssl.cnf #修改配置檔案,具體如下圖,

全部修改為optional:

wKioL1h7GPPSsvJmAAFuC_aAxX0109.jpg

[[email protected] CA]#openssl ca -in /tmp/httpd.csr -out /tmp/httpd.crt -days 3650

wKioL1h7GbuhOMsxAAVyESYL5h8540.jpg[[email protected] CA]#cat index.txt #檢視籤核證書記錄檔案,已經生成一條證書籤核記錄

V270113063102Z01unknown/C=CN/ST=Jiangsu/O=XueLinux/OU=Tech/CN=hello.xuelinux.com/[email protected]

[[email protected] CA]#cat serial #檢視證書版本號,下一個證書號為02

02

[[email protected] CA]#scp /tmp/httpd.crt 10.109.134.237:/etc/httpd/ssl/#把籤核好的證書文 件httpd.crt從CA伺服器拷貝到httpd伺服器/etc/httpd/ssl/目錄下

The authenticity of host '10.109.134.249 (10.109.134.249)' can't be established.

RSA key fingerprint is 5c:ec:b4:96:87:ae:6a:f8:66:09:d9:7a:f8:39:21:ae.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '10.109.134.249' (RSA) to the list of known hosts.

[email protected]'s password:

httpd.crt 100% 3892 3.8KB/s 00:00 #拷貝完成

[[email protected] CA]#ls newcerts/ #檢視是否有生成證書的記錄01.pem生成的第一個證書記錄

01.pem

[[email protected] CA]# cd /tmp

[[email protected] tmp]# ls

httpd.crt httpd.csr

[[email protected] tmp]#rm -rf httpd.c* #需把臨時目錄下的證書檔案清除,以免被別人獲取

[[email protected] tmp]# ls


11、切換登入到httpd伺服器端(10.109.134.237),對ssl配置檔案進行修改:

[[email protected] ssl]# ls

httpd.crthttpd.csr httpd.key

[[email protected] ssl]#vim /etc/httpd/extra/httpd-ssl.conf #修改配置檔案httpd-ssl.conf,

如下圖位置需做修改:

wKioL1is4rLxJPXqAAUx85Nv08k168.jpg

wKioL1is4rTDsDziAAOTUYxlySk592.jpg

[[email protected] ssl]# httpd -t #檢查httpd配置檔案是否有語法錯誤

Syntax OK

[[email protected] ssl]#service httpd restart #重啟httpd服務

停止 httpd: [確定]

正在啟動 httpd: [確定]

[[email protected] ssl]#netstat -tlnp #檢視主機是否監聽了443埠

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name

tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 8787/mysqld

tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1646/sshd

tcp 0 0 :::80 :::* LISTEN 1871/httpd

tcp 0 0 :::443 :::* LISTEN 1871/httpd

至此httpd伺服器端和CA證書伺服器端配置完成。

客戶端沒有安裝證書的測試結果如下:

wKiom1is6AfQf7rpAAN2JNPU8W0560.jpg

把CA證書伺服器上生成的證書文件/etc/pki/CA/cacert.pem拷貝到客戶端後,並改名字尾名為

cacert.crt,然後點選安裝安裝證書至受信任機構中即可:

登入到CA證書伺服器(10.109.134.236)

[[email protected] CA]# lftp [email protected] #遠端連線ftp伺服器

口令:

lftp [email protected]:/> put /etc/pki/CA/cacert.pem #把cacert.pem證書上傳至ftp伺服器

1432 bytes transferred #傳輸完成

lftp [email protected]:/> ls cacert.pem #檢視ftp伺服器上是否已經上傳成功

-rw-rw-rw- 1 user group 1432 Feb 22 09:24 cacert.pem

修改後綴為,cacert.crt並點選安裝:

wKiom1is6nPQ48MGAASWR1mKxbw365.jpg

wKioL1is6mSxJvqUAAPk8B5nLFc525.jpg

安裝證書後,訪問測試結果如下:

如果安裝證書後訪問網站提示:You don't have permission to access / on this server.

需修改ssl配置文件的許可權設定,具體修改內容如下:

[[email protected] ~]#vim /etc/httpd/extra/httpd-ssl.conf

wKioL1itLMDip4TWAAIolDuKhSE585.jpg

wKioL1itLCLCTH0AAAGfr41HAHs742.jpg





apr-util-1.4.1.tar.gz下載地址:

http://download.chinaunix.net/download.php?id=36061&ResourceID=470

apr-1.4.6.tar.gz下載地址:

http://download.chinaunix.net/download.php?id=37842&ResourceID=470

httpd-2.4.4.tar.gz下載地址:

http://download.csdn.net/download/www476907899/5208979

mysql-5.5.54通用二進位制版本下載地址:

http://mirrors.sohu.com/mysql/MySQL-5.5/

php-5.4.23.tar.bz2下載地址:

http://mirrors.sohu.com/php/

libmcrypt-2.5.8.rpm下載地址:

http://rpm.pbone.net/index.php3/stat/4/idpl/15286582/dir/redhat_el_6/com/libmcrypt-2.5.8-9.el6.x86_64.rpm.html

libmcrypt-devel-2.5.8.rpm下載地址:

http://rpmfind.net/linux/rpm2html/search.php?query=libmcrypt-devel(x86-64)

mhash-devel-0.9.9-2.3.x86_64.rpm下載地址:

http://rpm.pbone.net/index.php3/stat/4/idpl/21892847/dir/centos_6/com/mhash-devel-0.9.9-2.3.x86_64.rpm.html

mhash-0.9.9-2.3.x86_64.rpm下載地址:

http://rpm.pbone.net/index.php3/stat/4/idpl/21892845/dir/centos_6/com/mhash-0.9.9-2.3.x86_64.rpm.html

xcache-2.0.1.tar.gz下載地址:

http://xcache.lighttpd.net/wiki/Release-2.0.1

phpMyAdmin-4.0.10.19-all-languages.tar.gz下載地址:

https://www.phpmyadmin.net/

ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz下載地址:

http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz



其它下載連結 **************************************************************

1、Linux MySQL5.5原始碼安裝

http://www.cnblogs.com/ghsea/p/4264696.html

2、Linux環境下安裝zendoptimizer

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


3、ZendOptimizer-3.3.3 下載:

http://www.neatstudio.com/show-1038-1.shtml

ZendOptimizer-3.3.9 下載:

http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz (32位)

http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz (64位)

4、Zend Optimizer不支援php5.3的解決方案

http://284772894.iteye.com/blog/1920685



轉載於:https://blog.51cto.com/woyaoxuelinux/1898731