歡迎您光臨本站 註冊首頁

LinuxAS3+MySQL+PHP+Zeus+ZO+ZPS安裝筆記

←手機掃碼閱讀     火星人 @ 2014-03-24 , reply:0

這篇東東不少是借鑒的Crossday的文章。
Zeus 4.3+php+Zend Optimizer for Linux安裝指南(第二版) ,但是針對實際情況和有一些講的不詳細的地方做了優化。
具體軟體的版本為(順序即為安裝順序):




RedHatAS3

MySQL

Zeus4.3

PHP 4.3.10

ZO 2.5.7

ZPS 3.6



我會把具體的配置寫在這裡:
Step1:

安裝RedhatAS3,沒什麼好說的,只要注意安裝過程中選擇軟體包的那一段留一個Xwindow和一個DevelopmentTools就可以了。XWindow可能有用,DevelopmentTools是用來編譯後來的軟體用的。記得選擇一個簡體中文,不然後來沒法顯示中文實在是很麻煩。就是這樣安裝也需要1.5G的空間,我真是服了。這個地方需要注意的是具體分區的配置,似乎可以把swap分區或者log分區單獨列出來?不是很清楚。
另外當中的防火牆設定最好設為無,否則後來的Zeus管理需要用到9090埠。


Step2,MySQL,Linux (x86, glibc-2.2, static, gcc) Standard 4.1.8

從FTP上下載MySQL
CODE: [Copy to clipboard]
--------------------------------------------------------------------------------

ftp 192.168.100.2
get mysql-standard-4.1.8-pc-linux-i686.tar.gz
解壓縮,說明一下,tar -xvzf可以直接解壓縮tar.gz的文件
CODE: [Copy to clipboard]
--------------------------------------------------------------------------------

tar -xvzf mysql-standard-4.1.8-pc-linux-i686.tar.gz
編譯方法:
很奇怪居然沒有要求我編譯?

這個是因為我下載的版本是二進位的包版本。下載一個源碼版本就可以了。


Quote:
NOTE: This is a MySQL binary distribution. It's ready to run, you don't
need to configure it!

To help you a bit, I am now going to create the needed MySQL databases
and start the MySQL server for you. If you run into any trouble, please
consult the MySQL manual, that you can find in the Docs directory.

Installing all prepared tables
041230 5:48:16 [Warning] Asked for 196608 thread stack, but got 126976
Fill help tables
041230 5:48:16 [Warning] Asked for 196608 thread stack, but got 126976

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 bbsback password 'new-password'
See the manual for more instructions.

NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run
the ./bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!

You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the ./bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com
Starting the mysqld server. You can test that it is up and running
with the command:
./bin/mysqladmin version
[root@bbsback mysql-standard-4.1.8-pc-linux-i686]# chown: `mysql': invalid user
A mysqld process already exists



先不管它。到時候用phpMyAdmin來管理。

現在開始安裝Zeus,版本4.3
繼續連上ftp,下載三個文件:
CODE: [Copy to clipboard]
--------------------------------------------------------------------------------

get Zeus_43_Linux-x86.tar
get license.key
get zeus.web
解壓縮
CODE: [Copy to clipboard]
--------------------------------------------------------------------------------

tar -xzvf Zeus_43_Linux-x86.tar
cd Zeus_43_Linux-x86
./zinstall
Ctrl+C,然後輸入accept同意協議,

回車,默認裝在[/usr/local/zeus]目錄下


Quote:
Installation options:

1. Full install of both admin server & web server
2. Stand-alone install of admin server
3. Clustered install of web server
H. Help

Choose installation option [1]: 1



選擇安裝1,全部安裝

輸入key文件地址:
CODE: [Copy to clipboard]
--------------------------------------------------------------------------------

/root/tmp/src/license.key
輸入管理員密碼


Quote:
Please choose a password for the admin server:
Re-Enter



不允許SNMP


Quote:
Enable SNMP support for web package? Y/N [N]:



用Nobody用戶/用戶組執行


Quote:
Choose a UNIX user for the web process to run as [nobody]:
Choose a UNIX group for the web process to run as [nobody]:



允許開機運行Zeus


Quote:
Would you like Zeus to start at boot time? Y/N [Y]:



破解
CODE: [Copy to clipboard]
--------------------------------------------------------------------------------

cp -f /root/tmp/src/zeus.web /usr/local/zeus/web/bin
直接複製之後有點問題,需要手動把這個文件許可權改成755(這一步並不是每次都會遇到。在as3上遇到了。奇怪)
CODE: [Copy to clipboard]
--------------------------------------------------------------------------------

