激情久久久_欧美视频区_成人av免费_不卡视频一二三区_欧美精品在欧美一区二区少妇_欧美一区二区三区的

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

云服務器|WEB服務器|FTP服務器|郵件服務器|虛擬主機|服務器安全|DNS服務器|服務器知識|Nginx|IIS|Tomcat|

服務器之家 - 服務器技術 - 服務器知識 - Windows Apache2.4 VC9(ApacheHaus)詳細安裝配置教程

Windows Apache2.4 VC9(ApacheHaus)詳細安裝配置教程

2022-02-16 17:51xyb930826 服務器知識

這篇文章主要介紹了Windows Apache2.4 VC9(ApacheHaus)詳細安裝配置教程,需要的朋友可以參考下

1,apache下載

Windows Apache2.4 VC9(ApacheHaus)詳細安裝配置教程

選擇一個版本,點擊download

Windows Apache2.4 VC9(ApacheHaus)詳細安裝配置教程

點擊file for microsoft windows

Windows Apache2.4 VC9(ApacheHaus)詳細安裝配置教程

由于apache http server官方不提供二進制(可執(zhí)行)的發(fā)行版,所以我們選擇一些貢獻者編譯完成的版本,我們選擇第一個apachehaus

點擊apachehaus,進入下載頁

Windows Apache2.4 VC9(ApacheHaus)詳細安裝配置教程

選擇其中一個版本,如果你的windows還沒安裝對應的vc環(huán)境的話,選擇對應的vcredistribute版本下載安裝。我選擇apache 2.4vc9版,因為我的電腦中已經安裝了vc9的環(huán)境。

點擊jumplinks下第一行的某一個版本,下載對應壓縮包。

2,配置apache之一--httpd.conf

解壓后進入里面apache22(最后兩位數字可能不同)文件夾,使用文本編輯器(推薦ultraedit)打開conf文件夾中的httpd.conf配置文件

找到serverroot選項,設置apache目錄,大約在35行左右,將其改成你的apache程序的文件夾,例:

?
1
serverroot "c:/users/mypc/downloads/httpd-2.2.31-x86-r3/apache22"

找到listen選項,設置端口,大約46行,一般不修改,使用默認80,在開啟服務器前請保證80端口未被占用

找到documentroot選項,修改服務器根目錄,例:

?
1
documentroot "f:/"

請保證此目錄存在,否則服務器無法正常啟動

修改directory,保證其與服務器根目錄相同,只修改下面的第一行中引號部分

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<directory "f:/">
  #
  # possible values for the options directive are "none", "all",
  # or any combination of:
  #  indexes includes followsymlinks symlinksifownermatch execcgi multiviews
  #
  # note that "multiviews" must be named *explicitly* --- "options all"
  # doesn't give it to you.
  #
  # the options directive is both complicated and important. please see
  # http://httpd.apache.org/docs/2.2/mod/core.html#options
  # for more information.
  #
  options indexes followsymlinks
 
  #
  # allowoverride controls what directives may be placed in .htaccess files.
  # it can be "all", "none", or any combination of the keywords:
  #  options fileinfo authconfig limit
  #
  allowoverride none
 
  #
  # controls who can get stuff from this server.
  #
  order allow,deny
  allow from all
 
</directory>

找到scriptalias選項,設置服務器腳本目錄,大約326行,一般將其設置為apache目錄下的cgi-bin文件夾

?
1
scriptalias /cgi-bin/ "c:/users/mypc/downloads/httpd-2.2.31-x86-r3/apache22/cgi-bin"

找到隨后的directory選項,設置腳本目錄,大約342行,需要將其設置為和前面的scriptalias目錄相同

?
1
2
3
4
5
6
<directory "c:/users/mypc/downloads/httpd-2.2.31-x86-r3/apache22/cgi-bin">
  allowoverride none
  options none
  order allow,deny
  allow from all
</directory>

 

3,配置apache之二--ssl配置

如果你這使啟動服務,一般會出現下面的消息對話框:

Windows Apache2.4 VC9(ApacheHaus)詳細安裝配置教程

提示

windows不能在本地計算機啟動apache2.2。有關更多信息,查閱系統(tǒng)日志文件。如果這是非microsoft服務,請與廠商聯(lián)系,并參考特定服務器錯誤代碼1。

確定此問題的原因:

右鍵 計算機,點擊管理->windows日志->應用程序,顯示如下

Windows Apache2.4 VC9(ApacheHaus)詳細安裝配置教程

Windows Apache2.4 VC9(ApacheHaus)詳細安裝配置教程

這是由于ssl配置不正確所產生的,下面說一下解決辦法。

打開apache程序目錄下的conf/extra/httpd-ahssl.conf文件,配置virtualhost選項,有三處名為virtualhost的選項,均需修改。

第一個在107行左右。

在110行左右,將其中的sslcertificatefile改為:apache所在目錄/conf/ssl/server.crt

在111行左右,將sslcertificatekeyfile改為:apache所在目錄/conf/ssl/server.key

在112行左右,將documentroot改為你的服務器根目錄

在126行左右,將customlog改為:apache所在目錄/logs/ssl_request.log,這個不改的話也會錯。一般會出現如下錯誤:

Windows Apache2.4 VC9(ApacheHaus)詳細安裝配置教程

apache2.2服務由于下列服務特定錯誤而終止:函數不正確。

改成的效果:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<virtualhost _default_:443>
 sslengine on
 servername localhost:443
 sslcertificatefile c:/users/mypc/downloads/httpd-2.2.31-x86-r3/apache22/conf/ssl/server.crt
 sslcertificatekeyfile c:/users/mypc/downloads/httpd-2.2.31-x86-r3/apache22/conf/ssl/server.key
 documentroot f:/
 
