1、請描述一次完整的http請求處理過程;
a.向根域名服務器請求解析域名,然后根服務器返回相應的IP信息; b.用戶的Web瀏覽器向服務器端的80端口通過三次握手建立TCP連接; c.建立完TCP連接后發送HTTP請求,請求的格式包括請求方法、URL和協議版本號,方法有GET、HEAD、POST、PUT、DELETE、OPTIONS、TRACE,如: 起始行:如 GET / HTTP/1.0 (請求的方法 請求的URL 請求所使用的協議) 頭部信息:User-Agent Host等成對出現的值 主體 d.服務器向客戶端相應http的頭信息,客戶端收到后確認,然后http服務器發送數據; e.瀏覽器接收到數據后,解析數據并通過瀏覽器把畫面呈現給用戶; f.數據傳送完成后,四次斷開TCP連接;
2、httpd所支持的處理模型有哪些,他們的分別使用于哪些環境。
工作模型一共有三種:prefork、worker、event prefork:多進程模型,每個進程響應一個請求。一個主進程:負責生成n個子進程,子進程也稱為工作進程,每個子進程處理一個用戶請求;即便沒有用戶請求,也會預先生成多個空閑進程, 隨時等待請求到達;最大不會超過1024個; worker:多線程模型,每個線程響應一個請求;一個主進程:生成多個子進程,每個子進程負責生個多個線程,每個線程響應一個請求; event:事件驅動模型,每個線程響應n個請求;一個主進程:生成m個子進程,每個子進程直接響應n個請求; 適合的場景: perfork:它適合于沒有線程安全庫,需要避免線程兼容性問題的系統; worker:適合內存占用量比較小,適合高流量的http服務器。缺點是假如一個線程崩潰,整個進程就會連同其任何線程一起”死掉”; 總的來說,prefork方式速度要稍高于worker,然而它需要的cpu和memory資源也稍多于woker。
3、源碼編譯安裝LAMP環境(基于wordpress程序),并寫出詳細的安裝、配置、測試過程。
[root@Hao ~]# cd /usr/local/src [root@Hao src]# ls apr-1.5.2.tar.bz2 httpd-2.4.23.tar.bz2 php-5.5.38.tar.gz apr-util-1.5.4.tar.bz2 mysql-5.5.50-linux2.6-x86_64.tar.gz httpd2.4的版本需要新版的apr和apr-util,所以需要編譯安裝apr和apr-util [root@Hao src]# tar xf apr-1.5.2.tar.bz2 [root@Hao src]# cd apr-1.5.2 [root@Hao apr-1.5.2]# ./configure --prefix=/usr/local/apr [root@Hao apr-1.5.2]# make && make install [root@Hao apr-1.5.2]# cd .. [root@Hao src]# tar xf apr-util-1.5.4.tar.bz2 [root@Hao src]# cd apr-util-1.5.4 [root@Hao apr-util-1.5.4]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr [root@Hao apr-util-1.5.4]# make && make install
–prefix是指定安裝路徑 –with-apr是安裝apr-util時指定apr的安裝目錄
下面編譯安裝httpd
[root@Hao apr-util-1.5.4]# yum -y install pcre-devel [root@Hao apr-util-1.5.4]# yum -y install openssl-devel [root@Hao src]# tar xf httpd-2.4.23.tar.bz2 [root@Hao src]# cd httpd-2.4.23 [root@Hao httpd-2.4.23]# ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-modules=most --enable-mpms-shared=all --with-mpm=event [root@Hao httpd-2.4.23]# make && make install
修改httpd主配置文件,設置pid文件的路徑,編輯/etc/httpd/httpd.conf,添加內容如下:
PidFile "var/run/httpd.pid"
提供SysV服務腳本/etc/rc.d/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 serve \ # 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 killproc -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 $@ RETVAL=$? ;; *) echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}" exit 1 esac exit $RETVAL 然后給腳本執行權限: [root@Hao ~]# chmod +x /etc/rc.d/init.d/httpd [root@Hao ~]# chkconfig --add httpd [root@Hao ~]# service httpd start [root@Hao ~]# chkconfig httpd on
安裝mysql服務
[root@Hao ~]# groupadd -r mysql [root@Hao ~]# useradd -g mysql -r -s /sbin/nologin -M -d /mydata/data mysql [root@Hao ~]# chown -R mysql:mysql /mydata/data [root@Hao src]# tar xf mysql-5.5.50-linux2.6-x86_64.tar.gz [root@Hao src]# ln -sv mysql-5.5.50-linux2.6-x86_64 mysql "mysql" -> "mysql-5.5.50-linux2.6-x86_64" [root@Hao src]# cd mysql [root@Hao mysql]# chown -R mysql:mysql . [root@Hao mysql]# scripts/mysql_install_db --user=mysql --datadir=/mydata/data [root@Hao mysql]# chown -R root . 為mysql提供主配置文件[root@Hao mysql]# cp support-files/my-large.cnf /etc/my.cnf 并且修改復制后的文件內的CPU個數的配置,我用的虛擬機,所以CPU個數為1,修改為CPU個數*2即可 # Try number of CPU's*2 for thread_concurrency thread_concurrency = 2 為mysql提供sysv服務腳本 [root@Hao mysql]# cp support-files/mysql.server /etc/rc.d/init.d/mysqld [root@Hao mysql]# chmod +x /etc/rc.d/init.d/mysqld [root@Hao mysql]# chkconfig --add mysqld [root@Hao mysql]# chkconfig mysqld on
4、建立httpd服務器(基于編譯的方式進行),要求:
提供兩個基于名稱的虛擬主機:
(a)www1.stuX.com,頁面文件目錄為/web/vhosts/www1;錯誤日志為/var/log/httpd/www1.err,訪問日志為/var/log/httpd/www1.access;
(b)www2.stuX.com,頁面文件目錄為/web/vhosts/www2;錯誤日志為/var/log/httpd/www2.err,訪問日志為/var/log/httpd/www2.access;
(c)為兩個虛擬主機建立各自的主頁文件index.html,內容分別為其對應的主機名;
(d)通過www1.stuX.com/server-status輸出httpd工作狀態相關信息,且只允許提供帳號密碼才能訪問(status:status);
先創建幾個目錄和文件: mkdir /web/vhosts/www{1,2} -p touch /var/log/httpd/www{1,2}.{err,access}
編輯配置文件/etc/httpd/conf/httpd.conf
NameVirtualHost 192.168.0.130:80 <VirtualHost192.168.0.130:80> DocumentRoot /web/vhosts/www1 ServerName www1.stu31.com ErrorLog "/var/log/httpd/www1.err" CustomLog"/var/log/httpd/www1.access" combind <Location/server-status> /* SetHandler server-status Authtype Basic Authname "status area" 這部分是用戶認證配置 AuthUserFile /etc/httpd/users/.htpasswd Require valid-user </Location> */ </VirtualHost> <VirtualHost192.168.0.130:80> DocumentRoot /web/vhosts/www2 ServerName www2.stu31.com ErrorLog"/var/log/httpd/www2.err" CustomLog"/var/log/httpd/www2.access" combind </VirtualHost>
建立用戶訪問的認證文件:
# mkdir /etc/httpd/users # htpasswd-c -m /etc/httpd/users/.htpasswd status New password: Re-type newpassword: Adding passwordfor user status 然后重啟服務 # service httpd restart
5、為第4題中的第2個虛擬主機提供https服務,使得用戶可以通過https安全的訪問此web站點;
(1)要求使用證書認證,證書中要求使用的國家(CN)、州(HA)、城市(ZZ)和組織(MageEdu);
(2)設置部門為Ops,主機名為www2.stuX.com,郵件為admin@stuX.com;
(a).建立私有CA認證服務器: # cd /etc/pki/CA/ # (umask 077; openssl genrsa-out private/cakey.pem 2048) # openssl req -new -x509 -keyprivate/cakey.pem -out cacert.pem -days 3650 You are about to be asked to enterinformation that will be incorporated into your certificate request. What you are about to enter is what iscalled a Distinguished Name or a DN. There are quite a few fields but you canleave some blank For some fields there will be a defaultvalue, If you enter '.', the field will be leftblank. ----- Country Name (2 letter code) [XX]:CN State or Province Name (full name) []:HA Locality Name (eg, city) [Default City]:ZZ Organization Name (eg, company) [DefaultCompany Ltd]:Magedu Organizational Unit Name (eg, section)[]:Ops Common Name (eg, your name or your server'shostname) []:www2.stu31.com Email Address []:admin@stuX.com # touch index.txt # touch serial # echo 01 >serial (b).給http服務器生成證書 # mkdir /etc/httpd/certs # cd /etc/httpd/certs # (umask 077; opensslgenrsa -out httpd.key 2048) # openssl req -new -keyhttpd.key -out httpd.csr -days 3650 You are about to be asked to enterinformation that will be incorporated into your certificate request. What you are about to enter is what iscalled a Distinguished Name or a DN. There are quite a few fields but you canleave some blank For some fields there will be a defaultvalue, If you enter '.', the field will be leftblank. ----- Country Name (2 letter code) [XX]:CN State or Province Name (full name) []:HA Locality Name (eg, city) [Default City]:ZZ Organization Name (eg, company) [DefaultCompany Ltd]:Magedu Organizational Unit Name (eg, section)[]:Ops Common Name (eg, your name or your server'shostname) []:www2.stu31.com Email Address []:admin@stuX.com Please enter the following 'extra'attributes to be sent with your certificate request A challenge password []: An optional company name []: (c) 配置httpd服務使用數字證書 #CA服務器簽署請求證書 [root@www certs]# ls httpd.csr httpd.key [root@www certs]# openssl ca -in httpd.csr-out httpd.crt -days 3650 Using configuration from /etc/pki/tls/openssl.cnf Check that the request matches thesignature Signature ok Certificate Details: Serial Number: 1 (0x1) Validity Not Before: Dec 13 05:30:19 2014 GMT Not After : Dec 10 05:30:19 2024 GMT Subject: countryName = CN stateOrProvinceName = HA organizationName = stu31 organizationalUnitName = tech commonName =www2.stu31.com emailAddress = admin@stu31.com X509v3 extensions: X509v3 Basic Constraints: CA:FALSE Netscape Comment: OpenSSL Generated Certificate X509v3 Subject Key Identifier: 9A:84:73:63:C0:82:7F:45:21:9C:BA:2B:4C:FB:C3:87:7C:BA:63:58 X509v3 Authority Key Identifier: keyid:1C:57:C2:12:E4:D3:A6:4F:9A:7A:C6:53:7F:5B:7B:86:1E:75:0D:57 Certificate is to be certified until Dec 1005:30:19 2024 GMT (3650 days) Sign the certificate? [y/n]:y 1 out of 1 certificate requests certified,commit? [y/n]y Write out database with 1 new entries Data Base Updated (d)配置https服務器加密傳輸 針對Apache httpd軟件默認配置中: httpd軟件默認沒有使用ssl模塊,需要安裝相應的模塊程序包 [root@www certs]# yum install mod_ssl -y [root@www ~]# rpm -qa mod_ssl mod_ssl-2.2.15-39.el6.centos.x86_64 安裝之后會在/etc/httpd/conf.d/目錄下生成ssl.conf的配置文件,我們配置https就在此文件中配置: [root@www conf.d]# ls mod_dnssd.conf README ssl.conf welcome.conf 配置ssl.conf文件,重要配置都在下面文件中了: [root@www conf.d]#vim /etc/httpd/conf.d/ssl.conf LoadModule ssl_module modules/mod_ssl.so Listen 443 <VirtualHost 192.168.0.130:443> DocumentRoot"/web/vhosts/www2" ServerName www2.stuX.com:443 SSLEngineon SSLCertificateFile /etc/httpd/certs/httpd.crt SSLCertificateKeyFile /etc/httpd/certs/httpd.key </VirtualHost>
6、在LAMP架構中,請分別以php編譯成httpd模塊形式和php以fpm工作為獨立守護進程的方式來支持httpd,列出詳細的過程。
# yum -y install pcre-devel //先安裝好必要的,省的一會報錯 編譯安裝apr # tar xf apr-1.5.2.tar.bz2 # cd apr-1.5.2 # ./configure –prefix=/usr/local/apr # make && make install 編譯安裝apr-util # tar xf apr-util-1.5.4.tar.bz2 # cd apr-util-1.5.4 # ./configure –prefix=/usr/local/apr-util –with-apr=/usr/local/apr # make && make install 編譯httpd: # tar xf httpd-2.4.23.tar.bz2 # cd httpd-2.4.23 # ./configure –prefix=/usr/local/apache –sysconfdir=/etc/http24 –enable-so –enable-modules=most –enable-mods-shared=most –# enable-proxy –enable-proxy-fcgi –enable-mpms-shared=all –enable-cgi –with-apr=/usr/local/apr –with-apr-util=/usr/local/apr-util –with-z –with-ssl –with-mpm=event –enable-rewrite # make && make install 編輯配置文件vim /etc/http24/httpd.conf,加入一下內容: DirectoryIndex index.php index.html AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
給http提供服務腳本
#!/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 serve \ # 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 killproc -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 $@ RETVAL=$? ;; *) echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}" exit 1 esac exit $RETVAL
然后把腳本加入服務中:
chmod +x /etc/init.d/httpd24 chkconfig –add httpd24 service httpd24 start
在192.168.0.131主機上安裝mariadb,二進制包安裝。
# tar zxvf mariadb-5.5.36-linux-x86_64.tar.gz # mv mariadb-5.5.36-linux-x86_64 /usr/local/ # ln -sv /usr/local/mariadb-5.5.36-linux-x86_64 /usr/local/mysql # `/usr/local/mysql' -> `/usr/local/mariadb-5.5.36-linux-x86_64' # mkdir /etc/mysql # cp /usr/local/mysql/support-files/my-large.cnf /etc/mysql/my.cnf 編譯這個配置文件,加入 datadir=/data 然后,我們需要創建這個數據庫的數據目錄: # mkdir /data # groupadd -r mysql # useradd -r -g mysql mysql # chown mysql:mysql /data # cd /usr/local/mysql # chown -R mysql:mysql ./ 然后,我們就要進行數據庫的初始化: # ./scripts/mysql_install_db –user=mysql –datadir=/data –basedir=/usr/local/mysql 我們要為數據庫提供服務腳本: # cp support-files/mysql.server /etc/init.d/mysqld 把這個腳本放到服務腳本中去: # chmod +x /etc/init.d/mysqld # chkconfig –add mysqld # service mysqld start
修改mysql的PATH環境變量
# vim /etc/profile.d/mysql.sh 內容如下: export PATH=/usr/local/mysql/bin:$PATH
# mysql Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 2 Server version: 5.5.36-MariaDB-log MariaDB Server Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> 表明我們已經可以用mysql客戶端登進服務器端了,我們為了等一下的測試先創建一個用戶: MariaDB [(none)]> grant all on *.* to 'liang'@192.168.0.131 identified by 'liang'; Query OK, 0 rows affected (0.01 sec) MariaDB [(none)]> flush privileges; Query OK, 0 rows affected (0.00 sec) 然后,我們可以退出了!
切換到192.168.0.130的php服務器上:
# yum install -y libxml2-devel # yum -y install bzip2-devel libmcrypt-devel # tar xf php-5.4.19.tar.bz2 # cd php-5.4.19 # ./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache/bin/apxs –with-config-file-path=/etc –with-config-file-scan-dir=/etc/php.d –with-libxml-dir=/usr –with-zlib –with-bz2 –enable-xml –with-jpeg-dir –with-png-dir –with-freetype-dir –enable-mbstring –with-mcrypt –enable-sockets –with-mysql=mysqlnd –with-mysqli=mysqlnd –with-pdo-mysql=mysqlnd –enable-maintainer-zts # cp php.ini-production /etc/php.ini # vim /usr/local/apache/htdocs/index.php 內容如下: <?php phpinfo(); ?> <?php $con=mysql_connect('192.168.236.129','bwei','bwei'); if($con) echo "ok!!"; else echo "false!!"; mysql_close(); ?>
我們給php解析器加上組件xcache,先編譯xcache: # tar xf xcache-3.1.0.tar.bz2 # cd xcache-3.1.0 # /usr/local/php/bin/phpize Configuring for: PHP Api Version: 20100412 Zend Module Api No: 20100525 Zend Extension Api No: 220100525 這是為了xcache提供configure文件。 # ./configure –enable-xcache –with-php-config=/usr/local/php/bin/php-config –sysconfdir=/etc/php.d # make && make install 安裝后,會出現這個 Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-zts-20100525/ 我們把這個路徑復制一下,然后,把這個路徑下的模塊寫到xcacahe的配置文件下: # mkdir /etc/php.d # cp xcache.ini /etc/php.d/ # vim /etc/php.d/xcache.ini 修改下面項: extension =/usr/local/php/lib/php/extensions/no-debug-zts-20100525/xcache.so 重啟一下服務器:service httpd24 restart 然后,我們在上面安裝一個phpadmin: # unzip phpMyAdmin-4.0.5-all-languages.zip # mv phpMyAdmin-4.0.5-all-languages /usr/local/apache/htdocs/phpadmin # cd /usr/local/apache/htdocs/phpadmin/ 提供phpadmin的配置文件: # cp config.sample.inc.php config.inc.php 編輯這個配置文件,修改這一項: $cfg['Servers'][$i]['host'] = '192.168.236.129';
基于fpm的PHP
http服務器:192.168.0.130;php解析器 mysql服務器:192.168.0.131
cp sapi/fpm/init.d.php-fpm /etc/init.d/fpm chmod +x /etc/init.d/fpm chkconfig –add fpm 給php解析器提供配置文件: cp php.ini-production /etc/php.ini 為fpm提供服務配置文件: cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf 編輯這個配置文件,修改以下幾項: listen = 192.168.236.129:9000 pm.max_children = 30 pm.start_servers = 5 pm.min_spare_servers = 5 pm.max_spare_servers = 8 啟動服務:service fpm start ss -tnlp 查看服務是否開啟: users:(("master",1947,12)) LISTEN 0 128 192.168.0.131:9000 *:* users:(("php-fpm",122099,7),("php-fpm",122100,0),("php-fpm",122101,0),("php-fpm",122102,0),("php-fpm",122103,0),("php-fpm",122104,0)) 好了,我們再為php解析器提供xcache: tar xf xcache-3.1.0.tar.bz2 cd xcache-3.1.0 # /usr/local/php/bin/phpize Configuring for: PHP Api Version: 20100412 Zend Module Api No: 20100525 Zend Extension Api No: 220100525 這是為了xcache提供configure文件。 ./configure –enable-xcache –with-php-config=/usr/local/php/bin/php-config –sysconfdir=/etc/php.d make && make install Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/ 我們把這個路徑復制一下,然后,把這個路徑下的模塊寫到xcacahe的配置文件下: mkdir /etc/php.d cp xcache.ini /etc/php.d/ vim /etc/php.d/xcache.ini 修改下面項: extension =/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/xcache.so 重啟一下服務: service fpm restartservice fpm restart 配置http主機(192.168.0.130) vim /etc/http24/httpd.conf 把這項注釋(表示不啟用php解析器作為http功能里): #LoadModule php5_module modules/libphp5.so 把下面的功能啟動: LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so 然后在后面的配置文件中增加以下配置: ProxyRequests Off ProxyPassMatch ^/(.*\.php)$ fcgi://192.168.0.131:9000/php/$1 切換到php解析器的主機,為這個主機提供phpadmin作為測試: mkdir /php mv phpMyAdmin-4.0.5-all-languages /php/phpadmin cd /php/phpadmin/ 提供phpadmin的配置文件: cp config.sample.inc.php config.inc.php
原創文章,作者:Net19_口香糖,如若轉載,請注明出處:http://www.www58058.com/30854
寫的很好,排版還可以在漂亮一點,加油,都出界了