结论:不难。
对于常见需求(静态网站、简单虚拟主机、HTTPS),Ubuntu 上的 Apache2 配置入门门槛很低,属于“照着做就能成”的水平。
包管理成熟
sudo apt update
sudo apt install apache2
装完就能访问 http://服务器IP,自带默认页面。
配置结构清晰
/etc/apache2/apache2.conf/etc/apache2/sites-available/a2ensitea2enmod / a2dismod文档和社区极多
基本所有报错都能搜到明确答案。
mod_rewrite)mod_proxy)<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/example
<Directory /var/www/example>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
然后:
sudo a2ensite example.conf
sudo systemctl reload apache2
a2ensitewww-datareload如果你愿意,我可以: