CENTOS 4.4
配置ZEUS,PHP5,MYSQL4.0
安裝配置LINUX步驟
--為DZ,PW環(huán)境而搭建,實例教程
CENTOS+ZEUS+PHP+MYSQL
--Jason Fan 2006/8/10 16:00
1、SSH進入服務(wù)器
2、用df -h命令查看各分區(qū)情況,做到心中有數(shù)
[root@server ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 7.7G 254M 7.1G 4% /
/dev/hda1 76M 20M 53M 28% /boot
none 506M 0 506M 0% /dev/shm
/dev/hda8 84G 33M 80G 1% /home
/dev/hda7 1012M 33M 928M 4% /tmp
/dev/hda6 7.7G 1.1G 6.3G 15% /usr
/dev/hda5 7.7G 105M 7.2G 2% /var
3、確認編譯環(huán)境是否健全
yum install gcc-c++
yum install libtool
yum install flex
yum install curl-devel
4、下載軟件,后臺讓系統(tǒng)下載,我們做別的事情。
cd /opt/
wget -c http://cq2.cn/soft/MySQL-client-4.0.27-0.i386.rpm http://cq2.cn/soft/MySQL-devel-4.0.27-0.i386.rpm http://cq2.cn/soft/MySQL-embedded-4.0.27-0.i386.rpm http://cq2.cn/soft/MySQL-server-4.0.27-0.i386.rpm http://cq2.cn/soft/MySQL-shared-compat-4.0.27-0.i386.rpm http://cq2.cn/soft/ZendOptimizer-3.2.2-linux-glibc21-i386.tar.gz http://cq2.cn/soft/Zeus_43_Linux.zip http://cq2.cn/soft/apf-current.tar.gz http://cq2.cn/soft/eaccelerator-0.9.5.tar.bz2 http://cq2.cn/soft/php-5.2.1.tar.bz2 http://cq2.cn/soft/phpMyAdmin-2.9.1.1-all-languages-utf-8-only.zip
5、配置時區(qū),服務(wù)
setup
時區(qū)
Timezone configuration / Asia/Chongqing
System services / isdn 空格取消
System services / pcmcia 空格取消
System services / vsftpd 空格添加,如果沒有這個選項,則要安裝,安裝步驟見后面
*表示選中
6、配置IP
ifconfig 查看主IP
vi /etc/rc.local
ifconfig eth0:0 205.209.176.118 netmask 255.255.255.0 up
ifconfig eth0:1 205.209.176.119 netmask 255.255.255.0 up
ifconfig eth0:2 205.209.176.120 netmask 255.255.255.0 up
ifconfig eth0:3 205.209.176.121 netmask 255.255.255.0 up
UNIX注意大小寫
G 移到文件末尾
o 新起一行并且設(shè)置為添加狀態(tài) / i 當前位置添加狀態(tài)
鼠標右鍵將剪貼板內(nèi)容粘貼到ssh里面
按兩次鍵盤右上角ESC鍵
:wq 保存退出
7、刪除原系統(tǒng)中不需要之rpm包,主要是httpd,php,mysql等用不到的。
1)通過rpm -qa | grep httpd查詢apache包
刪除掉查出來的rpm
rpm -e httpd-suexec-2.0.53-3.3 system-config-httpd-1.3.1-1 httpd-2.0.53-3.3
2)通過rpm -qa | grep mysql查詢mysql包
刪除掉查出來的rpm
rpm -e mysql-devel-3.23.58-16.FC3.1 mysql-3.23.58-16.FC3.1 libdbi-dbd-mysql-0.6.5-9 perl-DBD-MySQL-2.9003-5.i386 dovecot-0.99.13-3.FC3.i386 MyODBC-2.50.39-25.FC3.1.i386 MySQL-python-0.9.2-4.i386
3)通過rpm -qa | grep php查詢php包
8、配置FTP,使用vsftpd服務(wù)器
安裝使用yum install vsftpd
安裝好后請進入setup確認每次開機會自啟動該服務(wù)
vi /etc/vsftpd/vsftpd.conf
anonymous_enable=NO #YES=>NO
xferlog_file=/var/log/vsftpd.log
idle_session_timeout=600
data_connection_timeout=120
ftpd_banner=Welcome to FTP service.
chroot_local_user=YES #添加此句
按多次Esc鍵后,保存退出:wq!
service vsftpd start
Starting vsftpd for vsftpd: [ OK ]
9、安裝mysql 4.0.27
cd /opt/
rpm -ivh MySQL-* #自動安裝以MySQL-開頭的所有文件
如果出錯,
warning: MySQL-client-4.0.27-0.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
error: Failed dependencies:
perl(DBI) is needed by MySQL-client-4.0.27-0.i386
perl(DBI) is needed by MySQL-server-4.0.27-0.i386
Suggested resolutions:
/home/buildcentos/CENTOS/en/4.0/i386/CentOS/RPMS/perl-DBI-1.40-8.i386.rpm
則需要安裝關(guān)聯(lián)文件:
yum install perl-DBI
再進行rpm -ivh MySQL-* 安裝
配置my.cnf
cp /usr/share/mysql/my-large.cnf /etc/my.cnf
vi /etc/my.cnf
skip-bdb
skip-innodb
skip-locking
skip-networking
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
back_log=200
interactive_timeout=10
wait_timeout=2
connect_timeout=3
max_connections=300
max_connect_errors=1000
long_query_time=5
并且將#log-bin 前面加#注釋掉
保存退出
再執(zhí)行一下mysql命令,測試是否MYSQL啟動成功
用exit退出mysql客戶端
10、安裝zeus
cd /opt/
解壓 unzip Zeus_43_Linux.zip
cd Zeus_43_Linux
解壓 tar zxvf Zeus_43_Linux-x86.tgz
cd Zeus_43_Linux-x86
安裝zeus
sh zinstall
在閱讀版權(quán)處,按ctrl+C可以中止閱讀轉(zhuǎn)去下一步
Enter `accept' if you accept this license agreement: accept
輸入accept,回車,表示接受版權(quán)
Where should the product be installed? [/usr/local/zeus]:
安裝目錄使用默認的/usr/local/zeus,直接回車
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直接回車
Enter the key filename, or leave blank for unlicensed mode:
輸入license文件名字和位置 ../license.key 回車
Please choose a password for the admin server:
Re-enter:
輸入管理員密碼68609569
Enable SNMP support for web package? Y/N [N]:
這里輸入N,再回車
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 can be installed so that it automatically runs
when this computer boots.
Would you like Zeus to start at boot time? Y/N [Y]:
設(shè)置在啟動的時候自啟動,Y
停止zeus進行破解
/usr/local/zeus/stop-zeus #停止zeus
復制破解文件到安裝目錄
cp ../zeus.web /usr/local/zeus/web/bin/zeus.web
在系統(tǒng)提示覆蓋的時候,按Y確認覆蓋原文件
再啟動zeus即可 /usr/local/zeus/start-zeus
11、配置php 5.2.1
cd /opt/
./configure --prefix=/usr/local/libmcrypt
tar xjf php-5.2.1.tar.bz2
cd php-5.2.1
./configure --with-config-file-path=/usr/local/etc --enable-force-cgi-redirect --enable-inline-optimization --disable-debug --enable-fastcgi --with-zlib --enable-ftp --with-gd --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib-dir --with-ttf --enable-gd-native-ttf --enable-gd-jis-conv --with-mysql=/usr --with-iconv --enable-xml --enable-exif --with-gettext --enable-mbstring --with-mcrypt
出錯:
configure: error: xml2-config not found. Please check your libxml2 installation.
解決:yum install libxml2 和 yum install libxml2-devel
configure: error: libjpeg.(a|so) not found.
解決:yum install libjpeg-devel
configure: error: libpng.(a|so) not found.
解決:yum install libpng-devel
configure: error: freetype2 not found!
解決:yum install freetype-devel
安裝完系統(tǒng)缺少的rpm包后,繼續(xù)安裝
make
make install
先將原來zeus內(nèi)置的PHP文件改名一下
mv /usr/local/zeus/web/php/php /usr/local/zeus/web/php/php.old
再復制新的php文件到原來的目錄
cp sapi/cgi/php /usr/local/zeus/web/php/
配置php.ini
cp php.ini-dist /usr/local/etc/php.ini
vi /usr/local/etc/php.ini
register_globals = On #由Off => On
upload_max_filesize = 8M #2M => 8M
memory_limit = 64M
保存退出
12、配置zeus
http://205.209.141.141:9090/
輸入用戶名admin和安裝時候的密碼
點擊 Create a Virtual Server
在以下欄位分別輸入:
Virtual Server Name: 205.209.141.141
Host Name and Port: 205.209.141.141 port: 80
Document Root: /home #以后根據(jù)客人的網(wǎng)站目錄給調(diào)整
最少要輸入以上三項內(nèi)容,再按底部的 Create a Virtual Server 按鈕
建好第一個虛擬主機后,立即進行配置,以便支持PHP
File Upload no => yes (Enabling File Uploading / Enabled)
PHP no => yes (Enabling PHP Support / Enabled)
Directory Requests => Directory Listing => Disabled
再點頂部的:This configuration has been modified. Click here for details or to make it take effect.
commit提交它
Start這個虛擬主機站點,搞定
13、安裝zend 3
cd /opt
tar zxvf ZendOptimizer-3.2.2-linux-glibc21-i386.tar.gz
cd ZendOptimizer-3.2.2-linux-glibc21-i386
sh install
Are you using Apache Web server? 選擇NO
其他地方回車即可
14、配置phpmyadmin
cd /opt/
unzip phpMyAdmin-2.9.1.1-all-languages-utf-8-only.zip
cd phpMyAdmin-2.9.1.1-all-languages-utf-8-only
mkdir -p /home/admin/www/html/phpmyadmin
cp -R * /home/admin/www/html/phpmyadmin
cd /home/admin/www/html/phpmyadmin
vi libraries/config.default.php
$cfg['blowfish_secret'] = 'osh4n5l3s4';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
保存退出
http://205.209.141.141/phpmyadmin/
登入,初始密碼為空,用戶名是root
進入權(quán)限處更改root密碼
root localhost 這個最后改密碼
先改root另外一個用戶的密碼
12、安裝eaccelerator
cd /opt/eaccelerator-0.9.5.3
phpize
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/bin/php-config
make
make install
cd /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
vi /usr/local/lib/php.ini
添加入下面的信息到文件最末尾
extension="/usr/local/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
執(zhí)行以下命令
mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator