Ubuntu搭建Http服务器用于下载Ubuntu文件
首先安装Apache
$ sudo apt-get install apache2
Apache2的默认访问端口为80,当端口被占用时需要更改其访问端口
进入apache2的安装目录 /etc/apache2/,修改器ports.conf文件
# If you just change the port or add more ports here, you will likely also # have to change the VirtualHost statement in # /etc/apache2/sites-enabled/000-default.conf#Listen 80 Listen 8001<IfModule ssl_module>Listen 443 </IfModule><IfModule mod_gnutls.c>Listen 443 </IfModule># vim: syntax=apache ts=4 sw=4 sts=4 sr noet
进入 目录 /etc/apache2/sites-available, 修改000-default.conf文件
#<VirtualHost *:80> <VirtualHost *:8001># The ServerName directive sets the request scheme, hostname and port that# the server uses to identify itself. This is used when creating# redirection URLs. In the context of virtual hosts, the ServerName# specifies what hostname must appear in the request's Host: header to# match this virtual host. For the default virtual host (this file) this# value is not decisive as it is used as a last resort host regardless.# However, you must set it for any further virtual host explicitly.#ServerName www.example.comServerAdmin webmaster@localhostDocumentRoot /var/www/html# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,# error, crit, alert, emerg.# It is also possible to configure the loglevel for particular# modules, e.g.#LogLevel info ssl:warnErrorLog ${APACHE_LOG_DIR}/error.logCustomLog ${APACHE_LOG_DIR}/access.log combined# For most configuration files from conf-available/, which are# enabled or disabled at a global level, it is possible to# include a line for only one particular virtual host. For example the# following line enables the CGI configuration for this host only# after it has been globally disabled with "a2disconf".#Include conf-available/serve-cgi-bin.conf </VirtualHost># vim: syntax=apache ts=4 sw=4 sts=4 sr noet
然后重启apache服务器
$ sudo /etc/init.d/apache2 restart
apache服务器的默认目录在/var/www/html,如果想利用http服务器下载文件,需要删除其index.html文件,然后把文件放在该目录即可
但是点击以后又出现一个新问题
You don't have permission to access /config on this server,意识到没有把文件压缩,它是打开了这个网页。把文件压缩就可以下载了
转载于:https://www.cnblogs.com/yuxiaoba/p/9937312.html
Ubuntu搭建Http服务器用于下载Ubuntu文件相关推荐
- ftp linux包,图文详解Ubuntu搭建Ftp服务器的方法(包成功)
一.今天下午由于课程的要求不得已做了Ubuntu搭建Ftp服务器的实验,但是实验指导书还是N年前的技术,网上搜了一大把,都是模模糊糊的! 在百般困难中终于试验成功,特把经验分给大家 希望大家少走弯路! ...
- Ubuntu搭建Anki服务器
Ubuntu搭建Anki服务器 第一步安装Anki 阿里云的服务器,xshell远程登录上 1 #以root用户进行操作 2 3 #安装Akni服务 4 easy_install AnkiServer ...
- Ubuntu搭建kms服务器
Key Management Service(简称:KMS),这个功能是在Windows Vista之后的产品中的一种新型产品激活机制.我们可以利用手里闲置的VPS安装vlmcsd来搭建KMS激活服务 ...
- Ubuntu搭建NFS服务器,NFS协议详细分析
目录 1. Ubuntu搭建NFS服务器 2. NFS协议分析 2.1 实验拓扑: 2.2 在kali抓包分析 1. Ubuntu搭建NFS服务器 NFS(Network FileSystem,网 ...
- ubuntu系统root权限登录下载系统内文件
ubuntu系统root权限登录下载系统内文件 1.找到系统sshd_config 配置文件:/etc/ssh/ sshd_config ,使用vi sshd_config命令进行编辑 2.重新 ...
- C#实现从服务器上下载DLL文件
C#实现从服务器上下载DLL文件,具体代码如下: var fullQualifiedPathToDll = Server.MapPath("/") + "/bin/m ...
- win7局域网自建ftp服务器,win7系统搭建FTp服务器局域网内传输文件的解决教程
win7系统使用久了,好多网友反馈说win7系统搭建FTp服务器局域网内传输文件的问题,非常不方便.有什么办法可以永久解决win7系统搭建FTp服务器局域网内传输文件的问题,面对win7系统搭建FTp ...
- docker使用Inbucket搭建邮件服务器用于接受邮件
docker使用Inbucket搭建邮件服务器用于接受邮件 很多账号在注册的时候,需要邮箱进行验证,之后找回密码等需要.但是它们又有可能给你发垃圾邮件,要是有一个邮箱服务器能接收自己域名下所有的邮件地 ...
- 安卓从服务器中下载pdf文件 然后调用第三方软件WPS Office打开
安卓从服务器中下载pdf文件 然后调用第三方软件WPS Office打开 前提: 高版本想使用Uri.fromFile() file://的形式 需要在onCreate 或init方法中添加下面代码. ...
最新文章
- 这款开源测试神器,圆了我玩游戏不用动手的梦想
- 设置JFrame背景图片
- python字符垂直输出型烟雾机_python+opencv实现水平投影和垂直投影
- VTK:vtkAssembly用法实战
- Arrays.asList()返回的ArrayList,这是Arrays里内嵌的一个私有静态类,而并不是java.util.ArrayList类
- mysql 字符串搜_mysql – 在表中搜索字符串的SQL查询?
- 如何在 Mac 上下载 macOS Monterey public beta 6?
- paip.简化字-手写参考二简字..共98个
- 猿创征文|C++软件开发值得推荐的十大高效软件分析工具
- unity2018关联不到vs_Unity和VS2019下载及配置流程
- 北京师范大学c语言题库,北京师范大学C语言题库.doc
- 微信朋友圈分享详细步骤html,微信如何转发朋友圈图文(朋友圈转发图文教程分享)...
- bh1750采集流程图_多路BH1750光强检测系统的设计
- LayUI项目之(查询会议签字)
- [转]NSIS常用代码整理
- 到了2020年,技术水平到底需要达到怎样的程度才能成为顶级的阿里P8架构师
- 累死你的不是工作,而是工作方式
- 相机标定(基础)20221204
- java自动违例设计,如何在Java中创建自己的违例
- 关于新书《修炼之道:.NET开发要点精讲》的各种说明