(一)安装gcc

  glibc-devel
glibc-headers ==>依赖项
kernel-headers ==>依赖项
libgomp
gcc-c++
libstdc++-devel ==>依赖项

(二)安装zlib压缩库

zlib-1.2..tar.gz
shell> cd /home/shuhua/tar
shell> tar –zxvf zlib-1.2..tar.gz
shell> cd zlib-1.2.
shell> ./configure //这个配置编译命令不要加目录参数
shell>make && make install

(三)安装apache

shell> cd /home/shuhua/tar
shell> tar -jxvf httpd-2.2..tar.bz2
shell> cd httpd-2.2.
shell>./configure --prefix=/usr/local/http2 \
--enable-modules=all \
--enable-rewrite \
--enable-mods-shared=all \
--enable-so
shell> make && make install

#启动Apache

shell> /usr/local/http2/bin/apachectl start

#测试apache

浏览器打开: http://虚拟机IP

看到 "it works!",即为成功

配置虚拟主机

1)配置host文件

打开C:/windows/system32/drivers/etc/hosts 文件

增加域名记录

如:

192.168.1.246 www.ec1.com

192.168.1.246 www.ec2.com

2) 增加虚拟主机

vi /usr/local/http2/conf/httpd.conf
取消#Include conf/extra/httpd-vhosts.conf
这一行前面的#号
保存退出

增加虚拟主机记录

 vi /usr/local/http2/conf/extra/httpd-vhosts.conf

<VirtualHost *:>

           ServerAdmin webmaster@dummy-host.example.com

           DocumentRoot "/usr/local/http2/htdocs/ec1"

           ServerName www.ec1.com

           ServerAlias www.dummy-host.example.com

           ErrorLog "logs/dummy-host.example.com-error_log"

           CustomLog "logs/dummy-host.example.com-access_log" common

</VirtualHost>
<VirtualHost *:>

           ServerAdmin webmaster@dummy-host2.example.com

            DocumentRoot "/usr/local/http2/htdocs/ec2"

           ServerName www.ec2.com

           ErrorLog "logs/dummy-host2.example.com-error_log"

           CustomLog "logs/dummy-host2.example.com-access_log" common

</VirtualHost>

3)

      shell> cd /usr/local/http2/htdocs
shell> mkdir ec1 ec2
shell> echo this is ec1.com > ec1/index.html
shell> echo this is ec2.com > ec2/index.html

4)重启apache

/usr/local/http2/bin/apachectl restart

5)浏览器打开www.ec1.com,和www.ec2.com

看到不同的网站内容,虚拟主机创建完毕!

安装图形库,为编译PHP做准备

libxml2-2.7.2.tar.gz

jpegsrc.v8b.tar.gz

libpng-1.4.3.tar.gz

freetype-2.4.1.tar.gz

gd-2.0.35.tar.gz

(四)             安装libxml2

shell> cd /home/shuhua/tar

shell> tar zxvf libxml2-2.7.2.tar.gz

shell> cd libxml2-2.7.2

shell>./configure --prefix=/usr/local/libxml2

shell> make && make install

(五)             安装jpeg8

shell> cd /home/shuhua/tar

shell> tar -zxvf jpegsrc.v8b.tar.gz

shell> cd jpeg-8b

shell>./configure --prefix=/usr/local/jpeg \

--enable-shared --enable-static

shell> make && make install

(六)             安装libpng

shell> cd /home/shuhua/tar

shell> tar zxvf libpng-1.4.3.tar.gz

shell> cd libpng-1.4.3

shell>./configure  #和zlib一样不要带参数,让它默认安装到相应目录

shell> make && make install

(七)             安装freetype

shell> cd /home/shuhua/tar

shell> tar zxvf freetype-2.4.1.tar.gz

shell> cd freetype-2.4.1

shell>./configure --prefix=/usr/local/freetype

shell> make && make install

(八)             安装GD库

shell> cd /home/shuhua/tar

shell> tar -zvxf gd-2.0.35.tar.gz

shell> mkdir -p /usr/local/gd

shell> cd gd-2.0.35

