当前位置: 首页 > news >正文

新开传奇网站发布网单职业网页布局怎么设计

新开传奇网站发布网单职业,网页布局怎么设计,成都APP 微网站开发,用国外服务器做违法网站通过shell脚本分析部署nginx网络服务 1.接收用户部署的服务名称 [rootlocalhost xzy]# vim 1.sh [rootlocalhost xzy]# chmod x 1.sh [rootlocalhost xzy]# ./1.sh2.判断服务是否安装 已安装#xff1b;自定义网站配置路径为/www#xff1b;并创建共享目录和网页文件…通过shell脚本分析部署nginx网络服务 1.接收用户部署的服务名称 [rootlocalhost xzy]# vim 1.sh [rootlocalhost xzy]# chmod x 1.sh [rootlocalhost xzy]# ./1.sh2.判断服务是否安装 已安装自定义网站配置路径为/www并创建共享目录和网页文件重启服务 没有安装安装对应的软件包 #!/bin/bash# 1. 接收用户部署的服务名称 read -p 请输入您部署的服务名称: service_name service_name$(echo $service_name | tr -d \b) # 去除退格键# 判断 Nginx 是否已安装 if command -v nginx /dev/null thenecho Nginx 已经安装。# 2. 自定义网站配置echo 自定义网站配置路径为 /www。# 创建共享目录和网页文件sudo mkdir -p /www/htmlif [ $? -eq 0 ]; thenecho 共享目录 /www/html 创建成功。elseecho 创建共享目录 /www/html 失败请检查权限。exit 1fisudo echo htmlheadtitle$service_name/title/headbodyh1Welcome to $service_name/h1/body/html /www/html/index.htmlif [ $? -eq 0 ]; thenecho 网页文件 /www/html/index.html 创建成功。elseecho 创建网页文件 /www/html/index.html 失败请检查权限。exit 1fi# 确保配置目录存在if [ -d /etc/nginx/sites-available ]; thenecho 配置目录 /etc/nginx/sites-available 已存在。elsesudo mkdir -p /etc/nginx/sites-availableif [ $? -ne 0 ]; thenecho 创建配置目录 /etc/nginx/sites-available 失败请检查权限。exit 1fiecho 配置目录 /etc/nginx/sites-available 创建成功。fiif [ -d /etc/nginx/sites-enabled ]; thenecho 配置目录 /etc/nginx/sites-enabled 已存在。elsesudo mkdir -p /etc/nginx/sites-enabledif [ $? -ne 0 ]; thenecho 创建配置目录 /etc/nginx/sites-enabled 失败请检查权限。exit 1fiecho 配置目录 /etc/nginx/sites-enabled 创建成功。fi# 配置 Nginx 以使用自定义路径sudo tee /etc/nginx/sites-available/$service_name.conf EOF server {listen 80;server_name localhost;location / {root /www/html;index index.html;} } EOFif [ $? -eq 0 ]; thenecho Nginx 配置文件 /etc/nginx/sites-available/$service_name.conf 创建成功。elseecho 创建 Nginx 配置文件 /etc/nginx/sites-available/$service_name.conf 失败请检查路径。exit 1fi# 创建符号链接使配置生效sudo ln -sf /etc/nginx/sites-available/$service_name.conf /etc/nginx/sites-enabled/if [ $? -eq 0 ]; thenecho 符号链接创建成功。elseecho 创建符号链接失败请检查路径。exit 1fi# 重启 Nginx 服务sudo systemctl restart nginx.serviceecho 已重启 Nginx 服务。# 3. 测试 Nginx 服务是否成功运行if sudo systemctl status nginx.service | grep -q active (running); thenecho Nginx 服务已成功启动。echo 可以通过浏览器访问地址 http://localhost 来查看您的网站。elseecho Nginx 服务没有成功启动。echo ----------- 配置文件内容如下 -----------sudo cat /etc/nginx/sites-available/$service_name.conffi else# 2. 没有安装 Nginx安装对应的软件包echo Nginx 未安装开始安装 Nginx。sudo yum install nginx -y # 判断安装是否成功if command -v nginx /dev/nullthenecho Nginx 安装完成。# 创建共享目录和网页文件sudo mkdir -p /www/htmlif [ $? -eq 0 ]; thenecho 共享目录 /www/html 创建成功。elseecho 创建共享目录 /www/html 失败请检查权限。exit 1fisudo echo htmlheadtitle$service_name/title/headbodyh1Welcome to $service_name/h1/body/html /www/html/index.htmlif [ $? -eq 0 ]; thenecho 网页文件 /www/html/index.html 创建成功。elseecho 创建网页文件 /www/html/index.html 失败请检查权限。exit 1fi# 确保配置目录存在if [ -d /etc/nginx/sites-available ]; thenecho 配置目录 /etc/nginx/sites-available 已存在。elsesudo mkdir -p /etc/nginx/sites-availableif [ $? -ne 0 ]; thenecho 创建配置目录 /etc/nginx/sites-available 失败请检查权限。exit 1fiecho 配置目录 /etc/nginx/sites-available 创建成功。fiif [ -d /etc/nginx/sites-enabled ]; thenecho 配置目录 /etc/nginx/sites-enabled 已存在。elsesudo mkdir -p /etc/nginx/sites-enabledif [ $? -ne 0 ]; thenecho 创建配置目录 /etc/nginx/sites-enabled 失败请检查权限。exit 1fiecho 配置目录 /etc/nginx/sites-enabled 创建成功。fi# 自定义网站配置sudo tee /etc/nginx/sites-available/$service_name.conf EOF server {listen 80;server_name localhost;location / {root /www/html;index index.html;} } EOFif [ $? -eq 0 ]; thenecho Nginx 配置文件 /etc/nginx/sites-available/$service_name.conf 创建成功。elseecho 创建 Nginx 配置文件 /etc/nginx/sites-available/$service_name.conf 失败请检查路径。exit 1fi# 创建符号链接使配置生效sudo ln -sf /etc/nginx/sites-available/$service_name.conf /etc/nginx/sites-enabled/if [ $? -eq 0 ]; thenecho 符号链接创建成功。elseecho 创建符号链接失败请检查路径。exit 1fi# 启动 Nginx 服务sudo systemctl start nginx.serviceecho 已启动 Nginx 服务。# 3. 测试 Nginx 服务是否成功运行if sudo systemctl status nginx.service | grep -q active (running); thenecho Nginx 服务已成功启动。echo 可以通过浏览器访问地址 http://localhost 来查看您的网站。elseecho Nginx 服务没有成功启动。echo ----------- 配置文件内容如下 -----------sudo cat /etc/nginx/sites-available/$service_name.conffielseecho Nginx 安装失败请检查您的网络连接和 YUM 源配置。fi fi 3.测试 判断服务是否成功运行 已运行访问网站 未运行提示服务未启动并显示自定义的配置文件内容
http://www.w-s-a.com/news/353379/

