首先安装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. python之元组,列表和字典的区别

    Python语言包含6种内建的序列,其中,有两种主要的类型:列表和元组. 列表是可以修改的,而元组不可以,如果要添加或者删除某些元素,就只能用列表,为了限制某些元素,就会用到元组.一般来说,列表可以替 ...

  2. Netweaver和CloudFoundry的服务器日志

    Netweaver 事务码SMICM,Goto->HTTP Plug-In->Server Logs: CloudFoundry 假设我部署本地应用到CloudFoundry之后,应用的状 ...

  3. Erlang程序设计(第2版)读书笔记(一)

    正如<代码的未来>中所说,为了充分利用多核,并发变成将成为未来发展的趋势,对于并发编程的支持,Erlang确实是不二之选,Erlang在国内仍然较为小众,经典书籍相对也要少很多,最终选择了 ...

  4. [Docker] Docker安装和简单指令

    Docker笔记 安装 sudo apt install docker.io 启动和关闭Docker服务 # 启动Docker服务 sudo service docker start # 关闭Dock ...

  5. 一步一步教你用IntelliJ IDEA 搭建SSM框架(1)

    1.基本概念 SSM框架指:Spring MVC + Spring + MyBatis Spring MVC是一种web层mvc框架,用于替代servlet,处理|响应请求,获取表单参数,表单校验等 ...

  6. Cenos7—安装

    1. 进入安装界面 2. 选择语言 3. 进行分区 4. 设置root密码

  7. 标签中的name属性和ID属性的区别

    标签中的name属性和ID属性的区别 2018年05月13日 10:17:44 tssit 阅读数:760   编程这么久,细想了一下,发现这个问题还不是很清楚,汗!看了几篇文章,整理了一下,分享下! ...

  8. python学习笔记-环境安装【1】

    1.在 WINDOWS 下面要运行命令 pip install virtualenvwrapper-win才行 参考地址http://blog.csdn.net/liuhongyue/article/ ...

  9. NOIP模拟赛 无线通讯网

    [题目描述] 国防部计划用无线网络连接若干个边防哨所.2种不同的通讯技术用来搭建无线网络:每个边防哨所都要配备无线电收发器:有一些哨所还可以增配卫星电话. 任意两个配备了一条卫星电话线路的哨所(两边都 ...

  10. sphinx 快速使用

    建立配置文件 例可以参照之前的模板新建一个配置文件 sphinx/etc目录 #MySQL数据源配置,详情请查看:http://www.coreseek.cn/products-install/mys ...