- 浏览: 584868 次
- 性别:
- 来自: 广州
文章分类
- 全部博客 (365)
- Tomcat调优 (2)
- Apache Http (20)
- Webserver安装 (5)
- Linux安装 (28)
- Linux常用命令 (17)
- C语言及网络编程 (10)
- 文件系统 (0)
- Lucene (12)
- Hadoop (9)
- FastDFS (8)
- 报表 (0)
- 性能测试 (1)
- JAVA (18)
- CSharp (3)
- C++ (38)
- BI (0)
- 数据挖掘 (0)
- 数据采集 (0)
- 网址收集整理 (3)
- Resin (0)
- JBoss (0)
- nginx (0)
- 数据结构 (1)
- 随记 (5)
- Katta (1)
- Shell (6)
- webservice (0)
- JBPM (2)
- JQuery (6)
- Flex (41)
- SSH (0)
- javascript (7)
- php (13)
- 数据库 (6)
- 搜索引擎排序 (2)
- LVS (3)
- solr (2)
- windows (1)
- mysql (3)
- 营销软件 (1)
- tfs (1)
- memcache (5)
- 分布式搜索 (3)
- 关注的博客 (1)
- Android (2)
- clucene (11)
- 综合 (1)
- c c++ 多线程 (6)
- Linux (1)
- 注册码 (1)
- 文件类型转换 (3)
- Linux 与 asp.net (2)
- perl (5)
- coreseek (1)
- 阅读器 (2)
- SEO (1)
- 励志 (1)
- 在线性能测试工具 (1)
- yii (7)
- 服务器监控 (1)
- 广告 (1)
- 代理服务 (5)
- zookeeper (8)
- 广告联盟 (0)
- 常用软件下载 (1)
- 架设自已的站点心得 (0)
最新评论
-
terry07:
java 7 用这个就可以了 Desktop desktop ...
关于java Runtime.getRunTime.exec(String command)的使用 -
HSINKING:
怎么设置打开的dos 窗口是指定的路径下
关于java调用bat文件,不打开窗口 -
liubang201010:
hyperic hq更多参考资料,请访问:http://www ...
hyperic-hq -
^=^:
STDIN_FILENO是unistd.h中定义的一个numb ...
深入理解dup和dup2的用法 -
antor:
留个记号,学习了
[转]用java流方式判断文件类型
[日期:2011-05-06] 来源:Linux社区 作者:fuying163
Centos5.5(32bit)
所需软件包:
gd-2.0.35.tar.gz
libxml2-2.7.7.tar.gz
libmcrypt-2.5.8.tar.bz2
cronolog-1.6.2.tar.gz
httpd-2.2.8.tar.gz
mysql-5.1.44.tar.gz
php-5.2.14.tar.gz
xcache-1.3.0.tar.gz
ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
修改系统参数,编写脚本执行init.sh
cd /opt
vi init.sh
将下列内容拷贝至init.sh脚本中
#welcome
cat << EOF
+--------------------------------------------------------------+
| === Welcome to Centos System init === |
+--------------http://www.linuxtone.org------------------------+
+----------------------Author:NetSeek--------------------------+
EOF
#disable ipv6
cat << EOF
+--------------------------------------------------------------+
| === Welcome to Disable IPV6 === |
+--------------------------------------------------------------+
EOF
echo "alias net-pf-10 off" >> /etc/modprobe.conf
echo "alias ipv6 off" >> /etc/modprobe.conf
/sbin/chkconfig --level 35 ip6tables off
echo "ipv6 is disabled!"
#disable selinux
sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config
echo "selinux is disabled,you must reboot!"
#vim
sed -i "8 s/^/alias vi='vim'/" /root/.bashrc
echo 'syntax on' > /root/.vimrc
#zh_cn
sed -i -e 's/^LANG=.*/LANG="zh_CN.GB18030"/' /etc/sysconfig/i18n
#tunoff services
#--------------------------------------------------------------------------------
cat << EOF
+--------------------------------------------------------------+
| === Welcome to Tunoff services === |
+--------------------------------------------------------------+
EOF
#---------------------------------------------------------------------------------
for i in `ls /etc/rc3.d/S*`
do
CURSRV=`echo $i|cut -c 15-`
echo $CURSRV
case $CURSRV in
crond | irqbalance | microcode_ctl | network | random | sendmail | sshd | syslog | local | mysqld )
echo "Base services, Skip!"
;;
*)
echo "change $CURSRV to off"
chkconfig --level 235 $CURSRV off
service $CURSRV stop
;;
esac
done
执行脚本:
sh init.sh
重启系统
reboot
二、编译安装基本环境
使用 yum 程序安装所需开发包(以下为标准的 RPM 包名称)
rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
yum -y install ntp vim-enhanced gcc gcc-c++ gcc-g77 flex bison autoconf automake bzip2-devel ncurses-devel zlib-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel libXpm-devel gettext-devel pam-devel libtool libtool-ltdl openssl openssl-devel fontconfig-devel
解释如下:
安装基本的编译工具 # yum install -y gcc gcc-c++ flex bison autoconf automake libtool bzip2-devel zlib-devel ncurses-devel pam-devel
安装编译 GD 需要的库# yum install -y xorg-x11-server-Xorg fontconfig-devel libXpm-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel
安装mysql需要的库# yum install -y libxml2-devel curl-devel
编译安装软件包
1)GD2
tar -zxvf gd-2.0.35.tar.gz
cd gd-2.0.35
./configure --prefix=/usr/local/gd2
make && make install
2) LibXML2
tar -zxvf libxml2-2.7.7.tar.gz
cd libxml2-2.7.7
./configure --prefix=/usr/local/libxml2
make && make install
3) LibMcrypt
tar xvf libmcrypt-2.5.8.tar.bz2
cd libmcrypt-2.5.8
./configure --prefix=/usr/local/libmcrypt
make && make install
4) Apache日志截断程序
tar zxvf cronolog-1.6.2.tar.gz
cd cronolog-1.6.2
./configure --prefix=/usr/local/cronolog
make && make install
5)安装mysql
tar -zxvf mysql-5.1.44.tar.gz
cd mysql-5.1.44
./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile
make && make install
创建MySQL数据库,用默认的配置my.cnf
groupadd mysql
useradd -g mysql mysql
cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
/usr/local/mysql/bin/mysql_install_db --user=mysql
chown -R mysql /usr/local/mysql/var
chgrp -R mysql /usr/local/mysql/.
添加Mysql启动服务,并且设置root密码
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql
chmod 755 /etc/init.d/mysql
chkconfig --level 345 mysql on
echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf
echo "/usr/local/lib" >>/etc/ld.so.conf
ldconfig
ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql
ln -s /usr/local/mysql/include/mysql /usr/include/mysql
service mysql start
/usr/local/mysql/bin/mysqladmin -u root password root //root改为你需要的密码
service mysql restart
6)安装apache
groupadd httpd
useradd -g httpd -s /sbin/nologin -M httpd
tar -zxvf httpd-2.2.8.tar.gz
cd httpd-2.2.8
./configure --prefix=/usr/local/apache2 --with-included-apr --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-static-support --disable-userdir --enable-dav --enable-maintainer-mode
红色字体为部署SVN服务器所用,否则编译svn的时候会报错
make
make install
7)安装php
tar -zxvf php-5.2.14.tar.gz
cd php-5.2.14
mkdir -p /usr/local/php/etc
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-libxml-dir=/usr/local/libxml2 --with-gd=/usr/local/gd2 --with-jpeg-dir --with-png-dir --with-bz2 --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-openssll --with-mcrypt=/usr/local/libmcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --disable-ipv6 --disable-cgi --disable-cli
make
make install
cp php.ini-dist /usr/local/php/etc/php.ini
7)安装Xcache
tar -zxvf xcache-1.3.0.tar.gz
cd xcache-1.3.0
/usr/local/php/bin/phpize ./configure --enable-xcache --enable-xcache-coverager --with-php-config=/usr/local/php/bin/php-config --enable-inline-optimization --disable-debug
vi /usr/local/php/etc/php.ini
在最后添加以下内容
[xcache-common]
zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/xcache.so
[xcache.admin]
xcache.admin.user = "admin"
;create md5 password: echo -n "password"| md5sum
xcache.admin.pass = "f3dfd37a03b1356d6380b41e524f903b" #password is hx10.com
[xcache]
; Change xcache.size to tune the size of the opcode cache
xcache.size = 24M
xcache.shm_scheme = "mmap"
xcache.count = 4
xcache.slots = 8K
xcache.ttl = 0
xcache.gc_interval = 0
; Change xcache.var_size to adjust the size of variable cache
xcache.var_size = 8M
xcache.var_count = 1
xcache.var_slots = 8K
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300
xcache.test = Off
xcache.readonly_protection = On
xcache.mmap_path = "/tmp/xcache"
xcache.coredump_directory = ""
xcache.cacher = On
xcache.stat = On
xcache.optimizer = Off
[xcache.coverager]
xcache.coverager = On
xcache.coveragedump_directory = ""
8)安装Zend Optimizer 系统如果是64位的,请安装64位的ZendOptimizer-3.3.9-linux-glibc23文件;
tar -zxvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
mv ZendOptimizer-3.3.9-linux-glibc23-i386 /usr/local/Zend
cp /usr/local/Zend/data/5_2_x_comp/ZendOptimizer.so /usr/local/Zend/
vi /usr/local/php/etc/php.ini
最后一行加入以下内容
zend_optimizer.optimization_level=15
zend_extension=/usr/local/Zend/ZendOptimizer.so
9)整合Apache与PHP及系统初化配置
vi /usr/local/apache2/conf/httpd.conf
查找AddType application/x-gzip .gz .tgz,在该行下面添加
AddType application/x-httpd-php .php
查找DirectoryIndex index.html 把该行修改成
DirectoryIndex index.html index.htm index.php
找到
#Include conf/extra/httpd-mpm.conf
#Include conf/extra/httpd-info.conf
#Include conf/extra/httpd-vhosts.conf
#Include conf/extra/httpd-default.conf
去掉这4行前面的#
注意:以上 4 个扩展配置文件中的设置请按照相关原则进行合理配置!
vi /usr/local/apache2/conf/extra/httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin webmaster@XXX.com
DocumentRoot "/www/wwwroot/"
ServerName www.test.com
ServerAlias www.test.com
ErrorLog "logs/www.test.com-error_log"
CustomLog "logs/www.test.com-access_log" common
</VirtualHost>
新建一个虚拟主机,删除原有的虚拟主机配置;
mkdir -p /www/wwwroot/
然后PHP探针放到这个目录
vi /usr/local/apache2/conf/httpd.conf
找到
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all //把这里的Deny改成Allow
</Directory>
找到
#ServerName www.example.com:80 在这一行后面加入下面一行
ServerName 127.0.0.1:80
找到
User httpd
Group httpd
把原来的daemon修改成httpd
Apache 运行账户 httpd:httpd
chown -R httpd:httpd /www/wwwroot
重启apache
# /usr/local/apache2/bin/apachectl restart
输入探针的地址访问
http://ip/php.php
安装apache服务
cd httpd-2.2.8
cp support/apachectl /etc/init.d/httpd
vi /etc/init.d/httpd
加入以下的代码,使apache可以用chkconfig方式启动(保留#):
# Startup script for the Apache Web Server
# chkconfig: 2345 10 90
# description: Apache is a World Wide Web server.
# processname: httpd
# pidfile: /usr/local/apache2/log/httpd.pid
# config: /usr/local/apache2/conf/httpd.conf
安装服务并开机启动
chmod 755 /etc/init.d/httpd
chkconfig --add httpd
chkconfig --level 345 httpd on
service httpd start
10)安全和性能优化
vi /usr/local/php/etc/php.ini
查找disable_functions =
等号后面加入以下参数,注意不能换行
phpinfo,passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,get_cfg_var
查找以下2项,把on改成off
expose_php = Off
display_errors = Off
vi /usr/local/apache2/conf/extra/httpd-default.conf 修改后的内容如下
Timeout 15
KeepAlive Off
MaxKeepAliveRequests 50
KeepAliveTimeout 5
UseCanonicalName Off
AccessFileName .htaccess
ServerTokens Prod
ServerSignature Off
HostnameLookups Off
vi /usr/local/apache2/conf/extra/httpd-mpm.conf 修改一个模块后的内容如下
原来的配置如下:
<IfModule mpm_prefork_module>
ServerLimit 256
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 256
MaxRequestsPerChild 0
</IfModule>
修改后配置如下
<IfModule mpm_prefork_module>
ServerLimit 2000
StartServers 2000
MinSpareServers 10
MaxSpareServers 10
MaxClients 2000
MaxRequestsPerChild 10000
</IfModule>
查看是什么模式
/usr/local/apache2/bin/apachectl -l
如果出现prefork.c那就说明是prefork模式
本篇文章来源于 Linux公社网站(www.linuxidc.com) 原文链接:http://www.linuxidc.com/Linux/2011-05/35628.htm
http://www.idouye.com 爱豆叶资料分享
Centos5.5(32bit)
所需软件包:
gd-2.0.35.tar.gz
libxml2-2.7.7.tar.gz
libmcrypt-2.5.8.tar.bz2
cronolog-1.6.2.tar.gz
httpd-2.2.8.tar.gz
mysql-5.1.44.tar.gz
php-5.2.14.tar.gz
xcache-1.3.0.tar.gz
ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
修改系统参数,编写脚本执行init.sh
cd /opt
vi init.sh
将下列内容拷贝至init.sh脚本中
#welcome
cat << EOF
+--------------------------------------------------------------+
| === Welcome to Centos System init === |
+--------------http://www.linuxtone.org------------------------+
+----------------------Author:NetSeek--------------------------+
EOF
#disable ipv6
cat << EOF
+--------------------------------------------------------------+
| === Welcome to Disable IPV6 === |
+--------------------------------------------------------------+
EOF
echo "alias net-pf-10 off" >> /etc/modprobe.conf
echo "alias ipv6 off" >> /etc/modprobe.conf
/sbin/chkconfig --level 35 ip6tables off
echo "ipv6 is disabled!"
#disable selinux
sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config
echo "selinux is disabled,you must reboot!"
#vim
sed -i "8 s/^/alias vi='vim'/" /root/.bashrc
echo 'syntax on' > /root/.vimrc
#zh_cn
sed -i -e 's/^LANG=.*/LANG="zh_CN.GB18030"/' /etc/sysconfig/i18n
#tunoff services
#--------------------------------------------------------------------------------
cat << EOF
+--------------------------------------------------------------+
| === Welcome to Tunoff services === |
+--------------------------------------------------------------+
EOF
#---------------------------------------------------------------------------------
for i in `ls /etc/rc3.d/S*`
do
CURSRV=`echo $i|cut -c 15-`
echo $CURSRV
case $CURSRV in
crond | irqbalance | microcode_ctl | network | random | sendmail | sshd | syslog | local | mysqld )
echo "Base services, Skip!"
;;
*)
echo "change $CURSRV to off"
chkconfig --level 235 $CURSRV off
service $CURSRV stop
;;
esac
done
执行脚本:
sh init.sh
重启系统
reboot
二、编译安装基本环境
使用 yum 程序安装所需开发包(以下为标准的 RPM 包名称)
rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
yum -y install ntp vim-enhanced gcc gcc-c++ gcc-g77 flex bison autoconf automake bzip2-devel ncurses-devel zlib-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel libXpm-devel gettext-devel pam-devel libtool libtool-ltdl openssl openssl-devel fontconfig-devel
解释如下:
安装基本的编译工具 # yum install -y gcc gcc-c++ flex bison autoconf automake libtool bzip2-devel zlib-devel ncurses-devel pam-devel
安装编译 GD 需要的库# yum install -y xorg-x11-server-Xorg fontconfig-devel libXpm-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel
安装mysql需要的库# yum install -y libxml2-devel curl-devel
编译安装软件包
1)GD2
tar -zxvf gd-2.0.35.tar.gz
cd gd-2.0.35
./configure --prefix=/usr/local/gd2
make && make install
2) LibXML2
tar -zxvf libxml2-2.7.7.tar.gz
cd libxml2-2.7.7
./configure --prefix=/usr/local/libxml2
make && make install
3) LibMcrypt
tar xvf libmcrypt-2.5.8.tar.bz2
cd libmcrypt-2.5.8
./configure --prefix=/usr/local/libmcrypt
make && make install
4) Apache日志截断程序
tar zxvf cronolog-1.6.2.tar.gz
cd cronolog-1.6.2
./configure --prefix=/usr/local/cronolog
make && make install
5)安装mysql
tar -zxvf mysql-5.1.44.tar.gz
cd mysql-5.1.44
./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile
make && make install
创建MySQL数据库,用默认的配置my.cnf
groupadd mysql
useradd -g mysql mysql
cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
/usr/local/mysql/bin/mysql_install_db --user=mysql
chown -R mysql /usr/local/mysql/var
chgrp -R mysql /usr/local/mysql/.
添加Mysql启动服务,并且设置root密码
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql
chmod 755 /etc/init.d/mysql
chkconfig --level 345 mysql on
echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf
echo "/usr/local/lib" >>/etc/ld.so.conf
ldconfig
ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql
ln -s /usr/local/mysql/include/mysql /usr/include/mysql
service mysql start
/usr/local/mysql/bin/mysqladmin -u root password root //root改为你需要的密码
service mysql restart
6)安装apache
groupadd httpd
useradd -g httpd -s /sbin/nologin -M httpd
tar -zxvf httpd-2.2.8.tar.gz
cd httpd-2.2.8
./configure --prefix=/usr/local/apache2 --with-included-apr --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-static-support --disable-userdir --enable-dav --enable-maintainer-mode
红色字体为部署SVN服务器所用,否则编译svn的时候会报错
make
make install
7)安装php
tar -zxvf php-5.2.14.tar.gz
cd php-5.2.14
mkdir -p /usr/local/php/etc
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-libxml-dir=/usr/local/libxml2 --with-gd=/usr/local/gd2 --with-jpeg-dir --with-png-dir --with-bz2 --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-openssll --with-mcrypt=/usr/local/libmcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --disable-ipv6 --disable-cgi --disable-cli
make
make install
cp php.ini-dist /usr/local/php/etc/php.ini
7)安装Xcache
tar -zxvf xcache-1.3.0.tar.gz
cd xcache-1.3.0
/usr/local/php/bin/phpize ./configure --enable-xcache --enable-xcache-coverager --with-php-config=/usr/local/php/bin/php-config --enable-inline-optimization --disable-debug
vi /usr/local/php/etc/php.ini
在最后添加以下内容
[xcache-common]
zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/xcache.so
[xcache.admin]
xcache.admin.user = "admin"
;create md5 password: echo -n "password"| md5sum
xcache.admin.pass = "f3dfd37a03b1356d6380b41e524f903b" #password is hx10.com
[xcache]
; Change xcache.size to tune the size of the opcode cache
xcache.size = 24M
xcache.shm_scheme = "mmap"
xcache.count = 4
xcache.slots = 8K
xcache.ttl = 0
xcache.gc_interval = 0
; Change xcache.var_size to adjust the size of variable cache
xcache.var_size = 8M
xcache.var_count = 1
xcache.var_slots = 8K
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300
xcache.test = Off
xcache.readonly_protection = On
xcache.mmap_path = "/tmp/xcache"
xcache.coredump_directory = ""
xcache.cacher = On
xcache.stat = On
xcache.optimizer = Off
[xcache.coverager]
xcache.coverager = On
xcache.coveragedump_directory = ""
8)安装Zend Optimizer 系统如果是64位的,请安装64位的ZendOptimizer-3.3.9-linux-glibc23文件;
tar -zxvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
mv ZendOptimizer-3.3.9-linux-glibc23-i386 /usr/local/Zend
cp /usr/local/Zend/data/5_2_x_comp/ZendOptimizer.so /usr/local/Zend/
vi /usr/local/php/etc/php.ini
最后一行加入以下内容
zend_optimizer.optimization_level=15
zend_extension=/usr/local/Zend/ZendOptimizer.so
9)整合Apache与PHP及系统初化配置
vi /usr/local/apache2/conf/httpd.conf
查找AddType application/x-gzip .gz .tgz,在该行下面添加
AddType application/x-httpd-php .php
查找DirectoryIndex index.html 把该行修改成
DirectoryIndex index.html index.htm index.php
找到
#Include conf/extra/httpd-mpm.conf
#Include conf/extra/httpd-info.conf
#Include conf/extra/httpd-vhosts.conf
#Include conf/extra/httpd-default.conf
去掉这4行前面的#
注意:以上 4 个扩展配置文件中的设置请按照相关原则进行合理配置!
vi /usr/local/apache2/conf/extra/httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin webmaster@XXX.com
DocumentRoot "/www/wwwroot/"
ServerName www.test.com
ServerAlias www.test.com
ErrorLog "logs/www.test.com-error_log"
CustomLog "logs/www.test.com-access_log" common
</VirtualHost>
新建一个虚拟主机,删除原有的虚拟主机配置;
mkdir -p /www/wwwroot/
然后PHP探针放到这个目录
vi /usr/local/apache2/conf/httpd.conf
找到
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all //把这里的Deny改成Allow
</Directory>
找到
#ServerName www.example.com:80 在这一行后面加入下面一行
ServerName 127.0.0.1:80
找到
User httpd
Group httpd
把原来的daemon修改成httpd
Apache 运行账户 httpd:httpd
chown -R httpd:httpd /www/wwwroot
重启apache
# /usr/local/apache2/bin/apachectl restart
输入探针的地址访问
http://ip/php.php
安装apache服务
cd httpd-2.2.8
cp support/apachectl /etc/init.d/httpd
vi /etc/init.d/httpd
加入以下的代码,使apache可以用chkconfig方式启动(保留#):
# Startup script for the Apache Web Server
# chkconfig: 2345 10 90
# description: Apache is a World Wide Web server.
# processname: httpd
# pidfile: /usr/local/apache2/log/httpd.pid
# config: /usr/local/apache2/conf/httpd.conf
安装服务并开机启动
chmod 755 /etc/init.d/httpd
chkconfig --add httpd
chkconfig --level 345 httpd on
service httpd start
10)安全和性能优化
vi /usr/local/php/etc/php.ini
查找disable_functions =
等号后面加入以下参数,注意不能换行
phpinfo,passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,get_cfg_var
查找以下2项,把on改成off
expose_php = Off
display_errors = Off
vi /usr/local/apache2/conf/extra/httpd-default.conf 修改后的内容如下
Timeout 15
KeepAlive Off
MaxKeepAliveRequests 50
KeepAliveTimeout 5
UseCanonicalName Off
AccessFileName .htaccess
ServerTokens Prod
ServerSignature Off
HostnameLookups Off
vi /usr/local/apache2/conf/extra/httpd-mpm.conf 修改一个模块后的内容如下
原来的配置如下:
<IfModule mpm_prefork_module>
ServerLimit 256
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 256
MaxRequestsPerChild 0
</IfModule>
修改后配置如下
<IfModule mpm_prefork_module>
ServerLimit 2000
StartServers 2000
MinSpareServers 10
MaxSpareServers 10
MaxClients 2000
MaxRequestsPerChild 10000
</IfModule>
查看是什么模式
/usr/local/apache2/bin/apachectl -l
如果出现prefork.c那就说明是prefork模式
本篇文章来源于 Linux公社网站(www.linuxidc.com) 原文链接:http://www.linuxidc.com/Linux/2011-05/35628.htm
http://www.idouye.com 爱豆叶资料分享
发表评论
-
CentOS 下管理自定义 PHP 计划任务代码的守护进程脚本
2012-02-17 15:32 2116from http://micate.me/centos-ph ... -
CentOS 6 架設 apache + php + mysql
2012-02-17 15:29 14561.Download Centos 6 Minimail CD ... -
新_CentOS 6下搭建Apache+MySQL+PHP+SSL
2012-02-17 15:22 1222CentOS 6下搭建Apache+MySQL+PHP+SSL ... -
linux下apache2.2性能优化和安装_重要
2011-06-05 11:33 26012011年02月17日 星期四 23:31转载自 macaqu ... -
定制Apache的防盗链模块 Mod_perl<1>
2011-05-28 12:20 1427from http://bbs.chinaunix.net/v ... -
详细解析用Squid实现反向代理的方法
2011-05-06 18:04 1003from http://tech.ccidnet.com/a ... -
apache与Tomcat整合配置文档[windows].txt
2011-04-06 11:20 12871\下载的软件(可以从此网址下载得到http://www.a ... -
apache 防盗链
2011-03-27 23:11 18372010-09-25 22:09apche有rewrite_m ... -
apache modperl防盗链
2011-03-27 23:02 11652010-09-25 21:41定制Apache的 ... -
很好的一个运维博客
2011-01-26 17:05 1035陈子的学前班笔记(很值得一看) http://blog.si ... -
apache防盗链(mod_perl试用二)
2011-01-26 17:03 949引用(2010-05-27 00:07:01) 转 ... -
apache 防盗链,限带宽和连接数
2011-01-26 16:59 1135防盗链原理: http标准协议中有专门的字段记录referer ... -
Apache 防盗链(Apache Anti-Leech)技术的简单实现
2011-01-26 16:49 1052引用. 使用 rewrite 技术实现 Apache 防盗链 ... -
Linux上Apache反向代理之ProxyPass IIS网站总结
2010-08-19 13:53 2227Linux上Apache反向代理之ProxyPass IIS网 ... -
Apache的ProxyPass指令详解
2010-08-19 13:33 2146文章分类:JavaEye 关键字: ... -
Windows下安装多个Apache服务
2010-08-18 09:59 1310安装好Apache以后,可以 ... -
apachemod_proxy 集群
2010-07-06 10:58 816下面以在apachemod_proxy下做的反向代理负载均衡为 ... -
Apache RewriteRule的标志一览
2010-06-30 11:38 1122也可请参考下面网址 http://res.phpchina.c ... -
apache2.2 tomcat6.0 负载均衡集群整理配置
2010-06-28 15:24 2055worker.list=controller,tomcat1, ...
相关推荐
CentOs5.5+mysql+nginx+php5.3.3安全安装手册.doc
### 最详细全面的CentOs5.5+mysql+nginx+php5.3.3安全安装手册 #### 一、安装CentOs5操作系统 ##### 1.1 系统安装 在进行CentOS 5.5的安装之前,首先需要设置计算机的BIOS启动顺序为光驱启动。设置完成后,将安装...
### Centos 5.5 +Freeradius+mysql 安装指导 #### 1. 知识点概述 - **CentOS 5.5**:一款基于Red Hat Enterprise Linux (RHEL)并依照开放源代码规定发布的服务器操作系统,适用于小型企业和个人用户。 - **Free...
大牛写的CentOS_5.5+RHCS来实现ORACLE_10.2_双机热备 第一章 实验环境介绍 第二章 IPSAN的配置 第三章 安装和配置第一个RHCS服务 第四章 操作系统补丁包安装和参数调整 第五章 安装数据库软件并创建第一个数据库实例...
在本文中,我们将详细介绍如何在 CentOS 5.5 操作系统上使用 YUM 工具安装 Apache、PHP 和 MySQL,创建一个完整的 LAMP (Linux, Apache, MySQL, PHP) 服务器环境。 首先,确保您已经安装了 CentOS 5.5。这个版本...
### CentOS 5.5 使用 YUM 安装 Apache+PHP5+MySQL #### 一、概览 在本文档中,我们将详细介绍如何在 CentOS 5.5 版本上使用 YUM 包管理器安装并配置一个完整的 LAMP(Linux + Apache + MySQL + PHP)环境。LAMP 是...
centos 5.5+Vsftpd-2.3.4安装详细过程 本文将详细介绍CentOS 5.5下安装Vsftpd 2.3.4的步骤,包括下载最新版本、安装前准备、解压安装、编译vsftpd、配置vsftpd等。 一、下载最新版本 Vsftpd是目前最流行的FTP...
在CentOS 5.5操作系统中,安装Nginx、PHP和MySQL的组合是一个常见的任务,这个过程可以分为几个关键步骤。以下是一个详细的指南,涵盖了从安装基础环境到配置服务的整个过程。 首先,我们需要确保系统中安装了必要...
在IT领域,尤其是在服务器管理和数据库部署中,CentOS...因此,这份文档对于初学者或经验丰富的管理员来说都是宝贵的资源,可以帮助他们顺利地在CentOS 5.5上部署Oracle 11g R2数据库,尤其是如果涉及到RAC配置的话。
SIP Server 环境搭建是 VoIP 技术的核心组件,本文将指导读者从头开始搭建 SIP Server 环境,包括 VMware Player 的安装配置、CentOS 5.5 的安装配置和 Asterisk 的安装配置,以及常用的 SIP 命令。 一、VMware ...
### CentOS5.5 + Oracle10g 安装配置 RAC #### 第一章 概述 ##### 1.1 硬件 在搭建Oracle RAC (Real Application Clusters)环境中,硬件的选择至关重要。RAC环境至少需要两台服务器(节点),并且这些节点之间需要...
【CentOS 5.5 快速搭建Apache+PHP5+MySQL Web服务器】 在Linux操作系统领域,LAMP架构(Linux, Apache, MySQL, PHP)是非常常见的用于构建Web服务器的组合。本文将详细介绍如何在CentOS 5.5系统上快速安装和配置这...
这个教程自己已经在centos5.5上一个个试...该文档包括apache的安装,php的安装和mysql的详细安装,先上传这个文档,后续继续上传centos5.5+nginx+php+mysql文档、负载均衡和mysql主主配置,希望能给大家一点帮助,谢谢
本文主要介绍了如何在CentOS操作系统上搭建一个包含PHP5.5、Redis、XDebug、Nginx和MySQL的开发环境。以下是该教程中涉及的关键知识点的详细说明: 1. CentOS系统环境准备: - CentOS系统作为服务器操作系统广泛...
在“mysql5.5+php+nginx脚本自动化部署”场景中,这个过程旨在通过脚本简化在CentOS、Ubuntu等Linux操作系统上安装和配置这些组件的过程。以下是该自动化部署可能涉及的步骤和知识点: 1. **环境准备**:首先,确保...
在Linux CentOS5.5系统中进行Web配置是一项常见的任务,对于服务器管理和网站部署至关重要。本文将深入探讨CentOS5.5下的Web配置方法,包括基本配置、路径设置、访问控制、用户认证以及虚拟主机的配置等关键知识点。...
在本文中,我们将深入探讨如何在CentOS 6.0操作系统上搭建一个基于Apache 2.4、PHP 5.4.7和MySQL 5.5.27的Web服务器环境。这个环境对于开发和部署基于LAMP(Linux、Apache、MySQL、PHP)的应用程序至关重要。 首先...
CentOS 7.1 + Apache + MySQL + PHP + ZendGuardLoader 配置教程 本文档主要介绍如何在 CentOS 7.1 操作系统上配置 Apache、MySQL、PHP 和 ZendGuardLoader 等环境。下面是详细的配置步骤和知识点: 1. 配置固定 ...