一 第一步安装 apache2
sudo apt install apache2
检查是否安装成功
二
在浏览器地址栏输入http://localhost,查看Apache服务器默认网页是否运行正常,网页图如下:
三 更改目录
只需要对apache2在/etc/apache2和/etc/apache2/sites-available下的两个配置文件apache2.conf和000-default.conf两个配置进行修改就行了。
这里附上我的更改方法,
输入
sudo nautilus
1打开文件/etc/apache2/apache2.conf
<Directory />
Options FollowSymLinks
AllowOverride All
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride All
Require all granted
</Directory>
<Directory /var/www/cgi-bin>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
Allow from all
AddHandler cgi-script .cgi .py .sh
</Directory>
#<Directory /srv/>
# Options Indexes FollowSymLinks
# AllowOverride All
# Require all granted
#</Directory>
</