首页 > 系统相关 >nginx服务

nginx服务

时间:2024-10-30 21:01:16浏览次数:6  
标签:mut 服务 etc nginx conf php ispweb

IspSrv

服务

WEB服务
安装nginx软件包。
创建ispweb.chinaskills.cn站点。
配置文件名为ispweb.conf,放置在/etc/nginx/conf.d/目录下。
网站根目录为/mut/crypt(目录不存在需创建)。
启用FastCGI功能,让nginx能够解析php请求。
index.php内容使用Welcome to 2023 Computer Network Application contest!

安装服务

apt install nginx php* -y

编辑nginx配置文件

cp -p /etc/nginx/sites-enabled/default /etc/nginx/conf.d/ispweb.conf

vim /etc/nginx/conf.d/ispweb.conf

server {
	listen 80 ;
	listen 443 ssl;	#配置https,可选,下面需要证书文件
	include snippets/snakeoil.conf; #配置https,证书文件路径目录
	root /mut/crypt;
	index index.php;
	location ~ \.php$ {
		include snippets/fastcgi-php.conf;
		fastcgi_pass  unix:/run/php/php7.3-fpm.sock;
	}
}

vim /etc/nginx/nginx.conf

64:# include /etc/nginx/sites-enabled/*;

https

AppSrv:
#传递http证书,需要ispsrv开启ssh服务
scp /csk-rootca/httpd.* 81.6.63.100:/ca

vim /etc/nginx/snippets/snakeoil.conf
#添加
ssl_certificate /ca/httpd.pem;
ssl_certificate_key /ca/httpd.key;

编辑网页文件

mkdir -p /mut/crypt

echo "Welcome to 2023 Computer Network Application contest!" > /mut/crypt/index.php

启动服务

systemctl start nginx
systemctl enable nginx

验证

image-20241030210040797

标签:mut,服务,etc,nginx,conf,php,ispweb
From: https://www.cnblogs.com/Laken/p/18516608

相关文章