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

上上海网站建设设计网站 缓存方式

上上海网站建设设计,网站 缓存方式,多用户商城系统价格,网站建设要钞钱搭建简单文件服务器 基于centos7.9搭建http文件服务器基于centos7.9搭建nginx文件服务器基于ubuntu2204搭建http文件服务器 IP环境192.168.200.100VMware17 基于centos7.9搭建http文件服务器 安装httpd [rootlocalhost ~]# yum install -y httpd关闭防火墙以及selinux [roo… 搭建简单文件服务器 基于centos7.9搭建http文件服务器基于centos7.9搭建nginx文件服务器基于ubuntu2204搭建http文件服务器 IP环境192.168.200.100VMware17 基于centos7.9搭建http文件服务器 安装httpd [rootlocalhost ~]# yum install -y httpd关闭防火墙以及selinux [rootlocalhost ~]# systemctl stop firewalld;setenforce 0文件/etc/httpd/conf/httpd.conf中的默认参数自定义修改 DocumentRoot /var/www/html #这一行指定了文档根目录Directory /var/www #用于针对指定目录在这里是/var/www设置访问控制规则的开始标签。以下的配置将应用于/var/www目录及其子目录。AllowOverride None# Allow open access:Require all granted #表示允许所有人访问/var/www目录及其子目录没有访问限制 /DirectoryListen 80 #默认的监听端口修改80后则需要指定IP:端口进行访问注释/etc/httpd/conf.d/welcome.conf文件下的此内容不然就会返回禁止访问报错 #LocationMatch ^/$ # Options -Indexes # ErrorDocument 403 /.noindex.html #/LocationMatch文件服务器下创建测试文件 [rootlocalhost ~]# echo hello /var/www/html/test.txt启动httpd并设置开机自启 [rootlocalhost ~]# systemctl enable --now httpd访问界面如下 此时的文件服务器还不能下载点击后会打开该文件 编辑http.conf文件追加以下内容 FilesMatch \.(?i:pdf|zip|txt|csv)$Header set Content-Disposition attachment /FilesMatch当有人请求以 .pdf、.zip、.txt 或 .csv 结尾的文件时服务器会设置 Content-Disposition 标头强制 将文件作为附件下载而不是在浏览器中直接打开如果还要添加例如tar、gz等文件后缀可以下载 则需要在括号内添加(?i:pdf|zip|txt|csv|gz|tar)相应的后缀[rootlocalhost ~]# systemctl restart httpd此时重新打开无痕模式浏览器或者清除缓存再次打开 完善文件服务器的浏览器界面在http.conf的Directory标签中添加 Options Indexes启用目录索引允许显示目录内容。 IndexOptions FancyIndexing启用美化的目录索引以改善目录内容的可读性。 IndexOptions NameWidth允许文件名列宽度自动调整以适应不同文件名的长度。 IndexOptions DescriptionWidth允许描述列宽度自动调整以适应不同文件描述的长度。 IndexOptions FoldersFirst将文件夹显示在文件之前以提高目录索引的可读性。 Directory /var/wwwAllowOverride None# Allow open access:Require all granted #以下为添加内容Options IndexesIndexOptions FancyIndexing NameWidth* DescriptionWidth* FoldersFirst /Directory[rootlocalhost ~]# systemctl restart httpd基于centos7.9搭建nginx文件服务器 安装wget命令需要拉取阿里源的epel源再下载nginx [rootlocalhost ~]# yum install -y wget [rootlocalhost ~]# wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo [rootlocalhost ~]# yum install -y nginx [rootlocalhost ~]# yum info nginx Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile* base: mirrors.cqu.edu.cn* extras: mirrors.cqu.edu.cn* updates: mirrors.cqu.edu.cn Installed Packages Name : nginx Arch : x86_64 Epoch : 1 Version : 1.20.1 Release : 10.el7 Size : 1.7 M Repo : installed From repo : epel Summary : A high performance web server and reverse proxy server URL : https://nginx.org License : BSD Description : Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and: IMAP protocols, with a strong focus on high concurrency, performance and low: memory usage.修改nginx.conf文件 [rootlocalhost ~]# vi /etc/nginx/nginx.conf user nginx; #nginx改为root#在server配置标签上添加以下内容autoindex on;# 显示目录autoindex_exact_size on;# 显示文件大小autoindex_localtime on;# 显示文件时间root /opt; #/opt表示你要共享的文件服务器根目录启动nginx并开机自启 [rootlocalhost ~]# systemctl enable --now nginx Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.浏览器IP访问如果要指定端口修改Linsten后面的80即可 基于ubuntu2204搭建http文件服务器 IP环境192.168.200.200VMware17 安装apache2 roothuhy:~# apt install -y apache2roothuhy:~# mkdir /var/www/html/test-file roothuhy:~# chmod 777 /var/www/html/test-file/ roothuhy:~# echo ok /var/www/html/test-file/test.txt roothuhy:~# vi /etc/apache2/sites-available/000-default.confDocumentRoot /var/www/html/test-file #修改此参数就可以指向该文件夹 roothuhy:~# systemctl enable --now apache2 Synchronizing state of apache2.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable apache2浏览器IP访问 优化界面 roothuhy:~# vi /etc/apache2/apache2.confDirectory /var/www/ #对此目录下生效Options Indexes FollowSymLinksAllowOverride NoneRequire all granted #添加下面两行Options IndexesIndexOptions FancyIndexing NameWidth* DescriptionWidth* FoldersFirst /Directory再次访问 总的来说ubuntu搭建更加简单一些做的配置也不多
http://www.hkea.cn/news/14569224/

相关文章:

  • 南宁网站建设培训做网站后台用什么软件
  • php做的网站怎么入侵alexa
  • 网站开发大致多少钱施工企业的期间费用主要包括哪些
  • asp网站上一篇下一篇代码html网页设计论文2000字
  • 网站速度打开慢的原因山东网站建设哪家专业
  • 百度网盘做视频网站视频号分销解决方案
  • 怎么可以建网站网站 设计 趋势
  • 网站建设运维情况新能源汽车价格表2021
  • 上海微网站万户网络技术
  • 怎么让谷歌收录我的网站ftp中不能打开wordpress
  • 网站抓取qq号码原理北京上地做网站
  • 网站建设的小说中国糕点网页设计网站
  • 网站关键词在哪里做wordpress分类目录样式
  • 网站dns如何修改不了国际新闻最新消息十条2022
  • 山西网站建设企业网站页面太多是否做静态
  • 电子商务烟台网站建设在线设计平台设计师招募
  • 用c语言可以做网站吗营销网络分布情况
  • 网站具有购买功能需要怎么做有空间域名服务器怎么做网站
  • 凌源网站优化中国做铁塔的公司网站
  • 网站维护需要多少钱网站建设一般要多大空间
  • 一站式网站建设方案湖南网站建设联系电话
  • 北京做vr网站咋么做网站在电脑上
  • 为网站开发appwordpress+展开
  • h5移动网站开发校车网站建设
  • 建网站需要多少钱个人特种作业证查询
  • 新乡市网站建设有哪些公司江西赣州最新消息
  • 图片素材网站免费大推荐怎样建一个免费网站
  • 网站站外推广方法新开神途手游发布网站
  • 网站静态化 好处装修素材的网站大全
  • html5网站 欣赏wordpress 附件清理