基于RHEL5.2使用编译包搭建LAMP平台

 1.安装APACHE+PHP+MYSQL

1apache 安装:安装版本为http-2.2.6 

 

# 首先安装gcc软件包

# tar zxvf http-2.2.6.tar.gz

# cd http-2.2.6

# ./configure --prefix=/usr/local/apache2 --enable-so \

--with-mpm=worker --enable-rewrite  --enable-cgi \

--enable-suexec \

--with-suexec-caller=daemon \

--with-suexec-docroot=/usr/local/apache2/htdocs

# make && make install

 

 

2mysql安装:安装版本为:mysql-5.0.22

 

# useradd –M –s /sbin/nologin mysql

# 在安装mysql之前,首先安装gcc-c++ncursesncurses-develtermcap

# tar zxvf mysql-5.0.22.tar.gz
# cd mysql-5.0.22

# ./configure –prefix=/usr/local/mysql --with-innodb --without-debug \

--with-extra-charsets=gbk --with-extra-charsets=all \

--enable-assembler --with-pthread --enable-safe-client \

--with-client-ldflags=-all-static
# make
# make install

MYSQL配置

# cp /usr/local/mysql/share/my-medium.cnf /etc/my.cnf

# /usr/local/mysql/bin/mysql_install_db –user=mysql

# chown –R root.mysql /usr/local/mysql

# chown –R mysql /usr/local/mysql/var

# echo “/usr/local/mysql/lib/mysql” >> /etc/ld.so.conf

# ldconfig

# /usr/local/mysql/bin/mysqld_safe --user=mysql &

# cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld

# service mysqld status

# export PATH=$PATH:/usr/local/mysql/bin

# echo “export PATH=$PATH:/usr/local/mysql/bin” >> /etc/profile

 

 

3、安装php:安装版本号php-5.2.10


# tar zxvf php-5.2.10.tar.gz
# cd php-5.2.10
# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs \

  --with-jpeg-dir=/usr/local/jpeg6/ --with-png-dir=/usr/local/libpng2 \

  --with-gd --with-freetype-dir=/usr/local/freetype2 \

  --with-zlib-dir=/usr/local/zlib2 --with-mysql=/usr/local/mysql \

  --with-curl=/usr/local/curl --with-gettext=/usr/local/gettext \

  --enable-sockets

# make && make install
# cp php.ini-dist /usr/local/php/lib/php.ini  //
拷贝php配置文件

修改apache配置文件

# #AddType application/x-tar .tgz下添加一行:

     AddType application/x-httpd-php .php

# 查找有没有LoadModule php5_module modules/libphp5.so配置项,如没有请添加

# DirectoryIndex index.html 添加index.php

 

你可能感兴趣的:(linux,职场,lamp,休闲)