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

视频网站建设费用国家城乡住房建设部网站

视频网站建设费用,国家城乡住房建设部网站,单页网站仿制教程,广州番禺伤人案一.Web 为用户提供互联网上浏览信息的服务,web服务是动态的,可交互的。 1.安装httpd yum -y install httpd 2.启动 systemctl start httpd 3.关闭防火墙 systemctl stop firewalld [rootrs html]# echo "我手机号是" > …

一.Web

为用户提供互联网上浏览信息的服务,web服务是动态的,可交互的。

1.安装httpd

yum -y install httpd

2.启动

systemctl start httpd

3.关闭防火墙

systemctl stop firewalld

[root@rs html]# echo "我手机号是" > index.html

[root@rs html]# ls

index.html

4.在浏览器中输入ip地址进行访问

二.http协议

1.http特点:

静态文件和动态文件

生成一个大文件

dd if=/dev/zero of=/var/www/html/a.txt bs=30M count=1

2.UEI和URL的区别

http状态码:

三.Apache

最早的web服务,基于http提供浏览器浏览

1.查看华为云主机所有打开的端口

firewall-cmd --list-ports

2.在虚拟机上停用防火墙,远程主机就无法访问web服务

3.搭建apache服务器

(1)查看安装情况

[root@rs ~]# rpm -qa|grep httpd

(2)配置文件

[root@rs ~]# vim /etc/httpd/conf/httpd.conf

启(3)启动http服务

[root@rs ~]# systemctl start httpd

(4)在浏览器访问

(5)在windows客户端scp一张图到/var/www/html下

[root@rs ~]# cd /var/www/html

[root@rs html]# mkdir img

[root@rs html]# 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/000.jpg" />

        </body>

</html>

(6)在浏览器访问

四.Nginx

开源,轻量级,高性能的http和反向代理服务器

1.特点:占用内存少,并发能力强

2.作用:用来做负载均衡和反向代理

安装nginx

源码编译安装

3.下载源码包

[root@web ~]# wget https://nginx.org/download/nginx-1.26.1.tar.gz

4.解压

[root@web ~]# tar -zxvf nginx-1.26.1.tar.gz

[root@web ~]# yum -y install gcc gcc-c++

[root@web ~]# yum -y install openssl-devel

[root@web ~]# yum -y install pcre-devel

[root@web ~]# yum -y install make

5.编译安装nginx

[root@web nginx-1.26.1]# ./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@web nginx-1.26.1]# make && make install

[root@web nginx-1.26.1]# useradd -s /bin/nologin -M nginx  //创建nginx用户和组不然无法启动

6.检查目录

[root@web nginx-1.26.1]# tree /usr/local/nginx/

7.启动nginx

[root@web nginx]# ./sbin/nginx

8.查看主要配置文件

vim /usr/local/nginx/conf/nginx.conf

9.优化nginx服务控制

[root@web nginx]# ln -s /usr/local/nginx/sbin/nginx /usr/bin/  //做一个软连接

[root@web nginx]# nginx

之所以指令能在命令行使用,是因为在$PATH目录中能找到这个可执行文件或者是可执行文件的链接文件

(1)修改配置文件后重载nginx服务

./nginx -s reload

(2)脚本启动nginx

[root@web nginx]# vim ~/nginx.sh

#!/bin/bash

/usr/local/sbin/nginx &> /dev/null

netstat -lnput|grep nginx

if [ $? -eq 0 ];then

    echo "nginx正在执行,或者80端口被占用"

fi

[root@web nginx]# source ~/nginx.sh

(3)以systemctl控制nginx

[root@web nginx]# ls /usr/lib/systemd/system

[root@web 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@web nginx]# systemctl daemon-reload  //重置systemctl进程

如果使用sbin目录下的nginx,就无法使用systemctl

优化注意事项

10.开启nginx状态监听模块

(1)修改配置文件

[root@web ~]# vim /usr/local/nginx/conf/nginx.conf  //在48行添加

location /status {

            stub_status on;    #nginx状态的监听模块

            access_log off;

        }

