-, configure Apache
1. Close the firewall
Service Iptables Stop
Chkconfig iptables off
2. Open Apache
Service httpd Status
Service httpd Start
3. Change http.conf Configuration
Servertokens os–> Servertokens Prod
Serversignature on–> serversignature off
DirectoryIndex index.html Index.html.var
–>
DirectoryIndex index.html index.php
Change Administrator Mailbox
#ServerName new.host.name:80–> to modify as needed
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
But it's off the Apache test page.
Rm-f/etc/httpd/conf.d/welcome.conf/var/www/error/noindex.html
Chkconfig httpd on
Chkconfig–list httpd
Second, configure PHP
1. New PHP test page
Echo ' <?php phpinfo (); ' >/var/www/html/index.php
2. Upgrade 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
Add Content:
[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
Install 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*
Third, configure 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
Add to
Default-character-set = UTF8
[MySQL]
Default-character-set = UTF8
Chkconfig mysqld on
Chkconfig–list mysqld
Set Password
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′);