


linux構(gòu)建動態(tài)WEB服務(wù)器配置篇
Apache配置文件
重要配置選項
ServerRoot 服務(wù)器運行的根目錄
MaxClients 能同時訪問服務(wù)器的客戶機數(shù)量
DocumentRoot 服務(wù)器共享文件的起始位置
listen 服務(wù)器監(jiān)聽的端口
ServerAdmin 管理員的信箱
User&Group 服務(wù)器運行者的身份
ErrorLog 出錯日志文件
DirectoryIndex 默認(rèn)文件夾索引文件
AddDefaultCharset 默認(rèn)返回頁面的編碼
Alias 為目錄設(shè)置訪問別名
查看Apache內(nèi)部默認(rèn)模塊 /usr/local/apache2/bin/httpd -l
目錄控制語句
<Directory /> #默認(rèn)根目錄
Options Indexes Follow Symlink #可以使用index文件
AllowOverride None #不能被復(fù)蓋
</Director>
以上沒有權(quán)限語句,所有向上的訪問都不能執(zhí)行
<Directory /usr/local/apache2/htdocs>
Options Follow Symlink
AllowOverride None #不能被復(fù)蓋
Order allow.deny
Allow from all #任何地址都能訪問,Allow,Deny
</Directory>
測試CGI
配置文件選項
ScriptAlias /cgi-bin “/usr/local/apache2/cgi-bin/”
編寫cgi文件
/usr/local/apache2/cgi-bin/<cgifile>
確認(rèn)cgi程序是apache用戶可以執(zhí)行的
#chgrp apache /usr/local/apache2/cgi-bin/<cgifile>
#chmod 750 /user/local/apache2/cgi-bin/<cgifile>
測試cgi程序的執(zhí)行效果
#links http://localhost/cgi-bin/<cgifile>
激活SSL模塊
創(chuàng)建私鑰和證書文件
#cd /etc; mkdir ssl.crt server.key
#openssl genrsa -out /etc/ssl.key/server.key 1024
#openssl req -new -x509 -key \
/etc/ssl.key/server.key -out /etc/ssl.crt/server.crt
編輯/etc/ssl.conf
重新啟動web服務(wù)器
#/usr/local/apache2/bin/apachectl stop
#/usr/local/apache2/bin/apachectl startssl
(修改啟動腳本/etc/rc.local中的相應(yīng)的命令)
關(guān)鍵字:linux、WEB、服務(wù)器、Apache
新文章:
- CentOS7下圖形配置網(wǎng)絡(luò)的方法
- CentOS 7如何添加刪除用戶
- 如何解決centos7雙系統(tǒng)后丟失windows啟動項
- CentOS單網(wǎng)卡如何批量添加不同IP段
- CentOS下iconv命令的介紹
- Centos7 SSH密鑰登陸及密碼密鑰雙重驗證詳解
- CentOS 7.1添加刪除用戶的方法
- CentOS查找/掃描局域網(wǎng)打印機IP講解
- CentOS7使用hostapd實現(xiàn)無AP模式的詳解
- su命令不能切換root的解決方法
- 解決VMware下CentOS7網(wǎng)絡(luò)重啟出錯
- 解決Centos7雙系統(tǒng)后丟失windows啟動項
- CentOS下如何避免文件覆蓋
- CentOS7和CentOS6系統(tǒng)有什么不同呢
- Centos 6.6默認(rèn)iptable規(guī)則詳解