基于centOS6.7搭建LAMP(httpd-2.4.18+mysql-5.5.47+php-5.6.16)环境
首先确保系统可以联网。设置IP地址以及虚拟机安装linux在此略过。本文采用centos6.7 64位minimal版、php5.6.16、httpd-2.4.18、mysql-5.5.47版搭建lamp环境。默认设置软件下载目录/usr/local/src,软件安装目录/app/local/下,安装顺序是apache→mysql→php。通过搜狐镜像获取apache、mysql、php
搜狐镜像:http://mirrors.sohu.com/
wget http://mirrors.sohu.com/apache/httpd-2.4.18.tar.gz#若是提示没有wget命令则yum -y install wget
wget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.47.tar.gz
wget http://mirrors.sohu.com/php/php-5.6.12.tar.bz2
wget http://www.apache.org/dist/apr/apr-1.5.2.tar.gz
wget http://www.apache.org/dist/apr/apr-util-1.5.4.tar.gz
wget https://sourceforge.net/projects/pcre/files/pcre/8.10/pcre-8.10.tar.gz
wget http://xmlsoft.org/sources/libxml2-2.7.4.tar.gz
wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz
wget ftp://ftp.cn.debian.org/gentoo/distfiles/zlib-1.2.5.1.tar.gz
wget http://zlib.net/zlib-1.2.8.tar.gz
wget https://sourceforge.net/projects/libpng/files/libpng12/1.2.56/libpng-1.2.56.tar.xz
wget http://www.ijg.org/files/jpegsrc.v9b.tar.gz
wget https://sourceforge.net/projects/freetype/files/freetype2/2.4.12/freetype-2.4.12.tar.bz2
wget https://github.com/libgd/libgd/archive/gd-2.1.1.tar.gz
wget http://ftp.ntu.edu.tw/gnu/autoconf/autoconf-2.53.tar.gz
wget https://github.com/libgd/libgd/releases/download/gd-2.1.1/libgd-2.1.1.tar.bz2
wget https://cmake.org/files/v3.1/cmake-3.1.3.tar.gz
首先安装相应的库文件:
yum -y install xz libXpm-devel lua-devel libxslt-devel gcc gcc-c++libjpeg libjpeg-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers
新建相应的目录和用户和用户组:
mkdir -p /app/local/{php,apache,mysql,data}
groupadd -g 500 www
useradd -u 500 -g 500 -G 500 -s /sbin/nologin www
groupadd mysql
useradd -g mysql mysql -s /bin/false
#cd /usr/local/src/
#tar zxvf apr-1.5.2.tar.gz
#cd apr-1.5.2
#./configure --prefix=/usr/local/apr
报错提示:cannot remove `libtoolT’: No such file or directory ,
解决办法:编辑 configure文件,查找 $RM "$cfgfile" 这个地方,用#注释掉,然后就可以了
#./configure --prefix=/usr/local/apr
#make && make install
#cd ../
#tar zxvf apr-util-1.5.4.tar.gz
#cd apr-util-1.5.4
#./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config
#make && make install
#cd../
#tar zxvf pcre-8.10.tar.gz
#cd pcre-8.10
#./configure --prefix=/usr/local/pcre
#make && make install
#cd ../
安装Apache
#tar zxvf httpd-2.4.18.tar.gz
#cd httpd-2.4.18
#./configure --prefix=/app/local/apache --enable-mods-shared=all --enable-so --enable-proxy-ajp --enable-rewrite --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre
#make && make install
#cd ../
#chown -R www:www /app/local/apache/htdocs/
#chmod 755 /app/local/apache/htdocs/
先配置一下httpd.conf
找到;ServerName www.example.com:80
改为ServerName localhost:80
#/app/local/apache/bin/apachectl -k start
报错提示:cannot remove `libtoolT’: No such file or directory ,
解决办法:编辑 configure文件,查找 $RM "$cfgfile" 这个地方,用#注释掉,然后就可以了
#./configure --prefix=/usr/local/libxml2
#make && make install
#cd ../
#tar zxvf libmcrypt-2.5.7.tar.gz
#cd libmcrypt-2.5.7
#./configure --prefix=/usr/local/libmcrypt
#make && make install
#cd ../
#tar zxvf zlib-1.2.8.tar.gz
#cd zlib-1.2.8
#./configure
#make && make install
#cd ../
#xz -d libpng-1.2.56.tar.xz
#tar -xvf libpng-1.2.56.tar
#cd libpng-1.2.56
#./configure --prefix=/usr/local/libpng
#make && make install
#cd ../
#mkdir -p /usr/local/jpeg6/{bin,lib,include,man}
#mkdir /usr/local/jpeg6/man/man1
#tar zxvf jpegsrc.v9b.tar.gz
#cd jpeg-9b/
#./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
#make && make install
#cd ../
#tar jxvf freetype-2.4.12.tar.bz2
#cd freetype-2.4.12
#./configure -prefix=/usr/local/freetype
#make && make install
#cd ../
#tar zxvf autoconf-2.53.tar.gz
#cd autoconf-2.53
#./configure
#make && make install
#cd ../
#tar jxvf libgd-2.1.1.tar.bz2
#cd libgd-2.1.1
#./configure --prefix=/usr/local/gd2 --with-zlib=/usr/local/zlib --with-jpeg=/usr/local/jpeg6 --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype/
#make && make install
#cd ../
#tar jxvf php-5.6.12.tar.bz2
#cd php-5.6.12
#./configure --prefix=/app/local/php --with-config-file-path=/app/local/php/etc --with-apxs2=/app/local/apache/bin/apxs --with-mysql --with-libxml-dir=/usr/local/libxml2 --with-png-dir=/usr/local/libpng --with-jpeg-dir=/usr/local/jpeg6 --with-freetype-dir=/usr/local/freetype --with-gd=/usr/local/gd2 --with-zlib-dir=/usr/local/zlib --with-mcrypt=/usr/local/libmcrypt --with-mysqli --with-xpm-dir=/usr/lib64 --enable-soap --enable-mbstring=all --enable-sockets
#make && make install
#cd ../
#cp /usr/local/src/php-5.6.12/php.ini-production /app/local/php/etc/php.ini
#vi /app/local/php/etc/php.ini
找到;date.timezone
改为date.timezone=PRC
保存退出
配置apache解析php:
#vi /app/local/apache/conf/httpd.conf
找到;ServerName www.example.com:80
改为ServerName localhost:80
找到:AddType application/x-gzip .gz .tgz
在该行下面添加:AddType application/x-httpd-php .php
找到DirectoryIndex index.html
改为:DirectoryIndex index.html index.htm index.php
找到User daemon Group daemon
注释后添加:User www
Group www
找到: Options Indexes FollowSymLinks
修改为:Options FollowSymLinks
找到:AllowOverride None
修改为:AllowOverride All
equire all granted
最后保存退出#/app/local/apache/bin/apachectl -t#测试httpd.conf 如果有错误,会有提示, 如果是正确的则显示为 “Syntax OK”
#/app/local/apache/bin/apachectl start
#ps -ef|grep httpd
root 12130 1259 0 15:49 pts/0 00:00:00 grep httpd
root 23172 1 0 14:13 ? 00:00:00 /app/local/apache/bin/httpd -k start
www 23173 23172 0 14:13 ? 00:00:02 /app/local/apache/bin/httpd -k start
www 23174 23172 0 14:13 ? 00:00:02 /app/local/apache/bin/httpd -k start
www 23175 23172 0 14:13 ? 00:00:02 /app/local/apache/bin/httpd -k start
说明已经启动
#vi /app/local/apache/htdocs/info.php
如图所示


基于centOS6.7搭建LAMP(httpd-2.4.18+mysql-5.5.47+php-5.6.16)环境的更多相关文章
- Centos6.5 搭建LAMP环境
1.Centos6.5 处于对安全的考虑,严格控制网络的进去.所以安装 Apache 或 MySQL 的时候,需要开放 80 或 3306 端口 首先,执行如下命令查看当前防火墙开放了哪些端口: [ ...
- centos6.5搭建LAMP
实验前准备 (1)service iptables stop #关闭防火墙 service iptables status #查看防火墙是否已经关闭 iptabl ...
- centos6.4yum搭建lamp环境
1.配置防火墙,开启80端口.3306端口vi /etc/sysconfig/iptables-A INPUT -m state --state NEW -m tcp -p tcp --dport 8 ...
- 在centos6中编译安装httpd-2.4/搭建LAMP
首先确保centos6安装平台安装一下环境: #yum groupinstall "Development Tools" "Server Platform Develo ...
- CentOS6.5下搭建LAMP+FreeRadius+Daloradius Web管理和TP-LINK路由器、H3C交换机连接,实现,上网认证和记账功能
什么是RADIUS服务: RADIUS:(Remote Authentication Dial In User Service)中文名为远程用户拨号认证服务,简称RADIUS,是目前应用最广泛的AAA ...
- Centos6.4版本下搭建LAMP环境
Centos6.4版本下搭建LAMP环境 配置yum mkdir/mnt/cdrom mount/dev/cdrom /mnt/cdrom 装载光盘 vi /etc/yum.repos.d/Cent ...
- •搭建LAMP环境及快速部署双网站并实现基于域名的虚拟主机
本节所讲内容: 实战:搭建LAMP环境及快速部署双网站并实现基于域名的虚拟主机 LAMP架构:??? Linux+Apache+Mysql+PHP Linux+Apache+Mysql/MariaDB ...
- CentOS6.5下搭建LAMP环境(源码编译方式)
CentOS 6.5安装配置LAMP服务器(Apache+PHP5+MySQL) 学习PHP脚本编程语言之前,必须先搭建并熟悉开发环境,开发环境有很多种,例如LAMP ,WAMP,MAMP等.这里我介 ...
- 基于CentOS7的服务器搭建(LAMP环境)
基于CentOS7的服务器环境搭建(LAMP环境) 一.安装MySQL组件 1.由于在CentOS7中,默认yum安装库中不含有mysql,我们可以下载mysql的分支MariaDB,如果必须要下my ...
随机推荐
- python基础-编码_if条件判断
一.第一句Python代码 在 /home/dev/ 目录下创建 hello.py 文件,内容如下: [root@python-3 scripts]# cat hello.py #!/usr/bin/ ...
- SharePoint 站点集和子站点数据互相读取
1.站点集中可以使用SPSite.AllWeb,然后遍历所有站点的isRootWeb,根据siteTemplate取得需要的子站点. /// <summary> /// Handles t ...
- cmd 下telnet 不是内部或外部命令
问题:cmd 下telnet 提示不是内部或外部命令 解决方案:
- 日期处理-将String 转为Date
package com.test; import java.text.DateFormat; import java.text.ParseException; import java.text.Sim ...
- poj2186 强连通缩点
Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 29773 Accepted: 12080 De ...
- git将本地代码 和服务器git@osc 上的代码 关联
将本地代码 和服务器git@osc 上的代码 关联 要使用git 首先,你得安装一个git 下载 http://git-scm.com/downloads 安装完成后,需要简单的配置一下,打开 Git ...
- bzoj1066
首先,我们可以想到从源点向每个有蜥蜴的地方连边,然后拆点,因为我们不能把一个点连向多条边,这样修改边的时候不可以,所以拆个点,就可以了 #include<iostream> #includ ...
- 【凯子哥带你学Framework】Activity启动过程全解析
It’s right time to learn Android’s Framework ! 前言 学习目标 写作方式 主要对象功能介绍 主要流程介绍 zygote是什么有什么作用 SystemSer ...
- dede使用方法----如何转换时间戳
dede用sql调用一个mysql时间,mysql的时间字段是时间戳展示的,突然不知道咋转换了,有点迷茫,结果找了下,发现其实很简单,直接用dede的就行了,如下: 完整时间:[field:datel ...
- response与文件下载
参考博客: http://www.cnblogs.com/lcpholdon/p/4380980.html http://www.cnblogs.com/mingforyou/p/3281945.ht ...