Download httpd-2.2.19 httpd-2.2.19
1. cd httpd-2.2.19
- ./configure --prefix=/usr/local/apache --enable-vhost-alias --enable-rewrite --enable-info
- Make
- Make install
- cp build/rpm/httpd.init /etc/init.d/httpd
- chmod 755 /etc/init.d/httpd
- chkconfig --add httpd
- chkconfig --level 35 httpd on
- cd /etc
- mv httpd httpd_old
- ln -s /usr/local/apache/ httpd
- cd /usr/sbin/
- ln -fs /usr/local/apache/bin/httpd
- ln -fs /usr/local/apache/bin/apachectl
- cd /var/log
- rm -rf httpd/
- ln -s /usr/local/apache/logs httpd
- /etc/init.d/httpd start
安装php
yum install libxml2
yum install libxml2-devel –y
yum install libjpeg libpng freetype libjpeg-devel libpng-devel freetype-devel
1、./configure '--with-apxs2=/usr/local/apache/bin/apxs' '--prefix=/usr/local/php' '--with-iconv' '--with-mysql' '--with-mysqli' '--with-gd' '--with-zlib' '--with-jpeg-dir=/usr/local/modules/jpeg'
2、make
3、make install
Mysql
Yum install mysql.x86_64 mysql.x86_64 mysql-server.x86_64 mysql-libs.x86_64
配置Apache
Cd /etc/httpd/conf
Vim httpd.conf
添加内容
ServerName 127.0.0.1
include /etc/httpd/conf/vhost_*.conf
Addtype application/x-httpd-php .php
Addtype application/x-httpd-php-source .phps
创建配置文件
Vim vhost_5aixue.com.conf
内容为:
ServerName test1.5aixue.com
ServerAlias test1.5aixue.com
DocumentRoot /home/aixue/public_html
ErrorLog /var/log/test.5aixue.com_error_log
CustomLog /var/log/test.5aixue.com_access_log combined
#ScriptAlias /cgi-bin/ /gitecroot/aixue/cgi-bin/
DirectoryIndex index.php index.html index.htm index.php4 index.php5
Options -Indexes +IncludesNOEXEC +FollowSymLinks
allow from all
AllowOverride All
#
#allow from all
#
将aixue包解压到/home下,
Cd /home/aixue/public_html/system/config
Vim config.php
修改两项内容:
WEBROOT','/home/aixue/public_html/
LOCAL_IP','192.168.10.103
Vim db_config.php
修改数据库用户名和密码
导入数据库。