- 论坛徽章:
- 0
|
安装php4.4.1+apache2.0.55+5.0.15具体编译如下:
1.安装 mysql 5.0.15
# tar zxvf mysql-5.0.15.tar.gz
# cd cd mysql-5.0.15
# groupadd mysql
# useradd -g mysql mysql
# CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local/mysql \
--enable-assembler --with-mysqld-ldflags=-all-static --with-charset=gbk
# make
# make install
# cp support-files/my-medium.cnf /etc/my.cnf
# cp support-files/mysql.server /etc/rc.d/init.d/mysqld
# chmod 755 /etc/rc.d/init.d/mysqld
# chkconfig --add mysqld
# cd /usr/local/mysql
# /usr/local/mysql/bin/mysql_install_db --user=mysql
# chown -R root .
# chown -R mysql var
# chgrp -R mysql .
2.安装 apache 2.0.55
# tar jxvf httpd-2.0.55.tar.bz2
# cd httpd-2.0.55
# ./configure --prefix=/usr/local/apache
# make
# make install
设置自启动
# cp support/apachectl /etc/init.d/httpd
修改/etc/init.d/httpd
# vi /etc/init.d/httpd(前面几行改成如下样子)
#!/bin/sh
#
# Startup script for the Apache Web Server
# chkconfig: - 85 15
# description: Apache is a World Wide Web server. It is used to serve \
# HTML files and CGI.
# processname: httpd
# pidfile: /usr/local/apache/log/httpd.pid
# config: /usr/local/apache/conf/httpd.conf
# chkconfig --add httpd
# chmod 755 /etc/init.d/httpd
# chkconfig httpd on
创建网页根目录
# mkdir /var/www
修改apache配置文件
# vi /usr/local/apache/conf/httpd.conf
//存放网页的目录,原来为DocumentRoot "",改成:
DocumentRoot "/var/www"
//这句应该和DocumentRoot 的目录保持一致,原来为<Directory "">,改成:
<Directory "/var/www">
3.安装php 4.4.1
# tar jxvf php-4.4.1.tar.bz2
# cd php-4.4.1
# ./configure \
--prefix=/usr/local/php \
--with-mysql=/usr/local/mysql \
--with-apxs2=/usr/local/apache/bin/apxs
# make
# make install
# cp php.ini-dist /usr/local/php/lib/php.ini
# vi /usr/local/php/lib/php.ini
;default_charset = "iso-8859-1"
在这行下面加一行
default_charset = "gbk"
# vi /usr/local/apache/conf/httpd.conf
找到#AddType application/x-tar .tgz 这行,在下面加两行
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
找到下面一行在后面加上index.php,这表示网站的默认页也能够为index.php
DirectoryIndex index.html index.html.var index.php
然后启动httpd
报错:
[root@localhost modules]# service httpd start
Syntax error on line 233 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/modules/libphp4.so into server: /usr/local/apache/modules/libphp4.so: cannot restore segment prot after reloc: Permission denied
请问怎么解决?
[ 本帖最后由 HonestQiao 于 2006-6-22 13:46 编辑 ] |
|