(2)重启nginx

[root@web ~]# systemctl reload nginx

(3)在浏览器访问,查看nginx状态信息

192.168.2.35/status

11.nginx虚拟主机配置

⼀个“location”相当于⼀个虚拟主机,也就是⽤户访问⽹站时,

点击跳转的另⼀个⻚⾯。

location 内可以添加 nginx 各种功能模块。

配置多个虚拟主机

[root@server ~]# vim /usr/local/nginx/conf/nginx.conf

......省略部分内容......

server {

listen 80; #监听端⼝

server_name localhost;

charset utf-8;  #中文字符集

#access_log logs/host.access.log main;

location /status {

stub_status on;

access_log off;

}

location / {

root html; #⽹站在服务器上的⽬ 录,默认为/usr/local/nginx/html

index index.html index.htm; #跳转到的⽹站⾸⻚

}

}

......省略部分内容......

[root@server ~]# systemctl restart nginx.service

#重启nginx

12.nginx反向代理

再准备一台机器---tomcat 跟上面一样安装nginx编译并安装

[root@server ~]# wget https://nginx.org/download/nginx-1.26.1.tar.gz

解压

[root@server ~]# tar -zxvf nginx-1.26.1.tar.gz

[root@server ~]# yum -y install gcc gcc-c++

[root@server ~]# yum -y install openssl-devel

[root@server ~]# yum -y install pcre-devel

[root@server ~]# yum -y install make

编译安装nginx

[root@server nginx-1.26.1]# ./configure --prefix=/usr/local/nginx

[root@server nginx-1.26.1]# make && make install

[root@server nginx-1.26.1]# useradd -s /bin/nologin -M nginx

[root@server nginx-1.26.1]# echo "我是后端服务" > /usr/local/nginx/html/index.html

[root@server nginx-1.26.1]# firewall-cmd --zone=public --add-port=80/tcp --permanent //打开端口

success

[root@server nginx-1.26.1]# firewall-cmd --reload  //重新加载防火墙

Success

[root@server nginx-1.26.1]# vim /usr/local/nginx/conf/nginx.conf

[root@server nginx-1.26.1]# /usr/local/nginx/sbin/nginx

http://www.yayakq.cn/news/200130/

相关文章:

  • 浏览器打开肇庆市seo网络推广
  • 网站建设 模块网线制作的注意事项
  • 常州网站制作专题学习网站开发流程
  • 竞馨门户网站开发写wordpress插件吗
  • 有哪些好的做兼职的网站wordpress 蛋花儿
  • 网站源码传到服务器上后怎么做网站架构布局
  • 网站制作论文文献综述成都专业手机网站建设推广
  • 淘宝在哪个网站做推广制作彩票网站需要多少钱
  • 文登南海建设局网站乌托邦网站建设
  • 实用写作网站自己做小程序商城
  • 检察院门户网站建设情况流程网站
  • 陕西省建设厅人力资源网站哪有那样的网站
  • 聊城做企业网站的模板网站制作平台
  • a站下载安装和一起做网店差不多的网站
  • 深圳网站制作建设服务公司建设银行重庆分行网站
  • 邵阳做网站哪个公司好网站产品链接怎么做
  • 建设厅国网查询网站物理网络设计
  • 柳州哪家网站建设专业城市建设管理
  • 沈阳网站建设聚艺科技国内时事新闻2023最新
  • 学网站开发可以创业吗wordpress连接
  • 网站搭建与生成技术教材商务型网站模板
  • 男女做那种的的视频网站网店运营推广实训
  • 阿里云wordpress搭建网站网店装修教程免费模板
  • 邯郸网站制作建设可遇公寓网站哪个公司做的
  • 免费网站开发公司长沙品牌网站制作服务报价
  • 山西网站建设服务公司在线阅读网站开发
  • 找个网站看看h5网站开发定制
  • 有美元进账去外管局网站做啥百度教育app
  • 建设工程英语网站wordpress重新安装博客怎么搬家
  • 58同城如何发布网站建设php做动漫网站