# openssl req -new > server.csr
# openssl rsa -in privkey.pem -out server.key
# openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 2048
<filesmatch "\.(cgi|shtml|phtml|php)$">
  ssloptions +stdenvvars
</filesmatch>
<directory "/apache22/cgi-bin">
  ssloptions +stdenvvars
</directory>
browsermatch "msie [2-5]" \
     nokeepalive ssl-unclean-shutdown \
     downgrade-1.0 force-response-1.0
customlog "c:/users/mypc/downloads/httpd-2.2.31-x86-r3/apache22/logs/ssl_request.log" \
     "%t %h %{ssl_protocol}x %{ssl_cipher}x \"%r\" %b"
</virtualhost>

主要改上文四處地方

在130行和152行還有另外兩個virtualhost,均需修改上述的四個選項

例:

130行

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<virtualhost *:443>
 sslengine on
 servername serverone.tld:443
 sslcertificatefile c:/users/mypc/downloads/httpd-2.2.31-x86-r3/apache22/conf/ssl/serverone.crt
 sslcertificatekeyfile c:/users/mypc/downloads/httpd-2.2.31-x86-r3/apache22/conf/ssl/serverone.key
 documentroot f:/
# openssl req -new > serverone.csr
# openssl rsa -in privkey.pem -out serverone.key
# openssl x509 -in serverone.csr -out serverone.crt -req -signkey serverone.key -days 2048
<filesmatch "\.(cgi|shtml|phtml|php)$">
  ssloptions +stdenvvars
</filesmatch>
<directory "/apache22/cgi-bin">
  ssloptions +stdenvvars
</directory>
browsermatch "msie [2-5]" \
     nokeepalive ssl-unclean-shutdown \
     downgrade-1.0 force-response-1.0
customlog "c:/users/mypc/downloads/httpd-2.2.31-x86-r3/apache22/logs/ssl_request.log" \
     "%t %h %{ssl_protocol}x %{ssl_cipher}x \"%r\" %b" env=https
</virtualhost>

第152行

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<virtualhost *:443>
 sslengine on
 servername servertwo.tld:443
 sslcertificatefile c:/users/mypc/downloads/httpd-2.2.31-x86-r3/apache22/conf/ssl/servertwo.crt
 sslcertificatekeyfile c:/users/mypc/downloads/httpd-2.2.31-x86-r3/apache22/conf/ssl/servertwo.key
 documentroot f:/
# openssl req -new > servertwo.csr
# openssl rsa -in privkey.pem -out servertwo.key
# openssl x509 -in servertwo.csr -out servertwo.crt -req -signkey servertwo.key -days 2048
<filesmatch "\.(cgi|shtml|phtml|php)$">
  ssloptions +stdenvvars
</filesmatch>
<directory "/apache22/cgi-bin">
  ssloptions +stdenvvars
</directory>
browsermatch "msie [2-5]" \
     nokeepalive ssl-unclean-shutdown \
     downgrade-1.0 force-response-1.0
customlog "c:/users/mypc/downloads/httpd-2.2.31-x86-r3/apache22/ssl_request.log" \
     "%t %h %{ssl_protocol}x %{ssl_cipher}x \"%r\" %b"
</virtualhost>

上述的兩個virtualhost均需修改四處

這樣,apache就算配置完了,如果還有問題,可能還需配置./conf/extra/httpd-ssl.conf,配置方法和配置virtualhost的相似

4,啟動apache http server

使用windows命令行以管理員身份進入apache程序的文件夾下的bin文件夾,輸入httpd -k install,完成apache服務的安裝。

然后雙擊bin目錄下的apachemonitor.exe,點擊右邊的start啟動服務器,如果正常,如下圖:

Windows Apache2.4 VC9(ApacheHaus)詳細安裝配置教程

測試一下:

Windows Apache2.4 VC9(ApacheHaus)詳細安裝配置教程

5,其它

卸載apache http server:

管理員身份進入bin目錄,使用httpd -k uninstall 移除服務

使用httpd -w -n "apache2" -k start命令啟動服務器 可以顯示啟動過程中的日志,便于分析錯誤。

原文鏈接:http://www.cnblogs.com/xyb930826/p/5444718.html

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: freexxx69性欧美hd | 91高清在线观看 | 91短视频在线免费观看 | 国产一级一区二区 | 日日草夜夜草 | 麻豆视频在线免费观看 | 亚洲热线99精品视频 | 久久久久久久久久91 | 欧美a级在线免费观看 | 成人毛片在线播放 | 色视频在线观看 | 国产精品久久久久久久四虎电影 | 久久网综合 | 国产乱色精品成人免费视频 | 亚洲操比视频 | 在线观看欧美成人 | 久久精品日产第一区二区三区 | 日本在线不卡一区二区 | 韩国三级日本三级香港三级黄 | 999久久久国产999久久久 | 夜间福利视频 | 极色品影院 | 免费国产一区二区视频 | 免费看污视频在线观看 | 国产精品亚洲综合 | 娇妻被各种姿势c到高潮小说 | 激情综合网俺也去 | 成人在线视频免费播放 | 91免费影院| 杏美月av | 国产精品久久久久久模特 | 激情夜色| 露脸各种姿势啪啪的清纯美女 | 成人在线视频免费播放 | 国产精品99一区二区 | 黄色男女视频 | 精品国产91久久久久 | 欧美日韩视频第一页 | 日本免费一区二区三区四区 | 欧美一级色片 | 欧美三级欧美成人高清www |