LAMP 编译安装基本步骤


安装mysql

shell>; groupadd mysql 
shell>; useradd -g mysql mysql
shell>; cd /usr/local
shell>; tar zxvf mysql.tar.gz
shell>; cd mysql
shell>; ./configure –prefix=/usr/local
shell>;make;make install
shell>; scripts/mysql_install_db --user=mysql
shell>; chown -R root .
shell>; chown -R mysql var
shell>; chgrp -R mysql .
shell>; bin/mysqld_safe --user=mysql &
./bin/mysqladmin -u root password "123456" 基于安全的原因,为root用户设置密码才能让root用户登陆mysql,不然会有2002错误出现
建立启动脚本:
cp ./support-files/mysql.server /etc/init.d/mysql

安装apache

tar -zxvf httpd-2.0.54.tar.gz
cd httpd-2.0.54.tar.gz
./configure --prefix=/var/www --enable-so 这个选项一定要有
make && make install
建立启动脚本
cp /var/www/bin/apachectl /etc/init.d/httpd
cd /etc/rc3.d
ln -s ../init.d/httpd S85httpd
ln -s ../init.d/httpd K85httpd

安装php

#./configure --prefix=/usr/local
--with-apxs2=/var/www/bin/apxs
--with-config-file-path=/usr/local
--enable-socket
--with-mysql=/usr/local/mysql
--with-zlib-dir=/usr/include
--with-gd
--enable-mbstring (这个选项一定要有,否则在访问页面的时候会出现mb_ereg()函数未定义的提示)
注意:这些选项是必须的,如果有编译不能通过的情况,请安装相应的包。
#make && make install
cp php.ini-dist /user/local/php.ini
vi /www/conf/httpd.conf
加入:
###############for php and cacti###################
AddType application/x-tar .tgz
AddType application/x-httpd-php .php
AddType image/x-icon .ico
DirectoryIndex index.php index.html index.html.var
#######################over########################
/etc/init.d/httpd restart


posted @ 2009-03-10 16:59  玉米疯收  阅读(904)  评论(2编辑  收藏  举报