1、安装完成linux系统后,关闭防火墙:

[root@localhost ~]# service iptables stop

iptables: Setting chains to policy ACCEPT: nat mangle filte[  OK  ]

iptables: Flushing firewall rules:                         [  OK  ]

iptables: Unloading modules:                               [  OK  ]

[root@localhost ~]# chkconfig iptables off

2、关闭selinux

[root@localhost ~]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

#     enforcing - SELinux security policy is enforced.

#     permissive - SELinux prints warnings instead of enforcing.

#     disabled - No SELinux policy is loaded.

SELINUX=disabled

# SELINUXTYPE= can take one of these two values:

#     targeted - Targeted processes are protected,

#     mls - Multi Level Security protection.

SELINUXTYPE=targeted

3、检查并卸载lamp默认安装环境

[root@dbking rpm]# rpm -qa|grep httpd

[root@dbking rpm]# rpm -qa|grep php

[root@dbking rpm]# rpm -qa|grep mysql

mysql-libs-5.1.71-1.el6.x86_64

[root@dbking rpm]# yum remove mysql-libs-5.1.71-1.el6.x86_64

[root@dbking rpm]# rpm -qa|grep mysql

[root@dbking rpm]#

4、检查编译工具

[root@dbking rpm]# gcc -v

Using built-in specs.

Target: x86_64-redhat-linux

Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux

Thread model: posix

gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)

#yum install libtool-ltdl-devel

#yum install zlib-devel pcre-devel

5、上传源码包并解压

6、安装lamp源码包

./configure 配置

make && make install 编译并安装cp

(1)安装libxml2

[root@dbking /]# cd /rpm/libxml2-2.9.4

[root@dbking libxml2-2.9.4]# ./configure --prefix=/usr/local/libxml2/

[root@dbking libxml2-2.9.4]# make

[root@dbking libxml2-2.9.4]# make install

(2)安装libmcrypt

[root@dbking libltdl]# cd libmcrypt-2.5.8

[root@dbking libltdl]# ./configure --prefix=/usr/local/libmcrypt

[root@dbking libltdl]# make && make install

[root@dbking libltdl]# cd libltdl/

[root@dbking libltdl]# ./configure --enable-ltdl-install

[root@dbking libltdl]# make

[root@dbking libltdl]# make install

(3)安装zlib

[root@dbking zlib-1.2.8]# ./configure

[root@dbking zlib-1.2.8]# make && make install

(4)安装libpng

[root@dbking libpng-1.5.27]# ./configure --prefix=/usr/local/libpng

[root@dbking libpng-1.5.27]# make && make install

(5)安装jpeg

[root@dbking jpeg-9b]# mkdir /usr/local/jpeg9

[root@dbking jpeg-9b]# mkdir /usr/local/jpeg9/bin

[root@dbking jpeg-9b]# mkdir /usr/local/jpeg9/lib

[root@dbking jpeg-9b]# mkdir /usr/local/jpeg9/include

[root@dbking jpeg-9b]# mkdir -p /usr/local/jpeg9/man/man1

[root@dbking jpeg-9b]# ./configure --prefix=/usr/local/jpeg9/ --enable-shared --enable-static

[root@dbking jpeg-9b]# make

[root@dbking jpeg-9b]# make install

(6)安装freetype

[root@dbking freetype-2.6.2]# yum install bzip2-devel libpng-devel

[root@dbking freetype-2.6.2]# ./configure --prefix=/usr/local/freetype --with-bzip2=yes --with-harfbuzz=no

[root@dbking freetype-2.6.2]# make

[root@dbking freetype-2.6.2]# make install

(7)安装autoconf

[root@dbking autoconf-2.10]# ./configure

[root@dbking autoconf-2.10]# make && make install

(8)安装gd

[root@dbking libgd-2.1.1]# ./configure --prefix=/usr/local/gd2/ --with-jpeg=/usr/local/jpeg9/ --with-freetype=/usr/local/freetype/ --with-png=/usr/local/libpng/

[root@dbking libgd-2.1.1]# make

[root@dbking libgd-2.1.1]# make install

(9)安装apache

[root@dbking httpd-2.2.31]# ./configure --prefix=/usr/local/apache2 --sysconfdir=/etc/httpd/ --with-included-apr --disable-userdir --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-static-support

[root@dbking httpd-2.2.31]# make

[root@dbking httpd-2.2.31]# make install

启动apache服务器:[root@dbking httpd-2.2.31]# /usr/local/apache2/bin/apachectl start

配置apache自动启动:#echo "/usr/local/apache2/bin/apachectl start" >> /etc/rc.d/rc.local

[root@dbking rpm]# vim /etc/httpd/httpd.conf

ServerName localhost:80

(10)安装ncurses

[root@dbking ncurses-5.9]# ./configure --with-shared --without-debug --without-ada --enable-overwrite

[root@dbking ncurses-5.9]# make

[root@dbking ncurses-5.9]# make install

[root@dbking ncurses-5.9]# yum install ncurses-devel

(11)安装mysql

参考:http://www.z-dig.com/binary-packages-to-install-mysql-5-5.html

