部署lnmp环境,安装typecho博客
安装nginx和PHP环境
root@cby:~# apt install nginx php7.4 php7.4-mysql php7.4-fpm
修改nginx配置文件
root@cby:~# vim /etc/nginx/sites-available/default
root@cby:~# cat /etc/nginx/sites-available/default
server {
listen 80;
listen [::]:80;
#填写域名或者IP
server_name www.oiox.cn;
# SSL configuration
#
#开启ssl证书监听端口
listen 443 ssl;
listen [::]:443;
#配置证书
ssl_certificate /var/www/ssl/www.oiox.cn_nginx/www.oiox.cn_bundle.pem;
ssl_certificate_key /var/www/ssl/www.oiox.cn_nginx/www.oiox.cn.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
root /var/www/html;
# 配置默认访问页面
index index.php index.html index.htm index.nginx-debian.html;
#配置访问路径
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
# 配置跳转路由
if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php) {
rewrite (.*) $1/index.php;
}
if (!-f $request_filename) {
rewrite (.*) /index.php;
}
#配置PHP访问路由
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
# With php-cgi (or other tcp sockets):
#fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_intercept_errors on;
}
}
# 配置其他的域名访问
server {
listen 80;
listen [::]:80;
server_name aliyun.chenby.cn;
root /var/www/cby;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}
root@cby:~#
启动服务并设置开机自启
root@cby:~# nginx -t
root@cby:~# systemctl restart nginx
root@cby:~# systemctl enable php7.4-fpm
Synchronizing state of php7.4-fpm.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable php7.4-fpm
root@cby:~#
root@cby:~#
root@cby:~# systemctl enable nginx
Synchronizing state of nginx.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable nginx
root@cby:~#
安装docker,并使用docker启动MySQL服务
root@cby:~# curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
root@cby:~# mkdir /mysql
root@cby:~# cd /mysql
root@cby:/mysql# docker run -p 3306:3306 --name mymysql --restart=always -v $PWD/conf:/etc/mysql/conf.d -v $PWD/logs:/logs -v $PWD/data:/var/lib/mysql -e MYSQL\_ROOT\_PASSWORD=Cby123.. -d mysql:5.7
#登录MySQL数据库执行创建数据库
create database typecho;
部署typecho
root@cby:~# cd /var/www/html/
root@cby:/var/www/html# wget https://typecho.org/downloads/1.1-17.10.30-release.tar.gz
root@cby:/var/www/html# tar xvf 1.1-17.10.30-release.tar.gz
root@cby:/var/www/html# mv build/* .


