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

专业网站定制团队佛山快速排名

专业网站定制团队,佛山快速排名,wordpress 商城小程序,抓取网站源码怎么做镜像如果你想拥有你从未拥有过的东西,那么你必须去做你从未做过的事情 想要在网页上访问到代码那么就需要用到应用服务类中间件,国外的有Nginx,Tomcat等,国内的有金蝶web,东方通的服务中间件(Tongweb&#xff0…

 如果你想拥有你从未拥有过的东西,那么你必须去做你从未做过的事情

想要在网页上访问到代码那么就需要用到应用服务类中间件,国外的有Nginx,Tomcat等,国内的有金蝶web,东方通的服务中间件(Tongweb)等等,今天就来介绍和安装一下Nginx~~~~

目录

一、查询我的公网出网IP

二、服务架构框架

三、Nginx服务安装

发现无法访问页面???

关闭防火墙

四、Nginx服务管理

五、部署一个好看的前端界面


💬欢迎交流:在学习过程中如果你有任何疑问或想法,欢迎在评论区留言,我们可以共同探讨学习的内容。你的支持是我持续创作的动力!

👍点赞、收藏与推荐:如果你觉得这篇文章对你有所帮助,请不要忘记点赞、收藏,并分享给更多的小伙伴!你们的鼓励是我不断进步的源泉!

🚀推广给更多人:如果你认为这篇文章对你有帮助,欢迎分享给更多对Linux感兴趣的朋友,让我们一起进步,共同提升!

一、查询我的公网出网IP

[root@web01 heavenly-music-master]#curl cip.cc
IP  : ***.**.**.***
地址  : 中国  北京
运营商 : 联通
​
数据二 : 中国北京北京 | 联通
​
数据三 : 中国北京北京市 | 联通
​
URL : http://www.cip.cc/ ***.**.**.***
[root@web01 heavenly-music-master]#
我们公司的出网IP我不方便透露,你们自己试试吧~~~~

二、服务架构框架

LNMP架构Linxu Nginx MySQL PHP
LNMT架构Linxu Nginx MySQL Tomcat
LAMP架构Linxu Apache MySQL PHP
LNMP架构Linxu Nginx MySQL Python

三、Nginx服务安装

方法1.编译安装
方法2.epel安装,版本较低,配置不易读,不建议使用默认为1.20
方法3.通过官网仓库安装
​
通过官网编译安装nginx(1.26版本)
下载网址
https://nginx.org/en/download.html
​
也可以使用wget命令
[root@web01 code]#wget https://nginx.org/download/nginx-1.26.2.tar.gz

[root@web01 ~]#ls
公共  视频  文档  音乐  anaconda-ks.cfg            initial-setup-ks.cfg
模板  图片  下载  桌面  heavenly-music-master.zip  nginx-1.26.2.tar.gz
​
新建目录
[root@web01 ~]#mkdir /usr/local/web-tool
​
将解压好的包移动到刚刚新建的目录下并改名
[root@web01 ~]#mv nginx-1.26.2 /usr/local/web-tool/nginx
​
进入目录
[root@web01 ~]#cd /usr/local/web-tool/nginx
[root@web01 nginx]#ls
auto  CHANGES  CHANGES.ru  conf  configure  contrib  html  LICENSE  man  README  src
​
检查与编译
[root@web01 nginx]#./configure 
checking for OS+ Linux 4.19.90-52.15.v2207.ky10.x86_64 x86_64
checking for C compiler ... found+ using GNU C compiler+ gcc version: 7.3.0 (GCC) 
​
……
​
creating objs/Makefile
​
Configuration summary+ using system PCRE2 library+ OpenSSL library is not used+ using system zlib library
​nginx path prefix: "/usr/local/nginx"nginx binary file: "/usr/local/nginx/sbin/nginx"nginx modules path: "/usr/local/nginx/modules"nginx configuration prefix: "/usr/local/nginx/conf"nginx configuration file: "/usr/local/nginx/conf/nginx.conf"nginx pid file: "/usr/local/nginx/logs/nginx.pid"nginx error log file: "/usr/local/nginx/logs/error.log"nginx http access log file: "/usr/local/nginx/logs/access.log"nginx http client request body temporary files: "client_body_temp"nginx http proxy temporary files: "proxy_temp"nginx http fastcgi temporary files: "fastcgi_temp"nginx http uwsgi temporary files: "uwsgi_temp"nginx http scgi temporary files: "scgi_temp"安装编译
[root@web01 nginx]#make
make -f objs/Makefile
make[1]: 进入目录“/usr/local/web-tool/nginx”
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/event/quic -I src/os/unix -I objs \-o objs/src/core/nginx.o \src/core/nginx.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/event/quic -I src/os/unix -I objs \-o objs/src/core/ngx_log.o \src/core/ngx_log.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/event/quic -I src/os/unix -I objs \-o objs/src/core/ngx_palloc.o \src/core/ngx_palloc.c
……
​
[root@web01 nginx]#sudo make install
make -f objs/Makefile install
make[1]: 进入目录“/usr/local/web-tool/nginx”
test -d '/usr/local/nginx' || mkdir -p '/usr/local/nginx'
test -d '/usr/local/nginx/sbin' \|| mkdir -p '/usr/local/nginx/sbin'
test ! -f '/usr/local/nginx/sbin/nginx' \|| mv '/usr/local/nginx/sbin/nginx' \'/usr/local/nginx/sbin/nginx.old'
cp objs/nginx '/usr/local/nginx/sbin/nginx'
test -d '/usr/local/nginx/conf' \|| mkdir -p '/usr/local/nginx/conf'
cp conf/koi-win '/usr/local/nginx/conf'
cp conf/koi-utf '/usr/local/nginx/conf'
cp conf/win-utf '/usr/local/nginx/conf'
test -f '/usr/local/nginx/conf/mime.types' \|| cp conf/mime.types '/usr/local/nginx/conf'
cp conf/mime.types '/usr/local/nginx/conf/mime.types.default'
test -f '/usr/local/nginx/conf/fastcgi_params' \|| cp conf/fastcgi_params '/usr/local/nginx/conf'
​
​
启动nginx查看是否安装成功
[root@web01 nginx]#/usr/local/nginx/sbin/nginx
进入浏览器输入IP+端口(端口默认80)

发现无法访问页面???

关闭防火墙

contos7以后系统默认使用fairewalld防火墙,不需要默认关闭iptables
但是银河麒麟是两种防火墙同时使用的,小屁最早陷入了思维误区,一直没想到iptables的问题,经原厂工程师的提醒关闭iptables防火墙就可以访问啦!!!
关闭两道防火墙之后记得关闭开机自启呦~~~~
[root@web01 nginx]#systemctl stop firewalld.service 
[root@web01 nginx]#systemctl stop iptables
[root@web01 nginx]#systemctl disable firewalld.service 
[root@web01 nginx]#systemctl disable iptables
当然在生产环境不建议这么玩(可以学习一下防火墙开口的策略)

 

四、Nginx服务管理

[root@web01 nginx]#cat nginx.conf 
# 核心区块
user  nginx;                # 启动nginx的虚拟用户 默认已经存在了
worker_processes  auto;     # 启动子进程的数量 auto以cpu的内核数为准
error_log  /var/log/nginx/error.log notice; # 错误日志所在的日志
pid        /var/run/nginx.pid;              # 进程PID所存放的目录
# 事件模块
events {worker_connections  25532;              # 进程的最大连接数
}# http模块
http {
include       /etc/nginx/mime.types;    # 媒体类型
default_type  application/octet-stream; # 默认如果媒体类型中不存在,则自动下载该页面
log_format  main  '$remote_addr - $remote_user [$time_local] "$request" ''$status $body_bytes_sent "$http_referer" ''"$http_user_agent" "$http_x_forwarded_for"';
access_log  /var/log/nginx/access.log  main;   # nginx的访问日志
sendfile       on;       #文件高效传参
#tcp_nopush    on;      
keepalive_timeout  65;      #长连接的超时时间                    
#gzip  on;                    #是否开启压缩
include /etc/nginx/conf.d/*.conf;              # 包含了conf.d目录下所有的.conf  将*.conf内容移动到了当前的文件中
}
主机配置文件:
[root@web01 conf.d]#nginx.conf
#可以放在最后倒数第二行
server {listen 80;server_name www.game.com;location / {root /code/;index index.html index.htm;}
# 包含了conf.d目录下所有的.conf  将*.conf内容移动到了当前的 
}
修改完成之后使用nginx -t检查语法
[root@web01 ~]#/usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
​
重载nginx(可以重启,但是不建议那么做,重载是热加载,重启是关闭之后再启动)
/usr/local/nginx/sbin/nginx -s reload
​
查看nginx版本
[root@web01 ~]#/usr/local/nginx/sbin/nginx -v
nginx version: nginx/1.26.2
​
第五步:检查服务端口是否开启
[root@web01 conf.d]#netstat -tnulp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address       
tcp        0      0 0.0.0.0:80          0.0.0.0:*
​
​
​
Nginx启动方式:两种启动方式(编译安装需要自己写脚本,我写了但是有点问题等写好再粘过来)
systemctl start nginx   #systemctl启动进程
systemctl stop nginx    #停止进程
​
​
​
第二种:没有被systemctl所管理:使用绝对路径运行
#启动脚本是在
# /usr/local/nginx/sbin/nginx
#启动,
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
#停止
/usr/local/nginx/sbin/nginx -s stop
#重载
/usr/local/nginx/sbin/nginx -s reload
#杀掉nginx
/usr/local/nginx/sbin/nginx -s quit
​
​
[root@web01 ~]#/usr/local/nginx/sbin/nginx
[root@web01 ~]#netstat -tnulp|grep 80
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      22956/nginx: master 

五、部署一个好看的前端界面

[root@web01 ~]#vim /usr/local/nginx/conf/nginx.conf
#倒数第二行写入下面的内容
……
#}server {listen 81;#server_name www.game.com;location / {root /code/heavenly-music-master;index index.html index.htm;}
# 包含了conf.d目录下所有的.conf  将*.conf内容移动到了当前的 }
#注意要放到最后一行花括号“}”里
}
​
下载代码
https://gitee.com/ymhkali/heavenly-music/repository/archive/master.zip
​
我下载到了/root目录下
[root@web01 ~]#ls
公共  视频  文档  音乐  anaconda-ks.cfg            initial-setup-ks.cfg
模板  图片  下载  桌面  heavenly-music-master.zip  nginx-1.26.2.tar.gz
​
解压代码包
[root@web01 code]#unzip /root/heavenly-music-master.zip -d /code/
Archive:  /root/heavenly-music-master.zip
bc49cdda7c39e0c2224655e28ccb5d74a068259dcreating: /code/heavenly-music-master/creating: /code/heavenly-music-master/CSS/inflating: /code/heavenly-music-master/CSS/album.css  inflating: /code/heavenly-music-master/CSS/index.css  inflating: /code/heavenly-music-master/CSS/my_music.css  inflating: /code/heavenly-music-master/CSS/play.css  inflating: /code/heavenly-music-master/CSS/playlist_detail.css  
……inflating: /code/heavenly-music-master/images/音乐小图标1.png  inflating: /code/heavenly-music-master/images/音乐背景.jpg  inflating: /code/heavenly-music-master/images/音乐背景图片.jpg  inflating: /code/heavenly-music-master/index.html  
[root@web01 code]#ls
heavenly-music-master
[root@web01 code]#cd heavenly-music-master/
[root@web01 heavenly-music-master]#ls
CSS  Files  images  index.html  JS  LICENSE  README.md
​
重载
[root@web01 code]#/usr/local/nginx/sbin/nginx -s reload

今天对nginx的编译安装和服务部署讲解就告一段落了,下次分享一点深入的nginx知识~~~~

我的nginx安装参考了这位作者,可以去看一看他的博客:麒麟系统—— openKylin 安装 Nginx_麒麟系统安装nginx-CSDN博客


想成为大佬,就要从小白开始,从0开始,一点一点的积累,慢慢成长,明天你就是大佬!!想学习更多麒麟操作系统的知识,关注小屁,让你成为运维老鸟~~~~~ 

http://www.15wanjia.com/news/19142.html

相关文章:

  • 厦门seo排名公司如何进行网站性能优化?
  • 做头条信息流要网站吗怎么做网站免费的
  • iapp网站做软件教程seo快速排名多少钱
  • 做网站推广排名上海seo优化公司bwyseo
  • wordpress关闭评论窗口百色seo快速排名
  • 网站管理后台下载南昌百度快速排名提升
  • 创意图案设计网站sem工作原理
  • 给了几张图让做网站seo入门培训课程
  • 用手机搭建自己的网站网络seo优化公司
  • 网站内容建设方案网络营销和推广的方法
  • 企业门户网站武汉网站营销seo方案
  • 青岛仿站定制模板建站营销网站类型
  • 我做的网站打开慢怎么处理最好的小说网站排名
  • 申论政府建设网站seo教程自学网
  • wordpress站长之家关键词优化包含
  • 中文域名转换英文域名网站内部seo优化包括
  • 网站建设工作室图片网易疫情实时最新数据
  • 网站流量达到多少网络营销的期末试题及答案
  • 网站备案流程公安阜平网站seo
  • 知名的网站建设公司营业推广是一种什么样的促销方式
  • 如何做jquery音乐网站网站源码
  • 常德天鹰建设有限公司网站泉州全网推广
  • b2b门户网站北京网站优化平台
  • 东莞百度推广排名网站seo视频狼雨seo教程
  • 吴兴区建设局网站凡科建站手机版登录
  • 网站建设i rsky站长统计app软件下载2021
  • 站长之家域名查询大全口碑营销方案
  • 网站外链接自己可以怎么做济南seo优化公司助力网站腾飞
  • 莱芜网站建设服务win10优化
  • 哈尔滨网站制作公司电话关键词查网站