建组、建用户:

[root@dbking mysql]# groupadd mysql

[root@dbking mysql]# useradd -g mysql mysql

解压安装程序:

[root@dbking mysql]# tar -zxvf mysql.tar.gz

[root@dbking mysql]# mv /rpm/mysql /usr/local/mysql

初始化:

[root@dbking mysql]# ./scripts/mysql_install_db --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ --user=mysql

配置文件:

[root@dbking mysql]# cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf

basedir = /usr/local/mysql

datadir = /usr/local/mysql/data

port = 3306

log_error=mysql.err

修改目录权限:

[root@dbking mysql]# chown -R mysql:mysql /usr/local/mysql/

修改环境变量:

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

启动数据库:

[mysql@dbking ~]$ /usr/local/mysql/bin/mysqld --defaults_file=/etc/my.cnf --user=mysql &

设置mysql开机自动启动:

[root@dbking mysql]# cp /usr/local/mysql/support-files/mysql.server /etc/rc.d/init.d/mysqld

[root@dbking mysql]# chown -R root:root /etc/rc.d/init.d/mysqld

[root@dbking mysql]# chmod 755 /etc/rc.d/init.d/mysqld

[root@dbking mysql]# chkconfig --add mysqld

[root@dbking mysql]# chkconfig --list mysqld

mysqld          0:off 1:off 2:on 3:on 4:on 5:on 6:off

[root@dbking mysql]# service mysqld status

ERROR! MySQL is not running

mysql的root用户授权:

mysql> grant all privileges on *.* to 'root'@'%' identified by 'oracle';

Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

mysql> set password for 'root'@'%'=password('oracle');

Query OK, 0 rows affected (0.00 sec)

(12)安装php

[root@dbking php-5.6.22]# ./configure --prefix=/usr/local/php/ --with-config-file-path=/usr/local/php/etc/ --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql/ --with-libxml-dir=/usr/local/libxml2/ --with-jpeg-dir=/usr/local/jpeg9/ --with-png-dir=/usr/local/libpng/ --with-freetype-dir=/usr/local/freetype/ --with-gd --with-mcrypt=/usr/local/libmcrypt/ --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-soap --enable-mbstring=all --enable-sockets  --enable-bcmath --with-gettext

[root@dbking php-5.6.22]# make

[root@dbking php-5.6.22]# make install

生成php.ini文件:

[root@dbking php-5.6.22]# cp /rpm/php-5.6.22/php.ini-production /usr/local/php/etc/php.ini

编辑/etc/httpd/httpd.conf

[root@dbking php-5.6.22]# vim /etc/httpd/httpd.conf

添加: AddType application/x-httpd-php .php .phtml

以及如下红色部分

<IfModule dir_module>

DirectoryIndex index.html index.php

</IfModule>

重启apache服务:

[root@dbking php-5.6.22]# /usr/local/apache2/bin/apachectl stop

[root@dbking php-5.6.22]# /usr/local/apache2/bin/apachectl start

测试php是否安装成功:

[root@dbking htdocs]# cat test.php

<?php

echo phpinfo();

?>

13、安装ZendOptimizer

[root@dbking ZendOptimizer-3.3.0a-linux-glibc21-i386]# pwd

/rpm/tempdir/ZendOptimizer-3.3.0a-linux-glibc21-i386

[root@dbking ZendOptimizer-3.3.0a-linux-glibc21-i386]# ./install.sh

./install.sh: ./php: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

错误原因是64位系统安装了32位程序,可以通过如下命令修正:

[root@dbking ZendOptimizer-3.3.0a-linux-glibc21-i386]# yum install glibc.i686

[root@dbking ZendOptimizer-3.3.0a-linux-glibc21-i386]# ./install.sh

按照提示执行。

发现此种情况:

[root@dbking ZendOptimizer-3.3.0a-linux-glibc21-i386]# ./install.sh

Please, wait ...

Zend Optimizer installation was NOT completed successfully.

Error while executing the dialog utility.

Probable reason - wrong terminal settings.

Please use install-tty instead.

For further assistance, please contact Zend Support at

https://www.zend.com/support/

[To continue, press Enter]

[root@dbking ZendOptimizer-3.3.0a-linux-glibc21-i386]#

执行:

[root@dbking ZendOptimizer-3.3.0a-linux-glibc21-i386]# ./install-tty

14、安装phpmyadmin

[root@dbking rpm]# unzip phpMyAdmin-4.6.2-all-languages.zip

[root@dbking rpm]# mv phpMyAdmin-4.6.2-all-languages /usr/local/apache2/htdocs/phpmyadmin

[root@dbking rpm]# cd /usr/local/apache2/htdocs/phpmyadmin/

cp配置文件:

[root@dbking phpmyadmin]# cp config.sample.inc.php config.inc.php

编辑配置文件,将cookie改为http即可:

修改host为IP地址或主机名(主机名需要配置好才可以)。

15、安装wordpress

[root@dbking rpm]# mv wordpress /usr/local/apache2/htdocs/

[root@dbking wordpress]# cp wp-config-sample.php wp-config.php

