- 浏览: 602584 次
- 性别:
- 来自: 广州
-
文章分类
- 全部博客 (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 2155from http://micate.me/centos-ph ... -
CentOS 6 架設 apache + php + mysql
2012-02-17 15:29 14891.Download Centos 6 Minimail CD ... -
新_CentOS 6下搭建Apache+MySQL+PHP+SSL
2012-02-17 15:22 1250CentOS 6下搭建Apache+MySQL+PHP+SSL ... -
linux下apache2.2性能优化和安装_重要
2011-06-05 11:33 26362011年02月17日 星期四 23:31转载自 macaqu ... -
定制Apache的防盗链模块 Mod_perl<1>
2011-05-28 12:20 1466from http://bbs.chinaunix.net/v ... -
详细解析用Squid实现反向代理的方法
2011-05-06 18:04 1048from http://tech.ccidnet.com/a ... -
apache与Tomcat整合配置文档[windows].txt
2011-04-06 11:20 13211\下载的软件(可以从此网址下载得到http://www.a ... -
apache 防盗链
2011-03-27 23:11 18632010-09-25 22:09apche有rewrite_m ... -
apache modperl防盗链
2011-03-27 23:02 12002010-09-25 21:41定制Apache的 ... -
很好的一个运维博客
2011-01-26 17:05 1076陈子的学前班笔记(很值得一看) http://blog.si ... -
apache防盗链(mod_perl试用二)
2011-01-26 17:03 972引用(2010-05-27 00:07:01) 转 ... -
apache 防盗链,限带宽和连接数
2011-01-26 16:59 1165防盗链原理: http标准协议中有专门的字段记录referer ... -
Apache 防盗链(Apache Anti-Leech)技术的简单实现
2011-01-26 16:49 1091引用. 使用 rewrite 技术实现 Apache 防盗链 ... -
Linux上Apache反向代理之ProxyPass IIS网站总结
2010-08-19 13:53 2259Linux上Apache反向代理之ProxyPass IIS网 ... -
Apache的ProxyPass指令详解
2010-08-19 13:33 2174文章分类:JavaEye 关键字: ... -
Windows下安装多个Apache服务
2010-08-18 09:59 1356安装好Apache以后,可以 ... -
apachemod_proxy 集群
2010-07-06 10:58 851下面以在apachemod_proxy下做的反向代理负载均衡为 ... -
Apache RewriteRule的标志一览
2010-06-30 11:38 1146也可请参考下面网址 http://res.phpchina.c ... -
apache2.2 tomcat6.0 负载均衡集群整理配置
2010-06-28 15:24 2074worker.list=controller,tomcat1, ...
相关推荐
### 安装笔记:centos6+zabbix3.x #### 一、概述 本文档旨在记录在CentOS 6.5环境下安装与配置Zabbix 3.x的过程,并着重介绍了使用MySQL作为数据库支持、通过msmtp发送告警邮件以及利用fping工具检测网络设备状态...
最后,要关注安全问题,比如限制root用户的远程访问,设置防火墙规则,定期更新软件以修复安全漏洞,以及优化MySQL配置以提高性能。 "马哥lamp视频笔记"可能包含了上述过程的详细步骤和注意事项,对于学习和实践...
2. **centos5.5源码安装mysql** - **简介**:介绍了在CentOS 5.5操作系统上从源码编译安装MySQL的过程。 - **用途**:适用于需要在Linux环境下手动编译安装MySQL的学习者。 - **下载地址**:...
嵌入式八股文面试题库资料知识宝典-华为的面试试题.zip
训练导控系统设计.pdf
嵌入式八股文面试题库资料知识宝典-网络编程.zip
人脸转正GAN模型的高效压缩.pdf
少儿编程scratch项目源代码文件案例素材-几何冲刺 转瞬即逝.zip
少儿编程scratch项目源代码文件案例素材-鸡蛋.zip
嵌入式系统_USB设备枚举与HID通信_CH559单片机USB主机键盘鼠标复合设备控制_基于CH559单片机的USB主机模式设备枚举与键盘鼠标数据收发系统支持复合设备识别与HID
嵌入式八股文面试题库资料知识宝典-linux常见面试题.zip
面向智慧工地的压力机在线数据的预警应用开发.pdf
基于Unity3D的鱼类运动行为可视化研究.pdf
少儿编程scratch项目源代码文件案例素材-霍格沃茨魔法学校.zip
少儿编程scratch项目源代码文件案例素材-金币冲刺.zip
内容概要:本文深入探讨了HarmonyOS编译构建子系统的作用及其技术细节。作为鸿蒙操作系统背后的关键技术之一,编译构建子系统通过GN和Ninja工具实现了高效的源代码到机器代码的转换,确保了系统的稳定性和性能优化。该系统不仅支持多系统版本构建、芯片厂商定制,还具备强大的调试与维护能力。其高效编译速度、灵活性和可扩展性使其在华为设备和其他智能终端中发挥了重要作用。文章还比较了HarmonyOS编译构建子系统与安卓和iOS编译系统的异同,并展望了其未来的发展趋势和技术演进方向。; 适合人群:对操作系统底层技术感兴趣的开发者、工程师和技术爱好者。; 使用场景及目标:①了解HarmonyOS编译构建子系统的基本概念和工作原理;②掌握其在不同设备上的应用和优化策略;③对比HarmonyOS与安卓、iOS编译系统的差异;④探索其未来发展方向和技术演进路径。; 其他说明:本文详细介绍了HarmonyOS编译构建子系统的架构设计、核心功能和实际应用案例,强调了其在万物互联时代的重要性和潜力。阅读时建议重点关注编译构建子系统的独特优势及其对鸿蒙生态系统的深远影响。
嵌入式八股文面试题库资料知识宝典-奇虎360 2015校园招聘C++研发工程师笔试题.zip
嵌入式八股文面试题库资料知识宝典-腾讯2014校园招聘C语言笔试题(附答案).zip
双种群变异策略改进RWCE算法优化换热网络.pdf
内容概要:本文详细介绍了基于瞬时无功功率理论的三电平有源电力滤波器(APF)仿真研究。主要内容涵盖并联型APF的工作原理、三相三电平NPC结构、谐波检测方法(ipiq)、双闭环控制策略(电压外环+电流内环PI控制)以及SVPWM矢量调制技术。仿真结果显示,在APF投入前后,电网电流THD从21.9%降至3.77%,显著提高了电能质量。 适用人群:从事电力系统研究、电力电子技术开发的专业人士,尤其是对有源电力滤波器及其仿真感兴趣的工程师和技术人员。 使用场景及目标:适用于需要解决电力系统中谐波污染和无功补偿问题的研究项目。目标是通过仿真验证APF的有效性和可行性,优化电力系统的电能质量。 其他说明:文中提到的仿真模型涉及多个关键模块,如三相交流电压模块、非线性负载、信号采集模块、LC滤波器模块等,这些模块的设计和协同工作对于实现良好的谐波抑制和无功补偿至关重要。