1.apache 主目錄
/usr/local/apache2
2.網(wǎng)站主目錄
/usr/local/apache2/htdocs
3.配置文件
/usr/local/apache2/etc/httpd.conf
4.應(yīng)用程序
/usr/local/apache2/bin/httpd
5.服務(wù)腳本
/usr/local/apache2/bin/apachectl
6.啟動(dòng)服務(wù)
/usr/local/apache2/bin/apachectl start
/usr/local/apache2/bin/apachectl restart
7.關(guān)閉服務(wù)
/usr/local/apache2/bin/apachectl stop
8.查看進(jìn)程
pstree |grep httpd
9.查看端口
netstat -tunpl |grep :80
10.開機(jī)啟動(dòng)
vi /etc/rc.d/rc.local
/usr/local/apache2/bin/apachectl restart &>/dev/null
apache 配置文件:
1.監(jiān)聽端口
Listen 800
2.加載 php 的動(dòng)態(tài)模塊
LoadModule php5_module modules/libphp5.so
3.apache 服務(wù)的進(jìn)程執(zhí)行者
User daemon
4.apache 的網(wǎng)站根目錄
DocumentRoot "/usr/local/apache2/htdocs"
5.apache 的網(wǎng)站根目錄的服務(wù)權(quán)限
<Directory "/usr/local/apache2//htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
#先允許,后拒絕
Allow from all
#允許所有人
#不拒絕任何人
</Directory>
6.apache 的默認(rèn)首頁
DirectoryIndex index.php index.html
7.apache 的錯(cuò)誤日志
ErrorLog "logs/error_log"
8.apache 的訪問日志
CustomLog "logs/access_log" common
實(shí)時(shí)查看文件中的最后十行的變化:
tail -f access_log
9.404 頁面不存在
ErrorDocument 404 /missing.html
10.包含外部配置文件
Include etc//extra/httpd-vhosts.conf