歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> 源碼安裝apache及配置轉發

源碼安裝apache及配置轉發

日期:2017/3/1 16:14:42   编辑:關於Linux
源碼安裝apache及配置轉發 一、 安裝Apache a) 解壓:tar -xvf httpd-*; b) ./configure --prefix=/usr/oracle/apache CC="gcc -m32" \--enable-proxy=shared --enable-proxy-http=shared --enable-proxy-ftp=shared --enable-proxy-connect=shared --enable-so --enable-modules=all --enable-mods-shared=all c) make d) make install 基本的操作方法: 本文假設你的apahce安裝目錄為/usr/local/apache2,這些方法適合任何情況 apahce啟動命令: 推薦/usr/local/apache2/bin/apachectl start apaceh啟動 apache停止命令 /usr/local/apache2/bin/apachectl stop 停止 apache重新啟動命令: /usr/local/apache2/bin/apachectl restart 重啟 要在重啟 Apache 服務器時不中斷當前的連接,則應運行: /usr/local/sbin/apachectl graceful 如果apache安裝成為linux的服務的話,可以用以下命令操作: service httpd start 啟動 service httpd restart 重新啟動 service httpd stop 停止服務 配置轉發功能 打開apache安裝目錄的conf文件夾下的httpd.conf 1、將以下兩行前的注釋字符 # 去掉: #LoadModule proxy_module modules/mod_proxy.so #LoadModule proxy_http_module modules/mod_proxy_http.so 2、在httpd.conf 文件的最後加上轉發規則 例如: ProxyPass /cas http://192.168.0.206:9090/cas ProxyPassReverse /cas http://192.168.0.206:9090/cas 將/cas開頭的請求轉發到206服務器9090端口的cas上 依次類推,其他的轉發也是通過這種方式設置,如: ProxyPass /cas http://192.168.0.206:9090/cas ProxyPassReverse /cas http://192.168.0.206:9090/cas #bbs不轉發,采用apache處理 ProxyPass /bbs ! ProxyPassReverse /bbs !
Copyright © Linux教程網 All Rights Reserved