Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 操作系统 > Linux > apache+mysql+PHP for FB 手记
【标  题】:apache+mysql+PHP for FB 手记
【关键字】:apache+mysql+PHP,for,FB
【来  源】:http://www.cublog.cn/u/20048/showart.php?id=122673

apache+mysql+PHP for FB 手记

Your Ad Here
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
在linux系统下安装perl:【上一篇】
root 口令恢复:【下一篇】
【相关文章】
  • A 'C' Test: The 0x10 Best Questions for Would-be Embedded Programmers
  • 与afreez一起学习DirectFB之:编译运行第一个DirectFB程序
  • RFC1961中文翻译 GSS-API对SOCKS V5 的认证方法(GSS-API Authentication Method for SOCKS Version 5)
  • 安装Apache+Mysql+PHP+zend_optimizer全过程
  • BPELJ: BPEL for Java白皮书--连载(一)
  • 急求购--Microsoft Windows CE Toolkit for Visual Basic 6_0
  • WinCE Platform Builder:Attach Device后模拟器黑屏
  • Java Bindings for OpenGL 1 - JOGL简介与安装
  • [原]翻译Shaders.for.Game.Programmers第四章(1)
  • [FileFormat]用VB写的高速GIF、JPEG 编码/解码 程序
  • 【随机文章】
  • 一个简单的网上书城的例子(三)
  • Windows Mobile 5.0
  • 我的第一个helloworld程序
  • 视频会议终端MP384
  • Mysql5+Apache2+PHP5源代码的安装
  • 对MSDN中关于ToolboxBitmap属性补充
  • 揭开AS脚本中区分大小写之迷
  • ★★★提高BT下载速度全攻略之优化配置BitComet★★★(转载,经验证效果非常好~)
  • shell问答20:expr的用法
  • 写好C程序的10+大要点
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 软讯网络 All Rigths Reserved.