CENTOS 4.4
配置ZEUS,PHP5,MYSQL4.0
安装配置LINUX步骤
--为DZ,PW环境而搭建,实例教程
CENTOS+ZEUS+PHP+MYSQL
--Jason Fan 2006/8/10 16:00
2、用df -h命令查看各分区情况,做到心中有数
[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、确认编译环境是否健全
yum install gcc-c++
yum install libtool
yum install flex
yum install curl-devel
4、下载软件,后台让系统下载,我们做别的事情。
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、配置时区,服务
setup
时区
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 新起一行并且设置为添加状态 / i 当前位置添加状态
鼠标右键将剪贴板内容粘贴到ssh里面
按两次键盘右上角ESC键
:wq 保存退出
7、删除原系统中不需要之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服务器
安装使用yum install vsftpd
安装好后请进入setup确认每次开机会自启动该服务
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
则需要安装关联文件:
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 前面加#注释掉
保存退出
再执行一下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
在阅读版权处,按ctrl+C可以中止阅读转去下一步
Enter `accept' if you accept this license agreement: accept
输入accept,回车,表示接受版权
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]:
设置在启动的时候自启动,Y
停止zeus进行破解
/usr/local/zeus/stop-zeus #停止zeus
复制破解文件到安装目录
cp ../zeus.web /usr/local/zeus/web/bin/zeus.web
在系统提示覆盖的时候,按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
安装完系统缺少的rpm包后,继续安装
make
make install
先将原来zeus内置的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 #以后根据客人的网站目录给调整
最少要输入以上三项内容,再按底部的 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
进入权限处更改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"
执行以下命令
mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator