首先安装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/-default.conf #Listen
Listen <IfModule ssl_module>
Listen
</IfModule> <IfModule mod_gnutls.c>
Listen
</IfModule> # vim: syntax=apache ts= sw= sts= sr noet

  进入 目录 /etc/apache2/sites-available, 修改000-default.conf文件

#<VirtualHost *:>
<VirtualHost *:>
# 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.com ServerAdmin webmaster@localhost
DocumentRoot /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:warn ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${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= sw= sts= 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,意识到没有把文件压缩,它是打开了这个网页。把文件压缩就可以下载了

Ubuntu搭建Http服务器用于下载Ubuntu文件的更多相关文章

  1. Git版本控制之ubuntu搭建Git服务器

    Git是一个开源的分布式版本控制系统,可以有效.高效的处理从很小到非常大的项目版本管理.使得开发者可以通过克隆(git clone),在本地机器上拷贝一个完整的Git仓库,也可以将代码提交到Git服务 ...

  2. ubuntu搭建svn服务器并htpp访问版本库并svn与web同步

    Ubuntu搭建SVN服务器多版本库 1  介绍   Subversion是一个自由,开源的版本控制系统,这个版本库就像一个普通的文件服务器,不同的是,它可以记录每一次文件和目录的修改情况.这样就可 ...

  3. Ubuntu搭建Anki服务器

    Ubuntu搭建Anki服务器 第一步安装Anki 阿里云的服务器,xshell远程登录上 #以root用户进行操作 #安装Akni服务 easy_install AnkiServer #添加名为an ...

  4. Ubuntu搭建NFS服务器,NFS协议详细分析

    目录 1. Ubuntu搭建NFS服务器 2. NFS协议分析 2.1 实验拓扑: 2.2 在kali抓包分析 1. Ubuntu搭建NFS服务器 ​ NFS(Network FileSystem,网 ...

  5. Ubuntu 搭建Web服务器(MySQL+PHP+Apache)详细教程

    Ubuntu 搭建Web服务器(MySQL+PHP+Apache)详细教程 看了好多人的博客,有的不全 or 有问题,整理了一下,适合小白 新手先整理几个小问题 1.为啥使用 Linux 搭建服务器? ...

  6. Ubuntu 搭建 LAMP 服务器

    /******************************************************************** * Ubuntu 搭建 LAMP 服务器 * 说明: * 想 ...

  7. ubuntu 搭建samba服务器&挂载(mount)代码到本地

    一.搭建samba服务器 1.下载: sudo apt-get install samba samba-common 2.创建共享文件夹MyShare: mkdir /home/user/MyShar ...

  8. ubuntu 搭建ftp服务器,可以通过浏览器访问,filezilla上传文件等功能

    搭建ftp服务器 1:首先,更新软件源,保证源是最新的,这样有利于下面在线通过apt-get install命令安装ftp. 2:使用sudo apt-get install vsftp命令安装vsf ...

  9. [Ubuntu] Ubuntu搭建VPN服务器pptpd

    在 Ubuntu 上搭建 VPN 服务器的方法非常多,比较著名的有 PPTP, L2TP/IPSec 和 OpenVPN. 这三种方式中后两者的安全性比较好,但配置较麻烦.其中 OpenVPN 在 W ...

随机推荐

  1. sudo的用法

    为了系统安全我们一般不直接使用root用户进行日常维护,sudo是临时提升root权限,有时执行一些命令或者更新没权限的文件时需要使用root,这个时候就需要sudo上场了 普通用户是没有sudo使用 ...

  2. phar打包项目压力对比测试

    工具 http_load 测试url: http://api.test.chaoma.me/agent/ad/good_goods/query http://api.test.chaoma.me/ag ...

  3. UVA 11732 strcmp() Anyone (Trie+链表)

    先两两比较,比较次数是两者相同的最长前缀长度*2+1,比较特殊的情况是两者完全相同时候比较次数是单词长度*2+2, 两个单词'末尾\0'和'\0'比较一次,s尾部'\0'和循环内'\0'比较一次. 因 ...

  4. [神经网络]一步一步使用Mobile-Net完成视觉识别(一)

    1.环境配置 2.数据集获取 3.训练集获取 4.训练 5.调用测试训练结果 6.代码讲解 本文是第一篇,环境配置篇. 先打开tensorflow object detection api 看看需要什 ...

  5. ReferenceError: internalBinding is not defined

    ReferenceError: internalBinding is not defined at internal/util/inspect.js:31:15 at req_ (D:\workspa ...

  6. 使用控件的Tag属性传递信息

    实现效果: 知识运用: Control类的Tag属性 //获取或设置包含 有关控件的数据的对象 public object Tag {get;set;} 实现代码: private void Form ...

  7. sum特殊用法

    在python中,list可以存储False和True a = [False] python的sum除了可以加数字,还可以计算列表中False,True的个数,默认是计算False个数 >> ...

  8. linux - 权限解析

    当你在linux下用命令ll 或者ls -la的时候会看到这些字眼,这些字眼表示为不同用户组的权限:r:read就是读权限 --数字4表示w:write就是写权限 --数字2表示 x:excute就是 ...

  9. bootstrap历练实例:面板脚注

    面板脚注 我们可以在面板中添加脚注,只需要把按钮或者副文本放在带有 class .panel-footer 的 <div> 中即可.下面的实例演示了这点: <!DOCTYPE htm ...

  10. LiteIDE 错误: 进程无法启动

    问题 运行 01_hello.go,提示以下错误 新建文件夹().exe [C:/Users/Administrator/Desktop/新建文件夹()] 错误: 进程无法启动. 原因 工程目录名不能 ...