Mysql安装
fetch ftp://mysql.byungsoo.net/pub/mysql/Downloads/MySQL-4.0/mysql-4.0.22.tar.gz
tar -xf mysql-4.0.22.tar.gz
./configure --prefix=/usr/local/mysql --localstatedir=/var/db/mysql
make
make install
pw groupadd mysql
pw useradd mysql -g mysql
./scripts/mysql_install_db --user=mysql
chown -R root /usr/local/mysql
chown -R mysql /var/db/mysql
chown -R mysql /var/db/mysql/.
chown -R mysql /usr/local/mysql/bin
chmod 770 /var/db/mysql
chmod 770 /var/db/mysql/mysql
chmod 770 /var/db/mysql/mysql/*
chmod 770 /usr/local/mysql/lib/mysql/libmysqlclient.a
/usr/local/mysql/bin/mysqld_safe --user=mysql
Apache安装
fetch http://archive.apache.org/dist/httpd/apache_1.3.33.tar.gz
修改ee ./src/include/httpd.h
256=>3000
./configure --prefix=/usr/local/www --enable-module=rewrite --enable-module=so --disable-module=cgi
make
make install
/usr/local/www/bin/apachectl start
ee /usr/local/www/conf/httpd.conf
PHP安装
./configure --prefix=/usr/local --with-apxs=/usr/local/www/bin/apxs --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/www/conf --enable-memory-limit --disable-all --disable-debug --enable-trans-sid --enable-short-tags
make
make install
cp php.ini-dist /usr/local/www/conf/php.ini
ee /usr/local/www/conf/httpd.conf
AddType application/x-httpd-php .php .phtml .inc
ee /usr/local/www/htdocs/index.php
/usr/local/www/bin/apachectl start
安装ZendOptimizer
cd /lib
# ln libm.so.3 libm.so.2
./install.sh
./configure --with-mysql=/usr/local/mysql --with-apache=../apache_1.3.12 --enable-track-vars --enable-trans-sid --enable-debug
ftpd配置
ee /etc/ftpchroot
@operator
内核配置:
maxusers 500
options SC_NO_HISTORY
options SC_DISABLE_REBOOT
options QUOTA
安全配置:
编辑/etc/rc.conf文件
# Enable inetd and sshd
inetd_enable="YES"
inetd_flags="-l -R 1024"
sshd_enable="YES"
# Disenable usbd
usbd_enable="NO"
# Enable quotas
enable_quotas="YES"
check_quotas="YES"
# Disenable sendmail
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
# Disenable network logs
syslogd_flags="-ss"
# Disenable NFS
nfs_server_enable="NO"
nfs_client_enable="NO"
portmap_enable="NO"
clear_tmp_enable="YES"
update_motd="NO"
chmod 600 /etc/rc.conf
chmod 600 /etc/sysctl.conf
所有对/etc/rc.conf文件的修改执行完后都应重启系统。
配置SSH
编辑/etc/ssh/sshd_config.conf文件
Port 8022
Protocol 2
MaxStartups 5:50:10
PermitRootLogin yes
X11Forwarding no
PasswordAuthentication no
AllowGroups wheel
时期时间配置:
#date 9903011354
1999年 3月 1日 星期一 13时54分00秒 CST
通过Internet同步时间
ntpdate 时间服务器(clepsydra.dec.com)
ntpdate clepsydra.dec.com
如果要运行Apache,请编辑httpd.conf文件,修改如下选项以增进安全或性能:
1) Timeout 300--->Timeout 120
2) MaxKeepAliveRequests 256
3) ServerSignature on--->ServerSignature off
4) Options Indexes FollowSymLinks行把indexes删掉(目录的Options不要带index选项)
5) 将Apache运行的用户和组改为nobody
6) MaxClients 150——>MaxClients 1500
安装完毕后,加大mysql的最大连接数
ee /usr/local/mysql/bin/mysqld_safe
-O max_connections=2000
向下寻找到第314行(4.0.20版是314行),其行很长,以“$NOHUP_NICENESS”开头,以“>> $err_log 2>&1”结尾。该行被嵌套在一个if语句里。在314这行末尾的“ >> $err_log 2>&1”前面加上“ -O max_connections=1500 ”,(注意前后各留一个空格)。
然后向下找到316行,也是很长的一行,以“eval "$NOHUP_NICENESS”开头,以“>> $err_log 2>&1”结尾。同样在“ >> $err_log 2>&1”前面加上“ -O max_connections=1500 ”。
保存退出。然后重启,此时的mysql40就是1000个并发连接的数据库了。可以用下面的方法检查一下:
Code: [Copy to clipboard]
cd /usr/local/bin
mysqladmin -uroot -p variables
将会打出一个长列表,按scroll lock后向上卷动屏幕,能看到里面有一项显示
| max_connections | 1000 |
那么表示最大并发连接数已经修改到1000了。
修改 mysql 的 root 密码
Code: [Copy to clipboard]
mysqladmin -u root password '你要的密码'
下载文件
fetch ftp://mysql.byungsoo.net/pub/mysql/Downloads/MySQL-4.0/mysql-4.0.22.tar.gz
fetch http://www.perl.com/CPAN/src/stable.tar.gz
fetch http://cn2.php.net/get/php-4.3.9.tar.gz/from/cn.php.net/mirror
fetch 'http://www.zend.com/store/getfreefile.php?pid=13&zbid=815'
mod_gzip, mod_php4, mod_setenvif, mod_so, mod_auth, mod_access, mod_rewrite, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_dir, mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime, mod_log_config, mod_env, http_core