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. Dubbo -- 系统学习 笔记 -- 示例 -- 多版本

    Dubbo -- 系统学习 笔记 -- 目录 示例 想完整的运行起来,请参见:快速启动,这里只列出各种场景的配置方式 多版本 当一个接口实现,出现不兼容升级时,可以用版本号过渡,版本号不同的服务相互间 ...

  2. [转]PHP判断字符串是纯英文、纯汉字或汉英混合(GBK)

    PHP判断字符串是否为中文(或英文)的方法,除了正则表达式判断和拆分字符判断字符的值是否小于128 外还有一种比较特别的方法. 使用php中的mb_strlen和strlen函数判断 方法比较简单:分 ...

  3. js精准时间迭代器(定时器)

    /** * 精准时间迭代器 * Create By Tujia @2017.05.22 * * 使用示例: * window.setMyInterval(function(){ * console.l ...

  4. js 获取ISO-8601格式时间字符串的时间戳

    function getTimeStamp(isostr) { var parts = isostr.match(/\d+/g); return new Date(parts[0]+'-'+parts ...

  5. RF变量列表类型@{}和${}列表类型的关系

    总结:@{}列表类型和${}列表类型都可以表示list类型,均可以通过 set variable 和 create list 创建,区别主要是展示格式和引用格式: @{}类型可以通过 set vari ...

  6. Twitter 高并发高可用架构

    解决 Twitter的“问题”就像玩玩具一样,这是一个很有趣的扩展性比喻.每个人都觉得 Twitter很简单,一个菜鸟架构师随便摆弄一下个可伸缩的 Twitter就有了,就这么简单.然而事实不是这样, ...

  7. link常用的作用

    1 引入样式 2设置网页标题上面图标

  8. vs 2010中如何检查内存泄露

    首先,在文件头添加下面的内容: #ifdef _DEBUG#define DEBUG_CLIENTBLOCK new( _CLIENT_BLOCK, __FILE__, __LINE__)#else# ...

  9. 【LeetCode OJ】Longest Substring Without Repeating Characters

    题目链接:https://leetcode.com/problems/longest-substring-without-repeating-characters/ 题目:Given a string ...

  10. DLL注入之Appinit_Dlls

    AppInit_DLLs is a mechanism that allows an arbitrary list of DLLs to be loaded into each user mode p ...