编译安装最新LAMP平台

前言:总的来说,在httpd2.4.16安装时踩到坑了,问题还没解决!后续更上。本章出现的东西基本上OK


#cd /usr/local/src
1,下载mysql-5-5.45
#wget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.45-linux2.6-x86_64.tar.gz
2,解压
# tar zxvf /usr/local/src/mysql-5.1.40-linux-i686-icc-glibc23.tar.gz
3,移动和重命名
# mv mysql-5.1.40-linux-i686-icc-glibc23 /usr/local/mysql
4,创建mysql用户
# useradd -s /sbin/nologin mysql
5,创建mysql数据文件夹
# cd /usr/local/mysql
# mkdir -p /data/mysql ; chown -R mysql:mysql /data/mysql
6,编译安装
# ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql
7,复制配置文件
# cp support-files/my-large.cnf /etc/my.cnf
8,复制启动脚本文件
# cp support-files/mysql.server  /etc/init.d/mysqld
9,修改启动脚本权限
# chmod 755 /etc/init.d/mysqld
10,修改启动脚本文件mysql目录和数据库目录
#  vim /etc/init.d/mysqld
 “datadir=/data/mysql”
11,添加开机启动
# chkconfig --add mysqld
# chkconfig mysqld on
# service mysqld start
12,启动mysql
# /usr/local/mysql/bin/mysql





apache-2apr安装
# wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.16.tar.gz
#wget http://mirrors.cnnic.cn/apache/apr/apr-1.5.2.tar.gz
#tar -xf apr-1.5.2.tar.gz
#./configure
#make
#make install
#wget http://mirrors.cnnic.cn/apache/apr/apr-util-1.5.4.tar.gz
#tar -xf apr-util-1.5.4.tar.gz
#./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr







apache-2.2.31编译安装:
1,下载httpd.2.2.31
# wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.2.31.tar.gz
2,解压
# tar zxvf httpd-2.4.16.tar.gz 
3,安装依赖包
# yum -y install zlib-devel apr apr-devel
4,编译安装
# cd httpd-2.4.16
./configure \
--prefix=/usr/local/apache2 \
--with-included-apr \
--enable-so \
--enable-deflate=shared \
--enable-expires=shared \
--enable-rewrite=shared \
--with-pcre
#make
#make install
# /usr/local/apache2/bin/apachectl start




php安装:
1,在http://www.php.net/downloads.php下载php-5.6.14
#tar -xf php-5.6.14.tar.bz2
2,安装扩展包
#rpm -ivh "http://www.aminglinux.com/bbs/data/attachment/forum/month_1211/epel-release-6-7.noarch.rpm"
#yum install -y  libmcrypt-devel
# cd php-5.6.14
3,编译
# ./configure \
--prefix=/usr/local/php \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-config-file-path=/usr/local/php/etc  \
--with-mysql=/usr/local/mysql \
--with-libxml-dir \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-iconv-dir \
--with-zlib-dir \
--with-bz2 \
--with-openssl \
--with-mcrypt \
--enable-soap \
--enable-gd-native-ttf \
--enable-mbstring \
--enable-sockets \
--enable-exif \
--disable-ipv6

#make
#make test
#make install
4,复制配置文件
# cp php.ini-production /usr/local/php/etc/php.ini
5,编辑php文件
#vim /usr/local/apache2/conf/httpd.conf
AddType application/x-httpd-php .php
<IfModule dir_module>
    DirectoryIndex index.html index.htm index.php
</IfModule>
ServerName localhost:80打开

注释掉Satisfy Al
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
 #   Satisfy Al
</FilesMatch>

6,启动测试
#/usr/local/apache2/bin/apachectl start
# netstat -lnp |grep httpd

tcp        0      0 :::80                       :::*   LISTEN      7667/httpd

0 分享

您可以选择一种方式赞助本站

支付宝扫码赞助

支付宝扫码赞助

日期: 2015-10-08分类: Web

标签: lamp

发表评论