[root@gitlab-test ~]# 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 Wed 2020-02-12 12:07:30 CST; 12s ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 58363 (httpd)
Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec"
Tasks: 7
Memory: 3.2M
CGroup: /system.slice/httpd.service
├─58363 /usr/sbin/httpd -DFOREGROUND
├─58365 /usr/sbin/httpd -DFOREGROUND
├─58366 /usr/sbin/httpd -DFOREGROUND
├─58367 /usr/sbin/httpd -DFOREGROUND
├─58368 /usr/sbin/httpd -DFOREGROUND
├─58369 /usr/sbin/httpd -DFOREGROUND
└─58370 /usr/sbin/httpd -DFOREGROUND
Feb 12 12:07:30 gitlab-test systemd[1]: Starting The Apache HTTP Server...
Feb 12 12:07:30 example-host httpd[58363]: AH00558: Set the 'ServerName' directive to suppress this message
Feb 12 12:07:30 gitlab-test systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.
python代码
Python
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/python#coding=utf-8print"Content-type:text/html"print#空行,告诉服务器结束头部print'<html>'print'<head>'print'<meta charset="utf-8">'print'<title>Hello Word - 我的第一个CGI程序!</title>'print'</head>'print'<body>'print'<h2>嘿! this is cgi!~</h2>'print'</body>'print'</html>'