https://blog.csdn.net/qq_33921750
https://my.oschina.net/u/3981543
https://www.zhihu.com/people/chen-bu-yun-2
https://segmentfault.com/u/hppyvyv6/articles
https://juejin.cn/user/3315782802482007
https://space.bilibili.com/352476552/article
https://cloud.tencent.com/developer/column/93230
https://www.jianshu.com/u/0f894314ae2c
https://www.toutiao.com/c/user/token/MS4wLjABAAAAeqOrhjsoRZSj7iBJbjLJyMwYT5D0mLOgCoo4pEmpr4A/
知乎、CSDN、开源中国、思否、掘金、哔哩哔哩、腾讯云、简书、今日头条
部署lnmp环境,安装typecho博客的更多相关文章
- 使用LNMP环境安装typecho博客的全程记录
虽然我是搞asp.net的 但是十分欣赏php,php有很多开源的博客程序 比如大名鼎鼎的Wordpress.还有各种独立博客大牛使用的z-blog,以及短小精悍的emblog. wordpress臃 ...
- LNMP环境搭建Wordpress博客
目录 LNMP架构工作原理 yum源安装 网站源包安装 LNMP是Linux Nginx MySQL/MariaDB Php/perl/python 的简称,是近些年才逐渐发展起来的构架,发展非常迅 ...
- LNMP环境搭建wordpress博客及伪静态
WordPress是使用PHP语言开发的博客平台,是一款开源的软件,用户可以在支持PHP和MySQL数据库的服务器上架设属于自己的网站.也可以把 WordPress当作一个内容管理系统(CMS)来使用 ...
- LNMP环境搭建之php安装,wordpress博客搭建
LNMP环境搭建之php安装,wordpress博客搭建 一.介绍: 1.什么是CGI CGI全称是"通用网关接口"(Common Gateway Interface),HTTP服 ...
- 使用“宝塔一键迁移”工具,将typecho博客迁移到京东云cvm云主机
作者:京东科技 林中 服务器更换.网站搬家,对于很多开发者新手来说不是一件容易的事情,需要迁移网站程序.数据库,修改数据库连接文件等.在云迁移方案中,宝塔是非常简单好用的服务器运维面板,能够极大提升运 ...
- 手动部署LNMP环境(CentOS 7)
手动部署LNMP环境(CentOS 7) 一.修改 yum 源 [root@localhost ~]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/e ...
- ubuntu安装hexo博客
ubuntu下安装hexo博客 一 安装git sudo apt-get install git 二 安装nodejs 官网下载linux安装包.tar.gz文件 解压 tar zxvf 这样变可以切 ...
- 【转载】Centos系统快速部署LNMP环境
PHP语言在Linux系统上运行的时候,需要在Linux系统上部署相应的Nginx.MySQL.PHP等环境,只有将这些环境参数都设置好,PHP相关应用程序才可正常运行,部署环境的方法有很多种,可手动 ...
- Typecho博客转移服务器,数据备份.
目录 Typecho博客转移服务器,数据备份. 简述操作(有基础的mjj看这个简述就可以了.) 详细步骤(建议小白来看, 已经在很多详细方面进行说明了.) 备份篇 备份导入与数据库转移篇 重新部署ty ...
- 基于Netbeans的安卓Android开发环境配置 - CSDN博客
原文:基于Netbeans的安卓Android开发环境配置 - CSDN博客 基于Netbeans的安卓Android开发环境配置 一.准备工作 NetBeans 勾选网页中的Accept-选择对应系 ...
随机推荐
- centos7 系统运行中做raid磁盘阵列
插入磁盘 lsblk查看磁盘总体情况 对sdb1等需要做的硬盘进行制作 fdisk /dev/sdb 开始 n 创建 p 给资源回车 重选代码 t 确认磁盘阵列代码 fd 保存w 首先安装工具 mda ...
- linux学习之vi
vi 删除当前行dd 删除当前行及下面内容 dG 删除第2行到第3行2d 3d 删除指定行,删除第5行 5dd 删除当前行以下3行 d3
- Reincarnation
HDU4622 Now you are back,and have a task to do: Given you a string s consist of lower-case English l ...
- Python笔记(5)——if 语句一:条件测试(Python编程:从入门到实践)
每条if语句的核心都是一个值为True或False的表达式.Python根据条件测试的值为True还是False来决定是否执行if语句中的代码.如果条件测试的值为True,Python就执行紧跟在if ...
- STM32F103使用FSMC对接正点原子3.5寸TFTLCD屏幕
fsmc的使用算是32里面有点绕的一个知识点,但是想明白了其实也没啥了. 首先我先放32个0在这儿: 0000 0000 0000 0000 0000 0000 0000 0000 [3 ...
- vue中的普通函数与箭头函数以及this关键字
普通函数 普通函数指的是用function定义的函数 var hello = function () { console.log("Hello, Fundebug!"); } 箭头 ...
- 1006.Django模型基础01
一.Django的ORM简介 1. ORM概念:对象关系映射(Object Relational Mapping): 2. ORM优势:不用直接编写SQL代码,只需像操作对象一样从数据库操作数据. d ...
- 三、Applied visual design(应用视觉设计)
一.文本属性整理 <style> h2 { /* 文字对齐属性 text-align */ /* center:居中,left,right:居左居右,justify:文字拉伸铺满一行 */ ...
- spacy
官方文档: https://spacy.io/api Spacy功能简介 可以用于进行分词,命名实体识别,词性识别等等,但是首先需要下载预训练模型 pip install --user spacy p ...
- C/C++ 数据结构顺序栈的基本操作实现
#include <iostream> #include <Windows.h> using namespace std; #define MAXSIZE 6 //顺序栈的实现 ...