-, 配置apache
1.关闭防火墙
service iptables stop
chkconfig iptables off
2.开启apache
service httpd status
service httpd start
3.更改http.conf配置
ServerTokens OS –> ServerTokens Prod
ServerSignature On –> ServerSignature Off
DirectoryIndex index.html index.html.var
–>
DirectoryIndex index.html index.php
更改管理员邮箱
#ServerName new.host.name:80 –> 根据需要自行修改
Options Indexes FollowSymLinks –> Options Includes ExecCGI FollowSymLinks
#AddHandler cgi-script .cgi –> AddHandler cgi-script .cgi .pl
AllowOverride None -> AllowOverride All
LogFormat “%h %l %u %t ”%r” %>s %b ”%{Referer}i” ”%{User-Agent}i”" combined
–>
LogFormat “%h %l %u %t ”%!414r” %>s %b ”%{Referer}i” ”%{User-Agent}i”" combined
Options Indexes MultiViews –> Options MultiViews
却掉apache的测试页
rm -f /etc/httpd/conf.d/welcome.conf /var/www/error/noindex.html
chkconfig httpd on
chkconfig –list httpd
二,配置php
1.新建php测试页
echo ‘ /var/www/html/index.php
2.升级php 5.1.6 -> 5.2.16
rpm –import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
vim /etc/yum.repos.d/CentOS-Base.repo
添加内容:
[utterramblings]
name=Jason’s Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
yum -y update php
yum -y install libmcrypt
yum -y install php-mcrypt
yum -y install php-gd
yum -y install php-soap
yum -y install php-json
yum -y install php-mbstring
安装zend-opterate
cd /usr/local/src
wget http://downloads.zend.com/optimizer/3.3.3/ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
tar zxvf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
cd ZendOptimizer-3.3.3-linux-glibc23-i386
./install.sh
cd ../
rm -rf ZendOptimizer*
三,配置mysql
yum install mysql
yum -y install mysql-server
yum install mysql-devel
chgrp -R mysql /var/lib/mysql
chmod -R 770 /var/lib/mysql
service mysqld start
yum -y install php-mysql
service httpd restart
vim /etc/my.cnf
添加
default-character-set = utf8
[mysql]
default-character-set = utf8
chkconfig mysqld on
chkconfig –list mysqld
设置密码
mysql -u root
select user,host,password from mysql.user;
set password for root@localhost=password(’123456′);
set password for root@127.0.0.1=password(’123456′);
set password for root@All-STAR=password(’123456′);