企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
#### 安装apache ~~~ yum install httpd //在centos里面叫httpd ,在ubuntu里就叫apache ~~~ #### 启动服务 ~~~ service httpd start ~~~ #### 查看状态 ~~~ service httpd status ~~~ ~~~ Redirecting to /bin/systemctl status httpd.service ● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled) Active:active (running) since 一 2018-03-26 10:23:11 CST; 6min ago //running 说明已运行 Docs: man:httpd(8) man:apachectl(8) Main PID: 1841 (httpd) Status: "Total requests: 15; Current requests/sec: 0; Current traffic: 0 B/sec" CGroup: /system.slice/httpd.service ├─1841 /usr/sbin/httpd -DFOREGROUND ├─1842 /usr/sbin/httpd -DFOREGROUND ├─1843 /usr/sbin/httpd -DFOREGROUND ├─1844 /usr/sbin/httpd -DFOREGROUND ├─1845 /usr/sbin/httpd -DFOREGROUND ├─1846 /usr/sbin/httpd -DFOREGROUND ├─1951 /usr/sbin/httpd -DFOREGROUND ├─1952 /usr/sbin/httpd -DFOREGROUND ├─1953 /usr/sbin/httpd -DFOREGROUND └─1954 /usr/sbin/httpd -DFOREGROUND ~~~ #### 查看进程 ~~~ ps -ef | grep httpd ~~~ ~~~ root 1841 1 0 10:23 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND apache 1842 1841 0 10:23 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND apache 1843 1841 0 10:23 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND apache 1844 1841 0 10:23 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND apache 1845 1841 0 10:23 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND apache 1846 1841 0 10:23 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND apache 1951 1841 0 10:27 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND apache 1952 1841 0 10:27 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND apache 1953 1841 0 10:27 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND apache 1954 1841 0 10:28 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND jack 1957 1175 0 10:28 pts/0 00:00:00 grep --color=auto httpd ~~~ #### 访问 通过其他电脑访问服务器地址,默认端口是80发现访问不了,原因是有防火墙,关闭防火墙即可访问 . 但是服务器的防火墙是不能关闭的 . ![](https://box.kancloud.cn/1df009cfd0680bda30904ec355083e83_675x724.png)