【笔记】Debian安装Apache2

时间:2022-03-12 06:29:11

本文迁移地址:https://muumlover.com/2016/11/apache2-setup.html

sudo apt-get install apache2 apache2-utils

配置apache端口为8080

vim /etc/apache2/ports

修改内容如下

# 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/000-default.conf

Listen 8080

<IfModule ssl_module>
        Listen 8088
</IfModule>

<IfModule mod_gnutls.c>
        Listen 8088
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet///////

打开apache2的文件访问功能

vim /etc/apache2/apache2.conf

修改内容如下

<Directory />
        Options FollowSymLinks
        AllowOverride None
# Require all denied
        Order deny,allow
        allow from all
</Directory>

配置apache2自启动

chkconfig apache2 2
/etc/init.d/apache2 start