一区二区三区在线-一区二区三区亚洲视频-一区二区三区亚洲-一区二区三区午夜-一区二区三区四区在线视频-一区二区三区四区在线免费观看

服務(wù)器之家:專(zhuān)注于服務(wù)器技術(shù)及軟件下載分享
分類(lèi)導(dǎo)航

云服務(wù)器|WEB服務(wù)器|FTP服務(wù)器|郵件服務(wù)器|虛擬主機(jī)|服務(wù)器安全|DNS服務(wù)器|服務(wù)器知識(shí)|Nginx|IIS|Tomcat|

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

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

2022-02-16 17:51xyb930826 服務(wù)器知識(shí)

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

1,apache下載

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

選擇一個(gè)版本,點(diǎn)擊download

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

點(diǎn)擊file for microsoft windows

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

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

點(diǎn)擊apachehaus,進(jìn)入下載頁(yè)

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

選擇其中一個(gè)版本,如果你的windows還沒(méi)安裝對(duì)應(yīng)的vc環(huán)境的話(huà),選擇對(duì)應(yīng)的vcredistribute版本下載安裝。我選擇apache 2.4vc9版,因?yàn)槲业碾娔X中已經(jīng)安裝了vc9的環(huán)境。

點(diǎn)擊jumplinks下第一行的某一個(gè)版本,下載對(duì)應(yīng)壓縮包。

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

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

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

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

找到listen選項(xiàng),設(shè)置端口,大約46行,一般不修改,使用默認(rèn)80,在開(kāi)啟服務(wù)器前請(qǐng)保證80端口未被占用

找到documentroot選項(xiàng),修改服務(wù)器根目錄,例:

?
1
documentroot "f:/"

請(qǐng)保證此目錄存在,否則服務(wù)器無(wú)法正常啟動(dòng)

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

?
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選項(xiàng),設(shè)置服務(wù)器腳本目錄,大約326行,一般將其設(shè)置為apache目錄下的cgi-bin文件夾

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

找到隨后的directory選項(xiàng),設(shè)置腳本目錄,大約342行,需要將其設(shè)置為和前面的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配置

如果你這使啟動(dòng)服務(wù),一般會(huì)出現(xiàn)下面的消息對(duì)話(huà)框:

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

提示

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

確定此問(wèn)題的原因:

右鍵 計(jì)算機(jī),點(diǎn)擊管理->windows日志->應(yīng)用程序,顯示如下

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

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

這是由于ssl配置不正確所產(chǎn)生的,下面說(shuō)一下解決辦法。

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

第一個(gè)在107行左右。

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

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

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

在126行左右,將customlog改為:apache所在目錄/logs/ssl_request.log,這個(gè)不改的話(huà)也會(huì)錯(cuò)。一般會(huì)出現(xiàn)如下錯(cuò)誤:

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

apache2.2服務(wù)由于下列服務(wù)特定錯(cuò)誤而終止:函數(shù)不正確。

改成的效果:

?
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行還有另外兩個(gè)virtualhost,均需修改上述的四個(gè)選項(xiàng)

例:

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>

上述的兩個(gè)virtualhost均需修改四處

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

4,啟動(dòng)apache http server

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

然后雙擊bin目錄下的apachemonitor.exe,點(diǎn)擊右邊的start啟動(dòng)服務(wù)器,如果正常,如下圖:

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

測(cè)試一下:

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

5,其它

卸載apache http server:

管理員身份進(jìn)入bin目錄,使用httpd -k uninstall 移除服務(wù)

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

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

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 精品无码一区在线观看 | 岛国a香蕉片不卡在线观看 荡女淫春2古装 | 国产高清国内精品福利色噜噜 | 亚洲成在人网站天堂一区二区 | igao网果冻传媒 | 国产午夜免费不卡精品理论片 | 国产精品对白刺激久久久 | 亚洲国产成人99精品激情在线 | www.国产一区二区三区 | 欧洲vodafonewi精品| 嫩草影院永久在线一二三四 | 美女脱得一二净无内裤全身的照片 | 色色色色网站 | 欧美日韩高清完整版在线观看免费 | 久久久久久久国产精品视频 | 亚洲欧美一 | 成人亚洲欧美综合 | 国产精品午夜性视频网站 | 女人张开腿让男人桶视频免费大全 | 国产高清在线精品一区 | 日韩一区二区三区四区区区 | 纲手被强喷水羞羞漫画 | 欧美日韩国产精品自在自线 | 欧美亚洲国产综合在线 | 欧美高清在线精品一区 | 97国产蝌蚪视频在线观看 | 日本五级床片全都免费播放 | 国产精视频 | 日韩一区二区中文字幕 | 精品国产自在现线久久 | 女女性恋爱免费 | 国产99精品免费视频看6 | 99国产高清久久久久久网站 | 日本大片免a费观看在线 | 波多野结衣家庭教师 | 91精品综合久久久久m3u8 | 天美网站传媒入口网址 | 91视频99 | 国内精品久久久久影院中国 | 精品免费视在线观看 | 麻豆婷婷 |