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. SVN的Hooks功能--强制添加注释

    所谓hooks,可以类似 理解Linux内核Netfilter框架的hook点和hook函数的概念.当用户在维护代码的过程中,其执行的相关动作正好触发了相关hook点,就 会去执行对应hook点的脚本 ...

  2. List中的Contains方法内部其实是用对象的equals方法做比较,所以如果比较两个类就重写类的equals方法即可;而Set是调用equals和hashCode

    public class Person { private String name; private int age; public String getName() { return name; } ...

  3. 转载mysql数据库配置优化

    网上有很多的文章教怎么配置MySQL服务器,但考虑到服务器硬件配置的不同,具体应用的差别,那些文章的做法只能作为初步设置参考,我们需要根据自己的情况进行配置优化,好的做法是MySQL服务器稳定运行了一 ...

  4. Linux应急响应入侵排查思路

    0x00 前言 ​ 当企业发生黑客入侵.系统崩溃或其它影响业务正常运行的安全事件时,急需第一时间进行处理,使企业的网络信息系统在最短时间内恢复正常工作,进一步查找入侵来源,还原入侵事故过程,同时给出解 ...

  5. iOS开发--UIButton 设置圆角 边框颜色 点击回调方法

    UIButton *signBtn = [UIButton buttonWithType:UIButtonTypeCustom]; signBtn.frame = CGRectMake(, , , ) ...

  6. 原:Myeclipse10+Egit+bitbucket实现版本控制

    1.首先在https://bitbucket.org注册账号,建立仓库(repository),这部分有问题的可以看https://confluence.atlassian.com/display/B ...

  7. JSON类库 Flexjson学习

    官方地址(需FQ):http://flexjson.sourceforge.net/ Flexjson 是一个将 Java 对象转成 JSON 的 类库,是一个深度转换的过程. 下面是我写的一个例子: ...

  8. git上传的文件夹为空的时候

    1,先删除空的文件夹 参考:https://www.cnblogs.com/wang715100018066/p/9694532.html 2,这个只能说是技巧不能说是方法,原理是在每个空文件夹新建一 ...

  9. LeetCode 47 Permutations II(全排列)

    题目链接: https://leetcode.com/problems/permutations-ii/?tab=Description   给出数组,数组中的元素可能有重复,求出所有的全排列   使 ...

  10. sonarqube插件开发(二) 开发插件

    一.环境准备 java 1.8, maven 3.1 检查自己的环境是否支持 sonarqube的插件开发 java -version mvn -version 二.创建maven项目 pom.xml ...