相关文章:

  • 青岛网站推wordpress主题切换
  • 天元建设集团有限公司资质郑州网站seo推广
  • 免费网站后台管理系统模板下载百度网盘app下载安装
  • 开封网站建设培训郑州高端网站建设哪家好
  • 东莞哪家做网站很有名的公司即墨专业医院网站制作公司
  • 做面食网站china cd wordpress
  • 门户网站 营销优秀建筑模型案例作品
  • 训做网站的心得体会范文中山市 有限公司网站建设
  • 服装电子商务网站建设过程与实现两学一做学习教育网站
  • 住房和城建设网站怎么用源码建站
  • 监理工程师证查询网站百度关键词优化软件网站
  • 关于建筑建设的网站asp网站建设报告书
  • 服务二级公司网站建设平台销售模式有哪些
  • 南昌县建设局网站微信分销小程序开发
  • 网站设计师需要什么知识与技能wordpress个性
  • 做茶叶网站的目的和规划有什么做照片书的网站
  • 开福区城乡建设局门户网站关键词挖掘查询工具爱站网
  • 网站建设全国排名沈阳seo按天计费
  • 成都公司网站设计无锡seo网站推广费用
  • 建网站平台要多少钱购物网站界面设计策划
  • 学完js了可以做哪些网站长沙建站官网
  • 怎么样做问卷网站多少钱英语
  • 房产网站建设方案建筑公司是干什么的
  • wordpress建的大型网站柳州市网站建设
  • 石家庄做网站的公司有哪些微信自媒体网站建设
  • 池州哪里有做网站注册公司有哪些风险
  • 做古代风格头像的网站对网站政务建设的建议
  • 网站搜索栏怎么做设计个网站要多少钱
  • 阿里巴巴网站建设目标wamp wordpress
  • 自己做的网站怎么挂网上金蝶erp