国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看av不卡

服務器之家:專注于服務器技術及軟件下載分享
分類導航

Linux|Centos|Ubuntu|系統進程|Fedora|注冊表|Bios|Solaris|Windows7|Windows10|Windows11|windows server|

服務器之家 - 服務器系統 - Linux - Linux系統下Apache安裝、配置、優化

Linux系統下Apache安裝、配置、優化

2019-10-13 16:03Linux之家 Linux

安裝Apache 2.0.48 (查看Install手冊) 考慮到以后要 rewite_url 來使 google 更加容易收錄網站,特地添加了 mod_rewrite 。 同時為了限制流量,特別加了 mod_limitpcnn.c 補丁 , 所以多了一個 --enable-forward 選項。 建議安裝完畢以后不要刪除安裝目錄

安裝Apache 2.0.48 (查看Install手冊)

考慮到以后要 rewite_url 來使 google 更加容易收錄網站,特地添加了 mod_rewrite 。

同時為了限制流量,特別加了 mod_limitpcnn.c 補丁 , 所以多了一個 --enable-forward 選項。

建議安裝完畢以后不要刪除安裝目錄,以便以后升級時使用。

記得升級前關閉 apache2.0

編譯過程:

代碼:

這個例子里面是編譯了 mod_so,mod_speling 和 openssl 支持。

同樣有另外幾種寫法

代碼:

接著,將啟動程序放入開機程序中去。 如果要啟動 ssl 加密網頁,則必須通過手動啟動 apache2.0 (參見 ssl 部分 )

代碼:

代碼:

在 profile 里面添加以上的語句來設置路徑,使得在 bash 下更容易控制 apachectl, 省去了輸入路徑的麻煩。

代碼:

Xiyang 的配置

我用的: mod_limitipconn, mod_expires, mod_gzip, mod_php4, mod_so, mod_access, mod_alias, mod_userdir, mod_dir, mod_autoindex, mod_status, mod_mime, mod_log_config, http_core

關于超時的問題

在我編寫好所有的產品查看頁面的時候,經常會出現因為超時,或者流量過大 ,apache 停止工作的問題,原因有二,一是代碼的不科學性,二是 apache 的設置問題。

以下是對設置的一點改動:

代碼:

• 記錄訪問者的 HTTP-REFERER 和 AGENT, 有助于統計來者是通過什么搜索引擎找到我們的網站的。 或者在原有的CustomLog行,將參數由 common 改成 combined

代碼:

安裝過程

# lynx http://dominia.org/djao/limit/mod_limitipconn-0.22.tar.gz 
  # tar -zxvf mod_limitipconn-0.22.tar.gz 
  # cd httpd-2.0.48 
  # patch -p1 < ../mod_limitipconn-0.22/apachesrc.diff 
  patching file configure.in 
  Hunk #1 succeeded at 373 (offset 55 lines). 
  patching file include/scoreboard.h 
  patching file modules/generators/mod_status.c 
  Hunk #1 succeeded at 746 (offset -1 lines). 
##Instructions for building DSO with proxy tracking: 
  # tar xzvf httpd-2.0.39.tar.gz 
  # tar xzvf mod_limitipconn-0.22.tar.gz 
  # cd httpd-2.0.39 
  # patch -p1 < ../mod_limitipconn-0.22/apachesrc.diff 
  # ./buildconf 
  # ./configure --enable-so --enable-speling --enable-rewrite 
--with-ssl=/usr/local/ssl --enable-forward 
  # make 
  # make install 
  # cd ../mod_limitipconn-0.22 
  # PATH=/usr/local/apache2/bin:$PATH 
  # make install 
# If you would like to have agent and referer logfiles, 
  # uncomment the following directives. 
  CustomLog logs/referer_log referer       
  CustomLog logs/agent_log agent 
  CustomLog logs/www.domain.com-access_log combined

使用 mod_limitipconn.c 來限制 apache 的并發數

Package: http://dominia.org/djao/limit/這里的安裝建議使用動態 DSO 并 patch apache2.0, 以使得 apache2.0 可以認識在代理后方的 IP 。但是要 重新編譯 apache2.0, 以下是介紹。

代碼:

# KeepAlive: Whether or not to allow persistent connections(more than 
  # one request per connection). Set to "Off" to deactivate. 
  
  # KeepAlive Off 
  
  # MaxKeepAliveRequests: The maximum number of requests to allow 
  # during a persistent connection. Set to 0 to allow an unlimited amount. 
  # We recommend you leave this number high, for maximum performance. 
  
  # MaxKeepAliveRequests 0 
  
  # KeepAliveTimeout: Number of seconds to wait for the next request 
  # from the same client on the same connection. 
  
  # KeepAliveTimeout 0 
#chmod 755 – R /home/dalouis/ 

