前言
最近在使用 SUSE 操作系统安装 Apache2,用来当作内网的镜像源。在使用过程中遇到一些问题,这里整理并记录一下。
安装
zypper in apahce2
访问
访问 apache2 web 页面。
报如下错误。
You don’t have permission to access the requested directory. There is either no index document or the directory is read-protected.
解决方案
将 /etc/apache2/default-server.conf
配置文件中替换如下配置:
Options None
改为Options All
AllowOverride None
改为AllowOverride All
- 编辑
default-server.conf
vim /etc/apache2/default-server.conf
替换所有的相关配置。
- 新建文件
cd /srv/www/htdocs
touch index.html
echo "hello" >> index.html
- 重启
apahce2
systemctl restart apache2
问题解决!
参考
- https://forums.opensuse.org/t/apache2-htaccess-how-to-enable-it/16724