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

59网一起做网站苏州疫情最新通知

59网一起做网站,苏州疫情最新通知,网站调用优酷视频去除广告,专业企业网站制作第十六次7.29 1.静态页面 1安装httpd [rootweb ~]# yum -y install httpd 2.真机访问页面 [rootweb html]# echo "静态html文件" > index.html 传入照片再次访问 静态资源,根据开发着保存在项目资源目录中的路径访问静态页面的资源 2.Apache 1.安…

第十六次7.29

1.静态页面

1安装httpd
[root@web ~]# yum -y install httpd
2.真机访问页面
[root@web html]# echo "静态html文件" > index.html

传入照片再次访问

静态资源,根据开发着保存在项目资源目录中的路径访问静态页面的资源

2.Apache

1.安装http
[root@http ~]# yum  -y install httpd
2.查看安装情况及安装的资源文件
[root@http ~]# rpm -ql httpd
3.查看配置文件
[root@http ~]# vim /etc/httpd/conf/httpd.conf 
4.启动httpd服务
[root@http ~]# systemctl start httpd
5.查看端口
[root@http ~]# netstat -lnput|grep http
tcp6       0      0 :::80                   :::*                    LISTEN      1503/httpd       

不能直接停用防火墙,可以单独打开端口

查看防⽕墙是否启⽤,若启⽤则设置 apache服务可通⾏规则

[root@http ~]# firewall-cmd --zone=public --add-service=http #设置防火墙方向apache
success 

打开服务器不会马上生效,需要重启或重新加载服务

停用防火墙或者打开指定端口

[root@http ~]# firewall-cmd --zone=public -add-port=80/tcp --permanet
6.页面写入
[root@http ~]# touch /var/www/html/index.html
[root@http ~]# mkdir /var/www/html/img/
[root@http ~]# vim /var/www/html/index.html 
<!doctype html>
<html><head><meta charset="utf-8"><title>正方形</title><style>div{background-color:red;width:120px;height:120px;}   </style></head> <body><div>正方形</div>  <img src="img/1.jpg"></body> 
</html>
[root@http ~]# systemctl reload httpd    #重载配置单
7.真机测试

静态文件如果无法在浏览器上访问,就一定无法加载在页面上

3.

1.下载nginx
[root@nginx ~]# wget https://nginx.org/download/nginx-1.27.0.tar.gz
2.解压
[root@nginx ~]# tar -zxvf nginx-1.27.0.tar.gz 
3.开启编译nginx
[root@nginx nginx-1.27.0]# cd nginx-1.27.0
[root@nginx ~]# yum -y install pcre-devel openssl-devel make gcc gcc-devel
./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-stream
[root@nginx nginx-1.27.0]# make && make install
[root@nginx nginx-1.27.0]# useradd -s /bin/nologin -M nginx
[root@nginx nginx]# cp -r conf/ conf.bak
[root@nginx nginx]# ./sbin/nginx 
[root@nginx nginx]# netstat -lnput|grep nginx
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      14100/nginx: master
​
4.开放端口
[root@nginx nginx]# firewall-cmd --zone=public --add-port=80/tcp --permanent
success
5.重载防火墙
[root@nginx nginx]# firewall-cmd --reload
success
6.启动和关闭nginx服务
[root@nginx nginx]# ln -s /usr/local/nginx/sbin/nginx /usr/bin/
[root@nginx nginx]# ls -l /usr/bin/nginx
lrwxrwxrwx. 1 root root 27 7月  29 16:15 /usr/bin/nginx -> /usr/local/nginx/sbin/nginx
[root@nginx nginx]# nginx    #80端口被占用
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
^C
[root@nginx nginx]# nginx -s stop
[root@nginx nginx]# netstat -lnput|grep nginx
[root@nginx nginx]# nginx
[root@nginx nginx]# netstat -lnput|grep nginx   #已启用
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      14194/nginx: master 
./nginx #启动
./nginx -s stop  #关闭
./nginx -s reload  #重新启动

指令在命令行使用,是因为在$PATH目录中能找到这个可执行文件

7.脚本启动nginx服务
[root@nginx nginx]# vim ~/nginx.sh
#!/bin/bash
/usr/local/sbin/nginx  &> /dev/null
netstat -lnput|grep nginx
if [ $? -eq 0 ];thenecho "ningx正在执行,或者是80被占用"
​
fi
[root@nginx nginx]# nginx
[root@nginx nginx]# source ~/nginx.sh
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      14232/nginx: master 
ningx正在执行,或者是80被占用
[root@nginx nginx]# nginx -s stop
[root@nginx nginx]# source ~/nginx.sh
​

8.

[root@nginx nginx]# vim /usr/lib/systemd/system/nginx.service
[Unit]
Description=nginx
After=network.target
​
[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/usr/local/nginx/sbin/nginx -s stop
PrivateTmp=Flase
​
[Install]
WantedBy=multi-user.target
​
[root@nginx nginx]# systemctl daemon-reload
[root@nginx nginx]# systemctl stop nginx
[root@nginx nginx]# systemctl restart nginx
​
9.真机测试

监控模块

[root@nginx nginx]# vim /usr/local/nginx/conf/nginx.conf   #添加47        location /status{48          stub_status on;49          access_log off;50 }51 
[root@nginx nginx]# nginx

虚拟配置

http://www.rdtb.cn/news/20156.html

相关文章:

  • 上海网站制作网络推广方法免费网站免费
  • 企业网网页aso安卓优化
  • 有口碑的南昌网站制作网络营销过程步骤
  • 银川网站建设银川百度实名认证
  • 白山网络推广上海百度搜索优化
  • 泰安网站开发公司湘潭网站设计外包服务
  • 商家在网站做淘宝客会给佣金吗淘宝seo搜索引擎原理
  • 一般的美工可以做网站吗优化关键词怎么做
  • 个人网站可以做健康付费知识最新清远发布
  • 除了wordpress还有什么可以建站seo搜索引擎优化试题
  • 学做视频的网站合川网站建设
  • 政府网站源码石家庄整站优化技术
  • 网站备案为什么这么慢中国站长工具
  • 网站建设易网宣html网页制作app
  • 第一个做网站的是谁中国网站排名查询
  • 战鼓网h5在线制作标题关键词优化技巧
  • 网站所有页面只显示域名百度指数api
  • 做网页的网站叫什么东莞网络营销
  • 可以做微信推送的网站北京谷歌seo公司
  • 免费网站建设市场专业代写软文
  • 帮企业做网站的公司seo搜索引擎优化业务
  • 下模板做网站互联网推广营销方案
  • 找人做小程序要多少钱seo自学网官方
  • 丹东建设安全监督网站站长工具ping检测
  • 辽宁建设银行官方网站制作一个app软件需要多少钱
  • 电子商务网站建设与开发百度视频排名优化
  • 做网站 图片显示不出来北京网站建设东轩seo
  • 免费网站制作app怎么找精准客户资源
  • 怎么做网站底部备案号企业网站管理系统怎么操作
  • 国家安全部内设机构aso苹果关键词优化