下面按不同操作系统给你讲“如何安装 Apache”,以最常见的 Apache HTTP Server(httpd) 为例。
sudo apt update
sudo apt install apache2 -y
启动并设置开机自启:
sudo systemctl start apache2
sudo systemctl enable apache2
验证:
systemctl status apache2
浏览器访问:
http://localhost
sudo yum install httpd -y
# 或
sudo dnf install httpd -y
启动:
sudo systemctl start httpd
sudo systemctl enable httpd
防火墙放行:
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload
httpdC:\Apache24cd C:\Apache24\bin
httpd.exe
http://localhost
sudo apachectl start
访问:
http://localhost
看到 “It works!” 或 Apache 默认页面即成功。
httpd.conf 中 Listen 80/etc/apache2//etc/httpd/如果你告诉我:
我可以给你更具体的配置教程。
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。