shell>./configure --prefix=/usr/local/gd  \

--with-jpeg=/usr/local/jpeg/   \

--with-png --with-zlib \

--with-freetype=/usr/local/freetype

shell> make && make install

(九)             安装 php5

shell> cd /home/shuhua/tar

shell> tar -jxvf php-5.3.6.tar.bz

shell> cd php-5.3.6

shell>./configure --prefix=/usr/local/php \

--with-apxs2=/usr/local/http2/bin/apxs \

--with-mysql=mysqlnd \

--with-pdo-mysql=mysqlnd \

--with-mysqli=mysqlnd \

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

--with-gd=/usr/local/gd \

--with-zlib --with-libxml-dir=/usr/local/libxml2 \

--with-jpeg-dir=/usr/local/jpeg \

--with-png-dir \

--enable-mbstring=all \

--enable-mbregex \

--enable-shared

shell> make && make install

shell> cp php.ini-development /usr/local/php/lib/php.ini

配置Apache使其支持php

vi /usr/local/http2/conf/httpd.conf

1)        在httpd.conf(Apache主配置文件)中增加:

AddType application/x-httpd-php .php

2)        找到下面这段话:

<IfModule dir_module>

DirectoryIndex index.html

</IfModule>

在index.html 前面添加index.php

3)        建立php测试网页

vi /usr/local/apache2/htdocs/index.php

输入如下内容:

<?php

phpinfo();

?>

4)        重启apache

shell> /usr/local/http2/bin/apachectl restart

5)        再次浏览器查看http://虚拟机IP

如果看到php信息,工作就完成了!

(十)             安装MySQL

1)        编译安装MySQL

shell> cd /home/shuhua/tar

shell> tar -xzvf mysql-5.1.30.tar.gz

shell> cd mysql-5.1.58

shell> ./configure --prefix=/usr/local/mysql \

--with-charset=utf8 \

--with-extra-charsets=gbk,gb2312,binary

shell> mount .....挂载光盘
   shell>
rpm -ivh libtermcap-devel-2.0.8-46....

shell> make && make install

2)       
配置并初始化MySQL

shell> groupadd mysql

shell> useradd 
-g mysql mysql

shell> cp support-files/my-medium.cnf
/etc/my.cnf

shell> cd /usr/local/mysql

shell> chown -R mysql.mysql .

shell> bin/mysql_install_db --user=mysql \

--datadir=/usr/local/mysql/var

shell> chown -R root .

shell> chown -R mysql var

shell> bin/mysqld_safe --user=mysql &

3)       
测试数据库

shell>
bin/mysql –uroot

mysql> show
databases;

4)       
接上步,修改mysql密码(可不做此步,默认无密码)

mysql>UPDATE
user SET

password=PASSWORD('new_password')

WHERE
user='root';

mysql>flush
privileges;

linux - 【LAMP环境配置安装注意安装步骤】 9的更多相关文章

  1. LAMP环境源码编译安装过程

    LAMP环境源码编译安装过程 一.Apache的安装 1.1.apache软件包及依赖包准备 httpd-2.4.29.tar.bz2       apr-1.6.3.tar.gz      apr- ...

  2. win2008 r2 服务器php+mysql+sqlserver2008运行环境配置(从安装、优化、安全等)

    这篇文章主要介绍了win2008 r2 服务器php+mysql+sqlserver2008运行环境配置(从安装.优化.安全等),需要的朋友可以参考下 win2008 r2 安装 http://www ...

  3. JDK和环境配置,eclipse安装与使用

    本博客部分参照https://blog.csdn.net/PGY0000/article/details/79256720 (记住要尊重别人的劳动产品) 原博客给的链接和后面的安装过程有点不一样,不能 ...

  4. lamp环境配置,ubunutu下

    Ubuntu下快速搭建LAMP环境过程记录: 安装 Apache2: sudo apt-get install apache2 安装PHP模块: sudo apt-get install php5 安 ...

  5. Ubuntu 16.04下的LAMP环境配置

    在学习开发过程中,每当遇到新的问题时,通常都能在网上搜到解决的方法,但是网上的方法千千万,有些是已经过时了的,有些是跟自己开发环境不同的,总是不能第一时间能找到答案. 而当时遇到的问题可能在今后的开发 ...

  6. Linux开发环境配置大全

    Linux开发环境配置 零章:通过xshell在linux上安装JDK8 壹章:通过xshell在linux上安装tomcat8 贰章:通过xshell在linux上安装mysql5.7(终极版) 叁 ...

  7. 沁恒CH32F103C8T6(二): Linux PlatformIO环境配置, 示例运行和烧录

    目录 沁恒CH32F103C8T6(一): Keil5环境配置,示例运行和烧录 沁恒CH32F103C8T6(二): Linux PlatformIO环境配置, 示例运行和烧录 StdPeriphLi ...

  8. 【转存】阿里云服务器下 LAMP 环境配置 —— 基于 CentOS 6.3

    阿里云服务器下 LAMP 环境配置 —— 基于 CentOS 6.3  Posted on 2016年2月10日 by  学院君 1.Apache 配置 —————————————————– vi / ...

  9. LAMP环境 源码包安装

    linux的学习很早就开始了,大学的时候的时候有有学过unix,后来每年都有去看看linux,因为在小城市的缘故,很少会实际工作中用到,基本都是智慧云之类的,同事也说,你学起来也用不上,IT生态不好, ...

  10. ubuntu下lamp环境配置及将window代码迁移至linux系统

    因为最近要用需要去实现项目中的一个功能,比较好的做法就是在http://i.cnblogs.com/EditPosts.aspx?opt=1linux中实现.所以最近就将自己的代码全部迁移到linux ...

随机推荐

  1. Rhythmk 学习 Hibernate 07 - Hibernate annotation 实体注解

    参考: http://docs.jboss.org/hibernate/annotations/3.4/reference/zh_cn/html_single/ 1.系统配置: 可以通过使用  map ...

  2. 「小程序JAVA实战」小程序视频展示页开发(52)

    转自:https://idig8.com/2018/09/22/xiaochengxujavashizhanxiaochengxushipinzhanshiyekaifa51/ 这次说下,小程序的视频 ...

  3. 13 MySQL--存储过程

    1.存储过程的介绍 对于存储过程,可以接收参数,其参数有三类: in 仅用于传入参数用 out 仅用于返回值用 inout 既可以传入又可以当作返回值 存储过程包含了一系列可执行的sql语句,存储过程 ...

  4. JavaWeb--过滤器Filter (一)

    过滤器是在服务器上运行的,并且位于请求和响应中间起过滤功能的程序.其工作原理如下图所示:   在与过滤器相关联俄Servlet或JSP运行前,过滤器先执行.一个过滤器可以一个或多个Servlet或JS ...

  5. react-navigation 3.x版本的push、navigate、goback、pop、dispatch等常用方法

    一.方法简介 1. 应用中的每个页面组件都会自动提供 this.props.navigation this.props.navigation可以获取的一些方法: navigate - 转到另一个页面, ...

  6. Spring AOP相关术语

    ---------------------siwuxie095                                 Spring AOP 相关术语         (1)Joinpoint ...

  7. Python:如何排序(sort)

    一.前言 对Python的列表(list)有两个用于排序的方法: 一个是内建方法list.sort(),可以直接改变列表的内容: >>> list1 = [9,8,7,6,5] &g ...

  8. Java 设计模式系列(十四)命令模式(Command)

    Java 设计模式系列(十四)命令模式(Command) 命令模式把一个请求或者操作封装到一个对象中.命令模式允许系统使用不同的请求把客户端参数化,对请求排队或者记录请求日志,可以提供命令的撤销和恢复 ...

  9. Windows下安装Redis及php的redis拓展教程

    一.安装前必读 Windows 64位操作系统 Redis 安装包(版本3.0.5,截止2017-05-29最新redis版本为3.2.9) 注意事项: 1.在window下如果你还需安装php的re ...

  10. mysql 开通远程连接

    使用localhost好用,但是改成ip地址后不好用,执行sql语句做如下修改: update user set host = '%' where user = 'root'; flush privi ...