CentOS6.5下LNMP环境的搭建
接下来我们重启服务器就可以了,重启的过程中,你会发现速度非常快;
安装配置
|
[root@LNAP /]# rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
|
| [root@LNAP /]# yum info nginx 已加载插件:fastestmirror Determining fastest mirrors * base: mirrors.yun-idc.com * extras: mirrors.neusoft.edu.cn * updates: mirrors.neusoft.edu.cn base | 3.7 kB 00:00 extras | 3.4 kB 00:00 extras/primary_db | 37 kB 00:00 nginx | 2.9 kB 00:00 nginx/primary_db | 22 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 4.3 MB 00:05 可安装的软件包 Name : nginx Arch : x86_64 Version : 1.10.3 Release : 1.el6.ngx Size : 861 k Repo : nginx Summary : High performance web server URL : http://nginx.org/ License : 2-clause BSD-like license Description : nginx [engine x] is an HTTP and reverse proxy server, as well as : a mail proxy server.
|
| [root@LNAP /] #yum install nginx -y
........
.......
.......
[root@LNAP /]# service nginx start
Starting nginx: [ OK ]
[root@LNAP /]# chkconfig nginx on //设置nginx开机自启动
|
| Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
|
| server {
listen 443;
server_name localhost; ssl on; ssl_certificate server.crt; ssl_certificate_key server.key;
# ssl_protocols SSLv3 SSLv2 TLSv1 TLSv1.1 TLSv1.2;
# ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
# ssl_prefer_server_ciphers on;
#这些内容根据自己的需求进行更改
}
|
|
server {
listen 80;
server_name www.cloud.com;
rewrite ^(.*)$ https://$host$1 permanent;
location / {
root /data/html/phpwind/;
index index.html index.htm index.php;
}
location ~ \.php$ {
root /data/html/phpwind/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /data/html/phpwind/$fastcgi_script_name;
include fastcgi_params;
}
}
|
|
server {
listen 443;
server_name www.tcloud.com;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
######SSL#############
ssl on;
ssl_certificate /etc/nginx/cert/discuz.crt;
ssl_certificate_key /etc/nginx/cert/discuz.key;
ssl_protocols SSLv3 SSLv2 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;
########SSL模块##########
location / {
root /data/html/phpwind/;
index index.html index.htm index.php;
}
error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
##########PHP模块###########
location ~ \.php$ {
root /data/html/phpwind/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /data/html/phpwind/$fastcgi_script_name;
include fastcgi_params;
}
##########PHP#############
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#location ~ /\.ht {
# deny all;
#}
}
|
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
CentOS6.5下LNMP环境的搭建的更多相关文章
- Linux:LNMP环境的搭建
LNMP环境的搭建 安装DNS服务器 安装DNS服务 yum install bind -y DNS的配置 创建正向解析 以创建一个名为"lsy.com"的正向查找区域为例: 第一 ...
- lnmp环境快速搭建及原理解析
刚开始学习php的时候是在wamp环境下开发的,后来才接触到 lnmp 环境当时安装lnmp是按照一大长篇文档一步步的编译安装,当时是真不知道是在做什么啊!脑袋一片空白~~,只知道按照那么长的一篇文档 ...
- Mac下PHP环境的搭建
Mac下PHP环境的搭建 目录 Mac下PHP环境的搭建(基于XAMPP) phpmyadmin Mac下PHP环境的搭建(基于XAMPP) 下载XAMPP的Mac版 启动Apache Web Ser ...
- myEclipse 8.5下SVN环境的搭建
myEclipse 8.5下SVN环境的搭建 在应用myEclips 8.5做项目时,svn会成为团队项目的一个非常好的工具,苦苦在网上寻求了一下午,终于整合好了这个环境,在这里简单介绍下,希望能为刚 ...
- 记一次Linux下JavaWeb环境的搭建
今天重装了腾讯云VPS的系统,那么几乎所有运行环境都要重新部署了.过程不难懂,但是也比较繁琐,这次就写下来,方便他人也方便自己日后参考参考. 我采用的是JDK+Tomcat的形式来进行JavaWeb初 ...
- CentOS6.8下MySQL MHA架构搭建笔记
转载请注明出处,本文地址:http://www.cnblogs.com/ajiangg/p/6552855.html 以下是CentOS6.8下MySQL MHA架构搭建笔记 IP资源规划: 192. ...
- Ubuntu下hadoop环境的搭建(伪分布模式)
Ubuntu下hadoop环境的搭建(伪分布模式) 一.必要资源的下载 1.Java jdk(jdk-8u25-linux-x64.tar.gz)的下载 具体链接为: http://www.oracl ...
- Windows下UEFI环境的搭建
Windows下UEFI环境的搭建 一.环境准备 1. 安装2012及以上VS https://visualstudio.microsoft.com/ 2.下载NASM 2.13.03 http:/ ...
- Ubuntu系统下lnmp环境搭建和Nginx多站点配置
最近需要使用Ubuntu作为服务器搭建Lnmp环境,顺便将操作过程写下来,与大家分享.如有不足之处,欢迎大家提出不同意见.(本文默认读者已经熟悉相关linux命令的使用,比如创建文件和文件夹,编辑文件 ...
随机推荐
- vue指令v-html示例解析
更新元素的innerHTML,不会作为vue模板编译,可用组件来代替. 在网站上动态渲染任意 HTML 是非常危险的,因为容易导致 xss攻击.只在可信内容上使用 v-html,永不用在用户提交的内容 ...
- CentOS6 安装Sendmail + Dovecot + Squirrelmail
本文记录在本地虚拟机CentOS6上搭建Sendmail + Dovecot + Squirrelmail 的Webmail环境的过程,仅仅是本地局域网的环境测试,不配置DNS, 也没有安全认证,Sq ...
- MAC下的Intellij IDEA常用快捷键
MAC下的Intellij IDEA常用快捷键 alt+f7 : 查找在哪里使用 相当于eclipse的ctrl+shift+G command+alt+f7 : 这个是查找选中的字符在工程中出现的地 ...
- javascript中的时间版运动
前面的话 速度版JS运动是指以速度为参照,随着路程的变化,时间随之变化:而时间版JS运动是指以时间为参照,随着路程的变化,速度随着变化.相较而言,时间版JS运动更为常用.JQ的animate就是时间版 ...
- java静态内部类理解
在Java世界里,经常被提到静态这个概念,static作为静态成员变量和成员函数的修饰符,意味着它为该类的所有实例所共享,也就是说当某个类的实例修改了该静态成员变量,其修改值为该类的其它所有实例所见. ...
- markdownpad生成目录
生成目录 document.addEventListener("DOMContentLoaded", function() { // 生成目录列表 var outline = do ...
- 【Tomcat】停止冗余进程
tomcat多次连续启动,现在通过脚本,一次执行,全部停掉 [root@YFDT-DEM1701-EPMDM ~]# cat tomcat_pid.sh #!/bin/bash cat /dev/nu ...
- IP地址冲突
IP地址冲突问题.. IP地址冲突多数是由于同一局域网内,有2台或者多台电脑设置了同一个本地IP地址,导致局域网内部IP冲突导致,,建议尽量将本地IP地址设置为自动获取--然后查看自动获取的IP地址是 ...
- 7.21.01 if语句
if语句 一个if语句包含一个布尔表达式和一条或多条语句. 语法 if语句的用语法如下: if(布尔表达式) { //如果布尔表达式为true将执行的语句 } 如果布尔表达式的值为true,则执行if ...
- SpringMVC详解(六)------与json交互
Json(JavaScript Object Notation),它是一种轻量级数据交换格式,格式简单,易于读写,目前使用特别广泛.那么这篇博客我们主要谈谈在 SpringMVC 中,如何对 json ...