Chinaunix

标题: LAMP简单配置 [打印本页]

作者: marsren    时间: 2008-05-08 22:34
标题: LAMP简单配置
MySQL 5.0.51a
# cd /usr/local/src
# tar zxvf mysql-5.0.51a-linux-i686.tar.gz
# groupadd mysql
# useradd -g mysql mysql
# ln -s /usr/local/src/mysql-5.0.51a-linux-i686 /usr/local/mysql
# cd /usr/local/mysql
# chown -R mysql .
# chgrp -R mysql .
# scripts/mysql_install_db --user=mysql
# chown -R root .
# chown -R mysql data
# bin/mysqld_safe --user=mysql &

Apache 2.2.8
# cd /usr/local/src
# tar jxvf httpd-2.2.8.tar.bz2
# cd httpd-2.2.8
# ./configure --prefix=/usr/local/apache2 --sysconfdir=/etc/httpd --with-module=so
# make
# make install

PHP 5.2.5
# cd /usr/local/src
# tar jxvf php-5.2.5.tar.bz2
# cd php-5.2.5
# ./configure --prefix=/usr/local/php5 --with-config-file-path=/etc/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql
# make
# make install
# libtool --finish /usr/local/src/php-5.2.5/libs

修改Apache配置文件
# vi /etc/httpd/httpd.conf
AddType application/x-httpd-php .php

如果在安装PHP时出现如下提示:
/php-5.2.5/sapi/cli/php: error while loading shared libraries: /usr/local/mysql/lib/libmysqlclient.so.15: cannot restore segment prot after reloc: Permission denied
解决办法如下:
禁用 SELinux
# vi /etc/sysconfig/selinux
SELINUX=disabled
使用 chcon
# chcon -t texrel_shlib_t /usr/local/mysql/lib/libmysqlclient.so.15

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/60981/showart_681510.html




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2