LAMP部署流水

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

[[email protected] ~]# service iptables stop

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

iptables: Flushing firewall rules:                         [  OK  ]

iptables: Unloading modules:                               [  OK  ]

[[email protected] ~]# chkconfig iptables off

2、关闭selinux

[[email protected] ~]# 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默认安装环境

[[email protected] rpm]# rpm -qa|grep httpd

[[email protected] rpm]# rpm -qa|grep php

[[email protected] rpm]# rpm -qa|grep mysql

mysql-libs-5.1.71-1.el6.x86_64

[[email protected] rpm]# yum remove mysql-libs-5.1.71-1.el6.x86_64

[[email protected] rpm]# rpm -qa|grep mysql

[[email protected] rpm]#

4、检查编译工具

[[email protected] 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

[[email protected] /]# cd /rpm/libxml2-2.9.4

[[email protected] libxml2-2.9.4]# ./configure --prefix=/usr/local/libxml2/

[[email protected] libxml2-2.9.4]# make

[[email protected] libxml2-2.9.4]# make install

(2)安装libmcrypt

[[email protected] libltdl]# cd libmcrypt-2.5.8

[[email protected] libltdl]# ./configure --prefix=/usr/local/libmcrypt

[[email protected] libltdl]# make && make install

[[email protected] libltdl]# cd libltdl/

[[email protected] libltdl]# ./configure --enable-ltdl-install

[[email protected] libltdl]# make

[[email protected] libltdl]# make install

(3)安装zlib

[[email protected] zlib-1.2.8]# ./configure

[[email protected] zlib-1.2.8]# make && make install

(4)安装libpng

[[email protected] libpng-1.5.27]# ./configure --prefix=/usr/local/libpng

[[email protected] libpng-1.5.27]# make && make install

(5)安装jpeg

[[email protected] jpeg-9b]# mkdir /usr/local/jpeg9

[[email protected] jpeg-9b]# mkdir /usr/local/jpeg9/bin

[[email protected] jpeg-9b]# mkdir /usr/local/jpeg9/lib

[[email protected] jpeg-9b]# mkdir /usr/local/jpeg9/include

[[email protected] jpeg-9b]# mkdir -p /usr/local/jpeg9/man/man1

[[email protected] jpeg-9b]# ./configure --prefix=/usr/local/jpeg9/ --enable-shared --enable-static

[[email protected] jpeg-9b]# make

[[email protected] jpeg-9b]# make install

(6)安装freetype

[[email protected] freetype-2.6.2]# yum install bzip2-devel libpng-devel

[[email protected] freetype-2.6.2]# ./configure --prefix=/usr/local/freetype --with-bzip2=yes --with-harfbuzz=no

[[email protected] freetype-2.6.2]# make

[[email protected] freetype-2.6.2]# make install

(7)安装autoconf

[[email protected] autoconf-2.10]# ./configure

[[email protected] autoconf-2.10]# make && make install

(8)安装gd

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

[[email protected] libgd-2.1.1]# make

[[email protected] libgd-2.1.1]# make install

(9)安装apache

[[email protected] 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

[[email protected] httpd-2.2.31]# make

[[email protected] httpd-2.2.31]# make install

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

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

[[email protected] rpm]# vim /etc/httpd/httpd.conf

ServerName localhost:80

(10)安装ncurses

[[email protected] ncurses-5.9]# ./configure --with-shared --without-debug --without-ada --enable-overwrite

[[email protected] ncurses-5.9]# make

[[email protected] ncurses-5.9]# make install

[[email protected] ncurses-5.9]# yum install ncurses-devel

(11)安装mysql

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

建组、建用户:

[[email protected] mysql]# groupadd mysql

[[email protected] mysql]# useradd -g mysql mysql

解压安装程序:

[[email protected] mysql]# tar -zxvf mysql.tar.gz

[[email protected] mysql]# mv /rpm/mysql /usr/local/mysql

初始化:

[[email protected] mysql]# ./scripts/mysql_install_db --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ --user=mysql

配置文件:

[[email protected] 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

修改目录权限:

[[email protected] mysql]# chown -R mysql:mysql /usr/local/mysql/

修改环境变量:

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

启动数据库:

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

设置mysql开机自动启动:

[[email protected] mysql]# cp /usr/local/mysql/support-files/mysql.server /etc/rc.d/init.d/mysqld

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

[[email protected] mysql]# chmod 755 /etc/rc.d/init.d/mysqld

[[email protected] mysql]# chkconfig --add mysqld

[[email protected] mysql]# chkconfig --list mysqld

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

[[email protected] 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

[[email protected] 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

[[email protected] php-5.6.22]# make

[[email protected] php-5.6.22]# make install

生成php.ini文件:

[[email protected] php-5.6.22]# cp /rpm/php-5.6.22/php.ini-production /usr/local/php/etc/php.ini

编辑/etc/httpd/httpd.conf

[[email protected] 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服务:

[[email protected] php-5.6.22]# /usr/local/apache2/bin/apachectl stop

[[email protected] php-5.6.22]# /usr/local/apache2/bin/apachectl start

测试php是否安装成功:

[[email protected] htdocs]# cat test.php

<?php

echo phpinfo();

?>

13、安装ZendOptimizer

[[email protected] ZendOptimizer-3.3.0a-linux-glibc21-i386]# pwd

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

[[email protected] 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位程序,可以通过如下命令修正:

[[email protected] ZendOptimizer-3.3.0a-linux-glibc21-i386]# yum install glibc.i686

[[email protected] ZendOptimizer-3.3.0a-linux-glibc21-i386]# ./install.sh

按照提示执行。

发现此种情况:

[[email protected] 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]

[[email protected] ZendOptimizer-3.3.0a-linux-glibc21-i386]#

执行:

[[email protected] ZendOptimizer-3.3.0a-linux-glibc21-i386]# ./install-tty

14、安装phpmyadmin

[[email protected] rpm]# unzip phpMyAdmin-4.6.2-all-languages.zip

[[email protected] rpm]# mv phpMyAdmin-4.6.2-all-languages /usr/local/apache2/htdocs/phpmyadmin

[[email protected] rpm]# cd /usr/local/apache2/htdocs/phpmyadmin/

cp配置文件:

[[email protected] phpmyadmin]# cp config.sample.inc.php config.inc.php

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

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

15、安装wordpress

[[email protected] rpm]# mv wordpress /usr/local/apache2/htdocs/

[[email protected] wordpress]# cp wp-config-sample.php wp-config.php

[[email protected] wordpress]# vim wp-config.php

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

时间: 2024-10-09 23:47:48

LAMP部署流水的相关文章

Lamp部署于三台主机中

本次试验的目的主要是搭建LAMP部署于三台主机中:一台部署Http的,一台部署php-fpm,一台部署MariaDB..部署前准备好三台主机.     客户端发送请求过程:         当客户端发送静态资源请求时,httpd会自行处理.当客户端发送动态资源的请求时.httpd将自己作为反向代理,将请求发送给php-fpm主机,让其进行处理,当请求发送给php-fpm时,如果需要使用导数据时,通过mysql启动(php-mysql)时其与MariaDB通信:当然事先要授权远程登录才行. 一.部

编译LAMP部署动态网站环境

title: 编译LAMP部署动态网站环境 date: 2018-11-08 19:08:41 tags: Linux 服务配置 categories: Linux 服务配置 copyright: true --- LAMP动态网站部署架构是由一套 Linux+Apache+MySQL+PHP 组成的动态网站系统解决方案. 以下配置环境为:Linux=RHEL7 --> Apache=2.4.33 --> MySQL=5.5 --> PHP=7.0 无错误版. 安装准备环境 ◆安装gcc

LAMP部署-- 二.编译安装Mysql

LAMP组件介绍 LAMP是指Linux.Apache,Mysql以及PHP的简称,目前许多生产环境的都是用的LAMP架构,在网络应用和开发环境方面,LAMP组合是非常棒的,它们的结合提供了强大的功能. Linux作为底层的操作系统,提供了灵活且安全的应用平台,为其他的组件稳定运行提供了保障: Apache作为web服务器,提供了功能强大.稳定与支撑能力突出的web平台: Mysql也是一款优秀的数据库软件: PHP是一种开发脚本语言,可以嵌入HTML中,适用于web开发: 准备工作 操作系统:

Web基础与HTTP协议(LAMP部署基础知识)

Web基础与HTTP协议 一.前言 前端:(玩的是框架)HTML (超文本标记语言) CSS (层叠样式表) JavaScript js (动态语言交互) JSP(与Java有关,前端未必接触) JavaScriptPage VUE(前后端分离) ECHARTS bootstrap--简洁.直观.强悍的前端开发框架,让web开发更迅速.简单 二.域名概述 域名的概念IP地址不易记忆早期使用Hosts文件解析域名主机名称重复主机维护困难DNS (Domain Name System域名系统)分布式

LAMP部署

必备工具 1:Linux系统 2:Apache服务 3:MySQL服务        (是多线程.多用户的SQL数据库管理系统) 4:PHP        (是一种编程语言最初设计生产动态网站) 安装前的准备 1:安装Apache [[email protected] ~]# tar zxf httpd-2.2.17.tar.gz -C /usr/src/ [[email protected] ~]# cd /usr/src/httpd-2.2.17/ [[email protected] ht

Ansible roles实现LAMP部署wordpress

ansible lamp ansible roles实现lamp安装wordpress 整个role目录的结构: .├── ansible.cfg├── hosts├── httpd-php_roles.retry├── httpd-php_roles.yml├── roles│   ├── httpd│   │   ├── files│   │   │   ├── mysql_wp.sh│   │   │   ├── wordpress-4.7.4-zh_CN.tar.gz│   │   │

LAMP部署脚本--安装篇

#!/bin/bash # By Stranded 2015-08-20 CMA_V=cmake-2.8.6 APA_V=httpd-2.2.15 MYS_V=mysql-5.5.22 LIB_V=libmcrypt-2.5.8 MHA_V=mhash-0.9.9.9 MCR_V=mcrypt-2.6.8 PHP_V=php-5.3.28 apache(){ # 判断是否有RPM方式安装的httpd.httpd-manual软件包,如果有则卸载 if [ $(rpm -qa | grep htt

lamp 部署命令

tar zvxf httpd-2.2.21.tar.gz -C /usr/src cd /usr/src/httpd-2.2.21/ ./configure --prefix=/usr/local/apache --enable-so --enable-rewrite make && make install chown 777 /usr/local/apache/htdocs vim /usr/local/apache/conf/httpd.conf ServerName www.jia

搭建lamp 部署owncloud

上传文件 创建dvd文件 yum clean all yum list 关闭防火墙 修改SELINUX     改enforcing改为disabled #cd /opt/dvd/ #yum clean all #yum list #yum install createrepo #createrepo . #ll #vi /etc/yum.repos.d/dvd.repo/dvd.repo 修改yum源如下 #yum install -y httpd php php-mysql mariadb-