設置目錄的可讀性為 drwxr-xr-x(755), 否則會出現 "Forbidden You don't have permission to access / on this server."

一些關于安全性的配置:

考慮到 cgi-bin 的安全性問題,我們暫時將 cgi-bin 去掉。將所有 httpd.conf 中的所有關于 cgi-bin 的行加上 #.

# vi /usr/local/apache2/conf/httpd.conf 

配置文件請看文件 httpd.conf (設置文檔目錄為/home/dalouis/public_html)

代碼:

# vi /etc/profile 
  PATH=" $PATH:usr/local/apache2/bin:”

配置 apache2.0

代碼:

If you want your server to continue running after a system reboot , 
  you should add a call to apachectl to your system startup files (typically rc.local or 
  a file in an rc.N directory). This will start Apache as root. Before doing this ensure 
  that your server is properly configured for security and access restrictions. 
# echo "/usr/local/apache2/bin/apachectl start" >> /etc/rc.d/rc.local 

參考:

  # apachectl -l 
  Compiled in modules: 
  core.c 
  mod_access.c 
  mod_auth.c 
  mod_include.c 
  mod_log_config.c 
  mod_env.c 
  mod_setenvif.c 
  prefork.c 
  http_core.c 
  mod_mime.c 
  mod_status.c 
  mod_autoindex.c 
  mod_asis.c 
  mod_cgi.c 
  mod_negotiation.c 
  mod_dir.c mod_imap.c 
  mod_actions.c 
  mod_speling.c 
  mod_userdir.c 
  mod_alias.c 
  mod_rewrite.c 
  mod_so.c 
#./configure --enable-modules=”so speling” 

--enable-MODULE[=shared] 編譯并包含模塊 MODULE. MODULE 是文檔中去掉” _module ”的模塊名。要將一個模塊編譯成為 DSO, 需要加 -shared 選項 , 即 --enable-mods-shared 。 (查看 MODULE 手冊)

注意 :"如果希望核心能夠裝載 DSO,而不實際編譯任何動態模塊,則要明確指定 --enable-modules=so 或者 --enable-so" (查看 DSO 手冊),所以前面的順序不能交換順序。 查看所有apache 的 configure 參數

安裝完畢后可以用以下命令來查看啟動了那些模塊

代碼:

#./configure --enable-modules=so --enable-modules=speling --enable-modules=rewrite 

或者

代碼:

#./configure --enable-so --enable-speling --enable-rewrite
 --with-ssl=/usr/local/ssl --enable-forward 
  # make 
  # make install 

 

延伸 · 閱讀

精彩推薦
Weibo Article 1 Weibo Article 2 Weibo Article 3 Weibo Article 4 Weibo Article 5 Weibo Article 6 Weibo Article 7 Weibo Article 8 Weibo Article 9 Weibo Article 10 Weibo Article 11 Weibo Article 12 Weibo Article 13 Weibo Article 14 Weibo Article 15 Weibo Article 16 Weibo Article 17 Weibo Article 18 Weibo Article 19 Weibo Article 20 Weibo Article 21 Weibo Article 22 Weibo Article 23 Weibo Article 24 Weibo Article 25 Weibo Article 26 Weibo Article 27 Weibo Article 28 Weibo Article 29 Weibo Article 30 Weibo Article 31 Weibo Article 32 Weibo Article 33 Weibo Article 34 Weibo Article 35 Weibo Article 36 Weibo Article 37 Weibo Article 38 Weibo Article 39 Weibo Article 40
主站蜘蛛池模板: 成人免费xxxxx在线观看 | 人人人人澡人人爽人人澡 | 久久久国产精品一区 | 91性高湖久久久久久久久网站 | av黄网 | 狠狠综合 | 黄色a视频| 久久精品| 在线视频se| 黑人中文字幕一区二区三区 | 爱爱免费视频网站 | 精品久久久中文字幕 | 伊人99| 亚洲精品久久久久久一区二区 | 一区二区三区在线播放 | 国产精品美女久久久久久久久久久 | 日韩电影免费在线观看中文字幕 | 国产精品九九久久99视频 | 欧美日韩成人在线 | 99精品久久久 | 久久久久黄 | 黄色国产 | 国产精久久久 | 久久丝 | 在线看国产 | 欧美一级片在线观看 | 2020国产在线 | 龙珠z国语291集普通话 | 久久久精品一区二区 | 国产精品久久久久国产a级 成人a在线视频 | 一区二区三区在线免费视频 | 欧美综合第一页 | 成年片| 在线观看成人 | 99久久久无码国产精品 | 最新中文字幕 | 欧美午夜一区二区三区免费大片 | 中文字幕在线视频观看 | 老黄网站在线观看 | 亚洲天堂免费在线 | 午夜精品福利一区二区三区蜜桃 |