一、Apache簡介
Apache HTTP Server(簡稱Apache)是Apache軟件基金會的一個開放源代碼的網頁服務器軟件,可以在大多數電腦操作系統中運行,由于其跨平臺和安全性(盡管不斷有新的漏洞被發現,但由于其開放源代碼的特點,漏洞總能被很快修補。因此總合來說,其安全性還是相當高的。)。被廣泛使用,是最流行的Web服務器軟件之一。它快速、可靠并且可通過簡單的API擴充,將Perl/Python等解釋器編譯到服務器中。
軟件圖標
二、安裝Apache httpd
安裝httpd以配置Web服務器, HTTP使用80 / TCP
[1] 安裝 httpd.[root@linuxprobe ~]# yum -y install httpd# 刪除默認歡迎頁面[root@linuxprobe ~]# rm -f /etc/httpd/conf.d/welcome.conf[2] 配置httpd,將服務器名稱替換為您自己的環境[root@linuxprobe ~]# vi /etc/httpd/conf/httpd.conf# line 86: 改變管理員的郵箱地址ServerAdmin root@linuxprobe.org# line 95: 改變域名信息ServerName www.linuxprobe.org:80# line 151: none變成AllAllowOverride All# line 164: 添加只能使用目錄名稱訪問的文件名DirectoryIndex index.html index.cgi index.php# add follows to the end# server's response header(安全性)ServerTokens Prod# keepalive is ONKeepAlive On[root@linuxprobe ~]# systemctl start httpd[root@linuxprobe ~]# systemctl enable httpd[3] 如果Firewalld正在運行,請允許HTTP服務。,HTTP使用80 / TCP[root@linuxprobe ~]# firewall-cmd --add-service=http --permanentsuccess[root@linuxprobe ~]# firewall-cmd --reloadsuccess[4] 創建一個HTML測試頁,并使用Web瀏覽器從客戶端PC訪問它。如果顯示以下頁面,是正確的[root@linuxprobe ~]# vi /var/www/html/index.html<html><body><div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">Welcome access LinuxProbe.org,This is Test Page!</div></body></html> |
三、支持Perl
啟用CGI執行并使用Perl腳本