Debian 添加Apache2

安装

apt-get install apache2

配置

1.修改 /etc/apache2/sites-enable/000-default.conf

将DocumentRoot改成你的路径

2.修改 /etc/apache2/apache2.conf

将<Directory /var/www/> 改为 <Directory 你的路径>

3.重启apache 服务器

service apache2 restart

可能的问题:

403 Forbiden 或者 You don't have permission to access / on this server

修改你的路径目录权限为可读写

chmod -R 755 你的路径

我的安装完后还是有问题,是因为你armbian本身安装了OMV, 已经用掉了80端口、

vim /etc/apache2/ports.conf

编辑ports配置文件,将Listen 80 更改成Listen 8082

vim /etc/apache2/sites-enabled/000-default.conf

编辑<VirtualHost *:80>更改为<VirtualHost *:8082>

service apache2 restart

在浏览器输入IP:8082实现访问。

原文地址:https://www.cnblogs.com/boowii/p/15368676.html