安装 apache2 服务 sudo apt-get install apache2 修改端口 默认监听的端口是80,可以自定义修改 修改/etc/apache2/ports.conf 修改/etc/apache2/sites-available/000-default.conf 重启服务 apache服务器的默认目录在/var/www/html,如果想利用http服务器下载文件,需要删除其index.html文件,然后把文件放在该目录即可 sudo mv index.html index.html.bak sudo /etc/init.d/apache2 restart