首先安装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,意识到没有把文件压缩,它是打开了这个网页。把文件压缩就可以下载了

最新文章

  1. display:none显示和隐藏
  2. GO语言练习:channel 工程实例
  3. Hya.io – 基于 Web 的数字音频工作站
  4. oracle 索引失效原因及解决方法
  5. ADO.NET事务处理,初始回调函数,多张表的数据在同一个DataGridView中展示
  6. 微软职位内部推荐-SDEII for Windows Phone Apps
  7. 【Unity3D实战】摇摆直升机开发实战(一)
  8. JAVA面试题集之基础知识
  9. LA 4329
  10. SAP标准教材列表
  11. order by 中 使用decode
  12. Lucene 4.4.0中常用的几个分词器
  13. 7、Kafka、AMQ、RabbitMQ对比
  14. redis 启动停止脚本
  15. 【机器学习算法-python实现】採样算法的简单实现
  16. Eclipse 在Debug调试中用到的快捷键
  17. Java:The hierarchy of the type is inconsistent错误
  18. Springmvx拦截html出现406解决以及Server Tomcat v8.0 Server at localhost failed to start 问题解决方法
  19. Makefile中的MAKECMDGOALS
  20. CoreDNS配置etcd作为后端

热门文章

  1. uva 10328 - Coin Toss 投硬币(dp递推,大数)
  2. Lua与游戏的不解之缘
  3. idea存留
  4. vue 文件流下载xlsx 功能实现
  5. pycharm 使用技巧
  6. targetcli save error
  7. JDK的安装以及环境变量的配置
  8. css3中的nth-child和nth-of-type的区别
  9. Title Case a Sentence-freecodecamp算法题目
  10. html5新结构标签