[root@dbking wordpress]# vim wp-config.php

输入主机名、用户、密码,然后进行图形界面安装。

LAMP部署流水的更多相关文章

  1. 阿里云轻量应用服务器Lamp部署php工程踩过的坑

    第一次写博客,也不知道写什么,但是想坚持写博客来提升自己,不喜勿喷. 切回正题,使用阿里云的轻量应用服务器Lamp其实非常方便,价格也很便宜,一键购买需要的环境都帮你搭配好了,剩下的就是自己修改一下数 ...

  2. Centos 7 下 LAMP 部署

    一.介绍 LAMP is a combination of operating system and open-source software stack. The acronym of LAMP i ...

  3. 编译LAMP部署动态网站环境

    LAMP动态网站部署架构是由一套 Linux+Apache+MySQL+PHP 组成的动态网站系统解决方案. 以下配置环境为:Linux=RHEL7 --> Apache=2.4.33 --&g ...

  4. 通过LAMP部署phpMyAdmin、wordpress(https)、discuz

    1.安装启动LAMP 安装环境: CentOS Linux release 7.5.1804 安装包: # yum -y install httpd php php-mysql mariadb-ser ...

  5. Oracle HA 之 OGG部署流水

    1.GG组件及其功能简介:    manager进程:总管其他所以进程及处理相应GGSCI命令.    capture进程:从源端的联机日志文件或归档日志文件抓取commit的信息.    sourc ...

  6. LAMP部署

    各组件版本:Linux:CentOS 7 1511 64位 (提前下载)Apache:Apache 2Mysql:MariaDB 5.5.52Php 5.4.16 VMware Workstation ...

  7. 基于hortonworks的大数据集群环境部署流水

    一.ambari及HDP安装文件下载地址: 1.系统 操作系统:CentOS7 2.软件 本次安装采用最新版本: ambari-2.7.0.0 hdp-3.0.0.0 详细信息及下载地址如下: Amb ...

  8. Apache入门篇(四)之LAMP架构部署

    一.LAMP解析 a: apachem: mariadb, mysqlp: php, perl, python 静态资源:静态内容:客户端从服务器获得的资源的表现形式与原文件相同:动态资源:通常是程序 ...

  9. ubuntu 常用生产环境部署配置测试调优

    1,ubuntu monogdb 安装配置 2,ubuntu jdk1.7,tomcat7安装 3,ubuntu LAMP部署 4,mongodb 远程热备份及恢复 使用自带的mongodump和mo ...

随机推荐

  1. 06-Linux RPM 命令参数使用详解

    rpm 执行安装包二进制包(Binary)以及源代码包(Source)两种.二进制包可以直接安装在计算机中,而源代码包将会由 RPM自动编译.安装.源代码包经常以src.rpm作为后缀名. 常用命令组 ...

  2. Java NIO原理 图文分析及代码实现

    Java NIO原理图文分析及代码实现 前言:  最近在分析hadoop的RPC(Remote Procedure Call Protocol ,远程过程调用协议,它是一种通过网络从远程计算机程序上请 ...

  3. MySQL存储过程的异常处理

    阅读目录:存储过程的异常处理 定义异常处理 单一异常处理程序 continue exit 多个异常处理程序 关于错误编号和SQLSTATE码 使用3个处理程序 忽略某一异常的处理 异常处理的命名 异常 ...

  4. React Native汇错归纳(持续更新中……)

    1.2017-10-25: 报错信息:“Cannot find entry file index.android.js in any of roots…..” 解决方法: 1.首先从虚拟机中找问题:看 ...

  5. MVC的初步认识理论

    说起来写博客可以说一个月没来啦,我们狠狠的放假一个月,想一想都奇怪.而是想一下以后的假期还会这样吗?或许这是作为学生的我们的最后一个长的假期啦,以后就要面对工作再也没有寒假暑假之分啦,在这一个月的时间 ...

  6. sqlite3错误码整理

    #define SQLITE_OK /* 成功 | Successful result */ /* 错误码开始 */ #define SQLITE_ERROR /* SQL错误 或 丢失数据库 | S ...

  7. Puppet部署

    一.域名,IP规划  域名:beyond.com puppet master:puppet.sa.beyond.com 192.168.254.254 puppet client:  *.beyond ...

  8. Win8设计——现代设计,可使你的应用脱颖而出的元素

    Microsoft 设计准则 Windows 在现代设计方面遥遥领先.它采用了“真实数字”原则并从瑞士风格和交通枢纽的寻路系统中汲取灵感. 阅读详细信息 设计元素 动态磁贴 动态磁贴向你提供了一个独特 ...

  9. 【PHP】 毫秒级时间戳和日期格式转换

    在并发量搞得情况下.需要开启毫秒级运算 mysql  支持: `create_time` datetime() DEFAULT NULL COMMENT '创建时间', 效果 PHP 代码实现: &l ...

  10. Android Studio 第一次启动配置

    第一次启动AS前,为了避免重新下载新版本的SDK 操作如下: AS启动前,请先将bin目录的idea.properties文件中增加一行:disable.android.first.run=true ...