chomod 755 /usr/local/zeus/web/bin/zeus.web
Step3,PHP 4.3.10
ftp上搞一個php下來:


Quote:
get php-4.3.10.tar.gz
tar -xvzf php-4.3.10.tar.gz
cd php-4.3.10



編譯,php安裝在 /usr/local/php,php.ini文件在/etc


Quote:
./configure --prefix=/usr/local/php --enable-fastcgi --enable-force-cgi-redirect --with-config-file-path=/etc --with-zlib --with-mysql --with-xml



安裝,並且拷貝php.ini文件


Quote:
make
make install
cp php.ini-dist /etc/php.ini



安裝ZendOptimize 2.5.7


Quote:
./install.sh --zeus
確認php.ini文件位置時輸入/etc



去掉Zeus自帶的PHP


Quote:
rm /usr/local/zeus/php/php.zeus



給剛做的PHP一個鏈接


Quote:
ln -s /usr/local/php/bin/php /usr/local/zeus/php/php.zeus



安裝ZPS
具體的操作就不多說了。注意以下幾點:


Quote:


ZPS安裝參數需要是./install.sh --zeus

ZPS安裝的時候需要license,目前掌握的license是一個*.dat文件,記得把它改成*.lic文件放到ZPS的安裝目錄下。

ZPS的/zend/etc/cache.ini這個文件和上級文件加都需要設置為777屬性








2005-11-5 19:57

sup
管理員





積分 1432
發帖 1309
註冊 2005-6-6
#2

安裝linux下zeus+zps+zeo+mysql+php手記
Posted by AsIwish in [技術文章] at 2005-07-11 19:51:23
其實也沒什麼 不過安裝zps的時候dat文件遇到了一些問題
後來反覆替換怎麼就好了 我至今還不知道
主要是mysql的幾個問題 需要記下
還有高春輝提醒的 裝了Zend Performance Suite3.6.0之後
它會用自帶的2.1.1的zo替代原來你的zo版本
所以還要重新裝一次ZO就可以了


Quote:



一般情況下都是不能正常鏈接資料庫,錯誤提示一般為:

ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

其實網上大家問的最多的都是整個問題,說什麼鏈接不到mysqld.sock,其實大家不妨看看mysql的錯誤日誌就明白怎麼回事,我這裡的錯誤日誌是在

