centos7 安装lamp
1升级gcc4.8以上 yum update gcc
2升级openssl yum update openssl
3安装apache
a 安装apr
./configure --prefix=/usr/local/apr make make install
b 安装apr-util
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
c 安装pcre
./configure --prefix=/usr/local/pcre make make install
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre --enable-module=shared
./configure --prefix=/usr/local/apache2 --enable-modules=all --enable-cache=static --enable-mem-cache=static --enable-file-cache=static --enable-disk-cache=static --
enable-ssl=static --enable-rewrite=static --enable-so
或者
./configure --prefix=/usr/local/apache2 --enable-modules=shared
或者
./configure --prefix=/usr/local/apache2 --enable-mods-shared=all --with-mpm=prefork --enable-cache --enable-file-cache --enable-disk-cache --enable-mem-cache --enable-module=ssl --enable-ssl --with-ssl=/usr/local/openssl/ --enable-rewrite --enable-so --with-pcre=/usr/local/pcre/ --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
4 安装mongodb
a 下载https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.6.tgz
tar -zxvf mongodb-linux-x86_64-3.2.6.tgz
mv mongodb-linux-x86_64-3.2.6.tgz /usr/local/mongodb
mkdir data
mkdir logs
touch mongodb.conf
b vi mongodb.conf
bind_ip=127.0.0.1
port=27017
fork=true
journal=true
dbpath=/usr/local/mongodb/data
logpath=/usr/local/mongodb/logs/mongodb.log
logappend=true
c ./bin/mongo 127.0.0.1:27121
use admin
db.auth("root","root")
d 创建数据库和数据库账户
db.createUser({user:'ssh',pwd:'123456',roles:[{role:'dbOwner',db:'mytest'}]})
e 查看账户是否可用
use mytest
db.auth("ssh","123456");
5安装php7
a yum install gd curl libmcrypt libxml2 libxml2-devel openssl-devel libcurl curl-devel libjpeg-devel libpng libpng-devel freetype freetype-devel libmcrypt-devel
cu
b ./configure --prefix=/usr/local/php7 --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-scan-dir=/usr/local/php7/etc --with-mysql --with-mysqli --with-
pdo-mysql --with-mcrypt --with-gd --with-iconv --with-zlib --with-xmlrpc --with-openssl --with-gettext --with-curl --with-jpeg-dir --with-png-dir --with-
freetype-dir --with-libxml-dir --with-mhash --without-pear --enable-pcntl --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex -- enable-fpm
--enable-mbstring --enable-ftp --enable-zip --enable-sockets --enable-bcmath
c 配置php
cp php.ini-production /usr/local/php7/etc/php.ini
cp sapi/fpm/init.d.php-fpm /etc/init.d/php7-fpm
chmod +x /etc/init.d/php7-fpm
cp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.conf
cp /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php-fpm.d/www.conf
vim /usr/local/php7/etc/php.ini
加入
zend_extension=/usr/local/php7b/php/extensions-debug-non-zts-20151012/opcache.so
启动
/etc/init.d/php7-fpm start
查看PHP版本
/usr/local/php7/bin/php -v
为了安全最好是去掉头信息 X-Powered-By: PHP/7..
则修改 php.ini 文件 设置 expose_php = Off
vim /usr/local/php7/etc/php.ini
找到 expose_php = On
改为 expose_php = Off
d httpd.conf
添加:
<FilesMatch "\.ph(p[2-6]?|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
e 安装mongodb扩展
tar -zxvf mongodb-1.1.6.tgz
cd mongodb-1.1.6
/usr/local/php7/bin/phpize
./configure --with-php-config=/usr/bin/php7/bin/php-config
make && make install
vi php.ini 添加extension=mongodb.so
f 添加zend opcache
zend_extension=/usr/local/php7/lib/php/extensions/no-debug-zts-20151012/opcache.so
opcache.enable=1
opcache.enable_cli=1"
g 安装yaf
tar -zxvf yaf-3.0.2
cd yaf-3.0.2
/usr/local/php7/bin/phpize
./configure --with-php-config=/usr/bin/php7/bin/php-config
make && make install
vi php.ini 添加extension=yaf.so
centos7 安装lamp的更多相关文章
- centos7安装lamp
一.准备工作 1. 下载并安装CentOS7.2,配置好网络环境,确保centos能上网,可以获取到yum源. centos7.2的网络配置: vim /etc/sysconfig/network ...
- CentOS7 安装LAMP环境
1.使用yum安装 yum -y install httpd mysql mysql-server php php-mysql postgresql postgresql-server php-pos ...
- centos7安装 lamp
1.安装apache yum install httpd #根据提示,输入Y安装即可成功安装 systemctl start httpd.service #启动apache systemctl sto ...
- Centos7 安装LAMP以及nextcloud
第一步:安装apache 在centos中 apache叫httpd yum update #更新源 yum install httpd #安装apache systemctl stop firewa ...
- centos7.2 yum安装lamp环境
一.准备工作 1. 下载并安装centos7.2,配置好网络环境,确保centos能上网,可以获取到yum源. centos7.2的下载地址:http://pan.baidu.com/s/1eRT ...
- CentOS 6.5系统使用yum方式安装LAMP环境和phpMyAdmin,mysql8.0.1/mysql5.7.22+centos7,windows mysql安装、配置
介绍如何在CentOs6.2下面使用YUM配置安装LAMP环境,一些兄弟也很喜欢使用编译的安装方法,个人觉得如果不是对服务器做定制,用yum安装稳定简单,何必去download&make&am ...
- centos7源码编译安装lamp/lnmp
centos7源码编译安装lamp/lnmp 进程:是包工头(相当于是个门,只管开门关门,不管门内的事儿) 线程:是各种工种(cpu调度的是线程) 进程 是一件事情, 线程 是 同一个时间范围内 同时 ...
- CentOS7 安装LNMP(Linux+Nginx+MySQL+PHP)
由于工作须要,须要学习php,本来想安装lamp的可是考虑到如今nginxserver有良好的性能且应用广泛. 这里我决定搭建Linux(CentOS7+Nginx+MySQL+PHP)下的webse ...
- Centos7 安装 zabbix3.2
简介: Zabbix的一个很优秀的分布式监控服务器, 它有两部分组成: 1. “zabbix-server”用来收集并且在web端展示数据 2. “zabbix-agent”用来采集数据,发送给ser ...
随机推荐
- java 复制文件
package com.yunfengtech.solution.business; import java.io.*; public class copy { public static void ...
- .NET生成静态页面并分页
因为公司的产品用asp开发, 前一段时间用asp写了一个生成静态页面并分页的程序,但缘于对.net的热爱,写了这个.net下的生成静态页面并分页的程序. 主要的原理就是替换模板里的特殊字符. 1.静态 ...
- 45个android实例源码
分享45个android实例源码,很好很强大http://www.apkbus.com/android-20978-1-1.html andriod闹钟源代码http://www.apkbus.com ...
- 【小错误】ORA-00265: instance recovery required, cannot set ARCHIVELOG mode
1.错误描述:今天在起归档的时候报一下错误: SQL> alter database archivelog; alter database archivelog * ERROR at line ...
- 在VMware下正确克隆CentOS6.5的打开方式
引言 想必用VMware Workstation软件安装虚拟机,作为一个爱"折腾"的攻城狮肯定是千千万万遍的事情.无论是学习还是工作之中,我们都会遇到需要在一台物理主机上运行多台虚 ...
- 自己用C语言写单片机PIC16 serial bootloader
了解更多关于bootloader 的C语言实现,请加我QQ: 1273623966 (验证信息请填 bootloader),欢迎咨询或定制bootloader(在线升级程序). 为什么自己写bootl ...
- UIViewController生命周期
UIViewController生命周期
- GsonUtils.getGson().fromJson() 转泛型集合
List<QiTaFree> qiTaFreeList = GsonUtils.getGson().fromJson(exhiMain.getQiTaFressJson(), new Ty ...
- JCL笔记
本文转自<http://leowzy.iteye.com/blog/888931> ---------------------------------------------------- ...
- day--6_python常用模块
常用模块: time和datetime shutil模块 radom string shelve模块 xml处理 configparser处理 hashlib subprocess logging模块 ...