惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
T
Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
Intezer
C
Cyber Attacks, Cyber Crime and Cyber Security
The Register - Security
The Register - Security
量子位
Security Latest
Security Latest
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
MyScale Blog
MyScale Blog
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Spread Privacy
Spread Privacy
Jina AI
Jina AI
博客园 - 【当耐特】
P
Palo Alto Networks Blog
Last Week in AI
Last Week in AI
SecWiki News
SecWiki News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
GRAHAM CLULEY
宝玉的分享
宝玉的分享
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
The Blog of Author Tim Ferriss
V
Vulnerabilities – Threatpost
有赞技术团队
有赞技术团队
T
Tor Project blog
H
Hacker News: Front Page
A
Arctic Wolf
NISL@THU
NISL@THU
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
V
V2EX
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
I
InfoQ
D
Docker
L
LINUX DO - 最新话题
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42

博客园 - 懒牛拉车

xxx tmp Thinkphp 3.2 Cookie丢失导致中英文混排 第一个python自动化实例 Nginx配置文件下载 每次用npm都很烦人 js 判断mac地址是否为组播地址 项目在本地时,css/js文件在浏览器刷新时,从(memory cache)读取,放服务器上就不会 模拟json_decode解析非法utf-8编码字符串 php socket 循环ping ip,显示能ping通的IP地址 thinkphp3.2.2 CheckLangBehavior.class中,使用session无效原因分析 Thikphp 3.2 session页面传递失败问题 火狐autocomplete="off"无效 testlink windows 安装笔记 宝塔面板部署thinkcmf问题 coreseek 測試用例 coreseek 基与Sphinx 的全文索引 centos6 nginx 配置本地https访问 centos6 nginx安装好以后,添加拓展ssl centos6 php7 安装 memcache 和 memcached - 懒牛拉车 centos7 搭建 php7 + nginx (2) - 懒牛拉车
centos7 搭建 php7 + nginx (1)
懒牛拉车 · 2019-10-31 · via 博客园 - 懒牛拉车
  • 前言

曾今,写过几篇类似的文章,但是发现几个月后,自己回头再看的时候,有种支离破碎的感觉。自己写的并不全,所以今天打算写一篇比较详细的文档。争取下次环境的减的时候,只需要拷贝复制粘贴即可完成环境搭建。

这个centos是在vbox虚拟机里面搭建的环境,关于虚拟机搭建centos开发环境可以参考我写的这篇文章。文章详细

  • 安装 nginx

获取nginx最新版下载链接 官网地址 。最好下载稳定版

# 先安装一些基本命令,后面会用到
yum install wget pcre-devel zlib-devel

# 这只是个人喜好。下载文件放在同一个地方
mkdir -p /data/source
cd /data/source

# 下载源码包
wget http://nginx.org/download/nginx-1.16.1.tar.gz

# 解压
tar -zxvf nginx-1.16.1.tar.gz

# 编译
cd /data/source/nginx-1.16.1
./configure --user=nobody --group=nobody --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module

# 安装
make && make install
  • 启动nginx

/usr/local/nginx/sbin/nginx

# 重启
/usr/local/nginx/sbin/nginx –s reload

# 停止
/usr/local/nginx/sbin/nginx –s stop

# 测试配置文件是否正确
/usr/local/nginx/sbin/nginx –t

# 强制关闭
pkill nginx
  • 开启80端口,否则网站无法访问服务器

# 开启
firewall-cmd --zone=public --add-port=80/tcp --permanent

# 防火墙重启
firewall-cmd --reload

# 查看80端口是否开启
firewall-cmd --list-ports
  • 设置开机启动

vi /lib/systemd/system/nginx.service

# 添加代码
[Unit]
Description=nginx
After=network.target
  
[Service]
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/usr/local/nginx/sbin/nginx -s quit
PrivateTmp=true
  
[Install]
WantedBy=multi-user.target

# 保存退出后即可执行如下命令

# 开机启动
systemctl enable nginx.service

# 启动nginx
systemctl start nginx.service 
 
# 停止开机自启动
systemctl disable nginx.service

# 查看服务当前状态
systemctl status nginx.service

# 重新启动服务
systemctl restart nginx.service 

# 查看所有已启动的服务
systemctl list-units --type=service
  • 安装php

安装php