/var/lib/mysql/*.err 你會發現mysql只所以不能啟動,是因為/var/lib/mysql的許可權不允許mysql服務訪問,英文mysql默認是調用mysql用戶來啟動服務的,好了,既然知道是什麼原因找到不能啟動,那就簡單了。我們只要

chown -R mysql:mysql /var/lib/mysql 就行,如果還是啟動不了,再慢慢調試許可權,反正一般啟動不了都是許可權的問題。

如果大家還是不能啟動不了的話,那就用我的比較繁瑣的許可權的設置,反正我每次都是這麼做的,一般不會有問題,見下:

chown -R root /usr/local/mysql
chgrp -R mysql /usr/local/mysql
chown -R root /usr/local/mysql/bin
chgrp -R mysql /usr/local/mysql/bin
chgrp -R mysql /var/lib/mysql
chmod 777 /var/lib/mysql
chown -R root /var/lib/mysql/mysql
chgrp -R mysql /var/lib/mysql/mysql
chmod 777 /var/lib/mysql/mysql
chown -R root /var/lib/mysql/mysql/*
chgrp -R mysql /var/lib/mysql/mysql/*
chmod 777 /var/lib/mysql/mysql/*
chmod 777 /usr/local/mysql/lib/mysql/libmysqlclient.a




幾點可能要注意的:
my.cnf等文件在/usr/share/mysql

如果mysql目錄裡面有沒有mysql.sock
在mysql的shell裡面運行
mysql_install_db --user=mysql
同時最後要做一個符號連接
執行ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
參考文章 只看來他mysql的許可權部分 寫的不錯


Quote:




原文地址:http://www.5ilinux.com/lamp01.html


Linux+Apache+Mysql+PHP典型配置

調試環境:Redhat9.0 Apache1.3.29 Mysql3.23.58 PHP4.3.4

Linux系統的安裝我就不講了,這是基本功,其實這篇文章在類似Redhat的其他linux也應該通用,大家只要掌握我提供的方法就行。記得安裝Redhat9。0的時候不要安裝系統默認的apache,mysql和php以及相關的軟體。已經安裝的請用rpm -e * 刪除已經安裝的包。

1.安裝Mysql3.23.58

其實老實說直接安裝Mysql官方網站提供的rpm包也是一個比較可行的辦法,他的官方網站的rpm包的提供基本跟tar包發行是同步的,這點我比較喜歡,至少安裝rpm包的在後面的調試中不會出現mysql庫文件找不到的情況。但這裡還是有必要講一下自定義安裝的步驟,畢竟網友自定義安裝的還說挺多的。

軟體獲取:http://www.mysql.com/downloads/index.html

安裝步驟:

tar zxvf mysql-3.23.58.tar.gz
cd mysql-3.23.58

./configure --prefix=/usr/local/mysql --sysconfdir=/etc --localstatedir=/var/lib/mysql

make

make install

#prefix=/usr/local/mysql mysql安裝的目標目錄

#sysconfdir=/etc my.ini配置文件的路徑

#localstatedir=/var/lib/mysql 資料庫存放的路徑

安裝完以後要初始化資料庫,當然你是升級的話不用做這步;

/usr/local/mysql/bin/mysql_install_db


如果系統沒有mysql這個用戶的話,最好做以下這步:

useradd -M -o -r -d /var/lib/mysql -s /bin/bash -c "MySQL Server" -u 27 mysql

然後我啟動mysql

/usr/local/mysql/bin/safe_mysqld &

ok,先看看mysql能否正常工作

mysql -uroot mysql

一般情況下都是不能正常鏈接資料庫,錯誤提示一般為:

ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

其實網上大家問的最多的都是整個問題,說什麼鏈接不到mysqld.sock,其實大家不妨看看mysql的錯誤日誌就明白怎麼回事,我這裡的錯誤日誌是在

/var/lib/mysql/*.err 你會發現mysql只所以不能啟動,是因為/var/lib/mysql的許可權不允許mysql服務訪問,英文mysql默認是調用mysql用戶來啟動服務的,好了,既然知道是什麼原因找到不能啟動,那就簡單了。我們只要

chown -R mysql:mysql /var/lib/mysql 就行,如果還是啟動不了,再慢慢調試許可權,反正一般啟動不了都是許可權的問題。

如果大家還是不能啟動不了的話,那就用我的比較繁瑣的許可權的設置,反正我每次都是這麼做的,一般不會有問題,見下:

chown -R root /usr/local/mysql
chgrp -R mysql /usr/local/mysql
chown -R root /usr/local/mysql/bin
chgrp -R mysql /usr/local/mysql/bin
chgrp -R mysql /var/lib/mysql
chmod 777 /var/lib/mysql
chown -R root /var/lib/mysql/mysql
chgrp -R mysql /var/lib/mysql/mysql
chmod 777 /var/lib/mysql/mysql
chown -R root /var/lib/mysql/mysql/*
chgrp -R mysql /var/lib/mysql/mysql/*
chmod 777 /var/lib/mysql/mysql/*
chmod 777 /usr/local/mysql/lib/mysql/libmysqlclient.a



做完上面的步驟,然後把你編譯目錄的一個腳本COPY過去

cp support-files/mysql.server /etc/rc.d/init.d/mysqld

chkconfig --add mysqld

用ntsysv設置使mysql每次啟動都能自動運行。

好了,至此mysql安裝完畢,你可以這樣起動你的mysql服務

/etc/rc.d/init.d/mysqld start

下面這步比較關鍵,

ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql
ln -s /usr/local/mysql/include/mysql /usr/include/mysql

大家可以不做這步,大可以在編譯其他軟體的時候自定義myslq的庫文件路徑,但我還是喜歡把庫文件鏈接到默認的位置,這樣你在編譯類似PHP,Vpopmail等軟體時可以不用指定mysql的庫文件地址。

2.安裝Apache1.3.29。我沒有選擇安裝Apache2.0是我對他還是不放心,因為網上最新公布的apache的漏洞基本上是針對2.0,當然大家可以自己選擇安裝相應的版本。我這裡講的都是採用DSO動態編譯的方法編譯Apache.

至於有關apache的編譯方法,可以參考我以前的文章《apache的靜態/動態編譯在apache+php+mysql的應用》 http://www.5ilinux.com/apache01.html

軟體獲取:http://httpd.apache.org/

tar zvxf apache_1.3.29.tar.gz
cd apache_1.3.29
修改src/include/httpd.h 增大最大線程數

#define HARD_SERVER_LIMIT 256

改成

#define HARD_SERVER_LIMIT 2560

保存退出編譯apache


./configure --prefix=/usr/local/apache --enable-module=so --enable-module=rewrite --enable-shared=max --htdocsdir=/var/www &&
make &&
make install

#這裡我們通過enable-module參數告訴設置腳本,我們需要啟動so和rewrite模塊,so模塊是用來提DSO支持的apache核心模塊,而rewrite模塊則是用意實現地址重寫的模塊,由於rewrite模塊需要DBM支持,如果在初次安裝時沒有編譯進apache,以後需要用到時需要重新編譯整個apache才可以實現。為此除非你可以確定以後不會用到rewrite模塊,否則還是建議你在第一次編譯的時候把rewrite模塊編譯好。

enable-shared=max 這個參數的作用時編譯apache時,把除了so以外的所有apache的標準模塊都編譯成DSO模塊。而不是編譯進apache核心內。



好了安裝apache很簡單的哦,啟動apache看看

/usr/local/apache/bin/apachectl start

然後用ie看http://你的伺服器地址。應該能看到熟悉的apache羽毛標誌。

3.安裝PHP4.3.4

軟體獲取:http://www.php.net/downloads.php

tar zvxf php-4.3.4.tar.gz
cd php-4.3.4

./configure \
--prefix=/usr/local/php \
--with-mysql=/usr/local/mysql \
--enable-force-cgi-redirect \
--with-freetype-dir=/usr \
--with-png-dir=/usr \
--with-gd --enable-gd-native-ttf \
--with-ttf \
--with-gdbm \
--with-gettext \
--with-iconv \
--with-jpeg-dir=/usr \
--with-png \
--with-zlib \
--with-xml \
--enable-calendar \
--with-apxs=/usr/local/apache/bin/apxs

make

make install



#我這裡由於伺服器需要用到GD庫,所以加了一些支持GD的編譯參數 ,GD直接用了redhat自帶的GD庫,大家沒有安裝的話可以從安裝盤安裝,注意除了安裝GD以外,還要安裝libjpeg,libpng等庫文件。另外--with-mysql=/usr/local/mysql指向你安裝mysql的路徑。--with-apxs指向apache的apxs文件的路徑。

vi /usr/local/apache/conf/httpd.conf

查找

在此範圍添加

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps



然CPOPY PHP的配置文件

cp ../php4.3.4/php.ini.dist /usr/local/php/lib/php.ini

修改php.ini文件
register_globals = On


ok!重新啟動一下apache伺服器
/usr/local/apache/bin/apachectl restart

然後寫個php測試頁info.php:內容如下

phpinfo();
?>

正常的話,應該能看到php的信息了,恭喜你的Apche+Mysql+PHP安裝成功。



好了寫了這麼多,希望對大家有所幫助!!!





還有就是大C的老版了


Quote:



Zeus 4.3+php+Zend Optimizer for Linux安裝指南(第二版)

之前我曾寫過Zeus 4.2及PHP/ZO在Linux下的安裝,目前Zeus已升級到4.3版本,加入了對Local FastCGI的類似suexec的支持,可謂一大增強。
本文基於linux而寫出。zeus是一個著名的web伺服器軟體,其效能遠在apache1/2之上,是整台伺服器用戶跑論壇的首選,對內存小於1G而流量非常大的用戶,換用zeus會比apache多獲得一倍的負載能力。
本文提供方法在redhat linux AS3,PHP 4.3.9,Zend Optimizer 2.5.5驗證通過,所配置參數為適應每15分鐘在線1000人以上的,使用Discuz! 2.0/3.0的中大型論壇所優化

上篇文章中我們使用Remote FastCGI的方式,通過調用8002埠實現Zeus+PHP的搭建,本文為了充分實現Zeus 4.3所具有的suexec功能,將把PHP安裝為Local方式。

進入一個目錄 如
cd /usr/local/src

找一個zeus 4.3 for linux的破解版本下載
wget http://download.discuz.net/Zeus_43_Linux-x86.tgz
wget http://download.discuz.net/Zeus_4.3_Linux_crack.zip

unzip Zeus_4.3_Linux_crack.zip #把破解包直接解壓在/usr/local/src
tar xvzf Zeus_43_Linux-x86.tgz

cd Zeus_43_Linux-x86/

開始安裝
./zinstall

按CTRL+C 打入accept

Where should the product be installed? [/usr/local/zeus]: 回車

Installation options:

1. Full install of both admin server & web server
2. Stand-alone install of admin server
3. Clustered install of web server
H. Help

Choose installation option [1]: 回車

Enter the key filename, or leave blank for unlicensed mode: /usr/local/src/license.key (這裡的 key 是假的,真正的破解在之後覆蓋二進位程序中進行)

Please choose a password for the admin server: ****** (輸入管理員密碼)
Re-enter: ****** (重新輸入密碼)

Would you like Zeus to start at boot time? Y/N [Y]: (回車)

以上是安裝過程 很容易的就裝好了 下面進行破解
cp -f /usr/local/src/zeus.web /usr/local/zeus/web/bin

如果有apache在跑 先把他停掉 避免80埠衝突
/usr/local/apache/bin/apachectl stop

安裝php

cd /usr/local/src
感覺澳大利亞的會快一點(實際 200K/s 左右)
wget http://www.php.net/get/php-4.3.9.tar.gz/from/au.php.net/mirror
tar xvzf php-4.3.9.tar.gz
cd php-4.3.9/
./configure --prefix=/usr/local/php --enable-fastcgi --enable-force-cgi-redirect --with-config-file-path=/etc --with-zlib --with-mysql --with-xml
make
make install
cp php.ini-dist /etc/php.ini

安裝Zend Optimizer
cd /usr/local/src
wget http://download.discuz.net/ZendO ... glibc21-i386.tar.gz
tar xvzf ZendOptimizer-2.5.5-linux-glibc21-i386.tar.gz
cd ZendOptimizer-2.5.5-linux-glibc21-i386
./install.sh
一陣回車 問Confirm the location of your php.ini file的時候打入/etc
問Are you using Apache web server?的時候選No

下面把Zeus自帶的PHP換掉
rm /usr/local/zeus/php/php.zeus

給剛剛編譯的PHP做一個符號連接
ln -s /usr/local/php/bin/php /usr/local/zeus/php/php.zeus

設置Zeus
訪問 http://your.com:9090 (你的域名地址或IP地址)
用戶名 admin 密碼:剛才設定的密碼

進入Zeus管理控制台,點Create a Virtual Server 把相關的六個選項填好 不多說
注意:1. 指向的web目錄要有許可權讀 2. 如果在 Host Name and Port 寫域名,請確定該域名是綁定到當前IP的,否則請填寫當前伺服器IP地址

進入剛剛加入的virtual server,點Third Party中的PHP
Enabling PHP Support:選 Enabled

將 Specify the maximum number of PHP processes that should be created for each user:
由默認的 8 改為 5

將 Specify the maximum number of requests that an individual PHP process should handle. This prevents errant PHP processes from consuming too much memory.
由默認的 500 改為 200

其實這樣仍然能夠相應 5*200=1000個併發PHP請求了,足矣。
Apply Changes,然後點上面的 This configuration has been modified. Click here for details or to make it take effect.
然後 Commit

點左邊Url Handling下面的Directory Requests
Index Files中的內容為 index.html, index.htm, index.shtml, index.cgi, index.php
如果不需要 index.shtml, index.cgi,可以將其去掉
!!重要!!下面的 Directory Listing,一定要Disabled,不然有安全問題。

回到Zeus的9090埠管理界面 把剛才設置的虛擬主機Start,放一個 phpinfo 進去,應該已經可以看到PHP裝好了。

啟動Zeus的命令為 /usr/local/zeus/start-zeus
停止Zeus的命令為 /usr/local/zeus/stop-zeus
重啟Zeus的命令為 /usr/local/zeus/restart-zeus

如果安裝的時候沒有設定讓Zeus開機自動啟動,可編輯/etc/rc.local
加入一行
/usr/local/zeus/start-zeus
使得Zeus在開機時自動運行

今晚還有點時間,如果有興趣,可以接著按下面的步驟裝ZPS(Zend Performance Suite)。
cd /usr/local/src
wget http://download.discuz.net/ZendP ... glibc21-i386.tar.gz

下載一個可用的密匙
wget http://download.discuz.net/zend_performance_suite.dat

解壓並安裝
tar xvzf ZendPerformanceSuite-3.6.0-Linux_glibc21-i386.tar.gz
cd ZendPerformanceSuite-3.6.0-Linux_glibc21-i386
./install.sh --zeus

Search for a license file on my disk
輸入剛才下載的key位置 /usr/local/src
剩下他自動給的參數都是對的,只要一路回車就可以

/usr/local/zeus/restart-zeus 重啟一下 ZPS應該就裝好了

事實上這次升級,Zeus 4.3+PHP這個組合最閃亮的地方在於FastCGI的許可權設定,在虛擬主機的FastCGI設置中,具備了如下選項:
Owner of the requested file
Owner of the FastCGI executable
Owner of the document root
Specified uid / gid:
我們可以輕鬆的指定PHP運行的用戶,配合php.ini中open_base限定到用戶目錄(如/home),可徹底解決Zeus 4.2中的FastCGI許可權問題。

[火星人 ] LinuxAS3+MySQL+PHP+Zeus+ZO+ZPS安裝筆記已經有583次圍觀

http://coctec.com/docs/linux/show-post-133954.html