Win8(X64)下安裝配置卸載Apache2.4.12(httpd-2.4.12-x64-vc11

一、下載的安裝包

http://httpd.apache.org/download.cgiapache

    httpd-2.4.12-win64-VC11.zip將其放到本身的安裝目錄(個人目錄D:/Programs/Apache24)ui

二、(安裝庫)Required Redistributable

    Binaries built on Visual C++ 2012 x64 do not run on Windows XP or Windows Server 2003
    These binaries were built with Visual Studio� 2012 x64, be sure to install the required Visual C++ 2012  x64 Redistributable Package, download from;命令行

http://www.microsoft.com/en-us/download/details.aspx?id=30679翻譯

三、配置http.conf文件

       (Apache24\conf\http.conf)配置文件進行修改-使用記事本打開就行rest

    (1)修改ServerRoot Apache的根路徑:ip

        (38行)ServerRoot"/Apache24"改爲=>ServerRoot "D:/Programs/Apache24"get

     (2)修改ServerName你的主機名稱:cmd

        (220行)ServerName localhost:80將前面的#去掉,該屬性在從命令行啓動Apache時須要用到。it

    (3)修改端口Listen(我這邊80端口唄佔用了,因此修改爲了7070端口)io

       (60行)Listen 80→Listen7070

四、安裝啓動Apache

       win+x,選擇「命令提示符(管理員)」。接着進入D:\Programs\Apache24\bin目錄下

To Install Apache as a service:

In most cases you will want to run Apache as a Windows Service.
To do so you  install Apache as a service by typing at the command prompt [1];

httpd -k install

You can then start Apache by typing

httpd -k start

Apache will then start and eventually release the command prompt window.

[1] You have to run the command prompt as Administrator in Windows Vista/7/2008/8/8.1/10/2012/

Other Command line options:                        

Stop Apache
httpd -k stop

Restart Apache
httpd -k restart

Uninstall Apache Service
httpd -k uninstall

Test Config Syntax
httpd -t

Version Details
httpd -V

Command Line Options List
httpd -h

五、驗證服務是否啓動

打開IE,而後在地址欄輸入:"http://localhost:7070" 或者 "http://127.0.0.1:7070" 能夠看到Apache安裝完成的成功頁面;之後網頁的存在位置就在 "D:/Programs/Apache24/htdocs" 目錄。進入下面的界面:

六、卸載服務

        打開電腦 「開始」->「運行」-> cmd,進入DOS命令行窗口,進入Apache安裝目錄,如 D:\Programs\Apache24\bin目錄。(使用管理員權限)
        輸入命令:httpd.exe -k uninstall 卸載Apache服務。(注:httpd.exe -k install 命令是安裝Apache 服務)。

七、常見錯誤:

    (1)

AH00369: Failed to open the Windows service manager, perhaps you forgot to log in as Adminstrator?

    緣由及解決:沒有管理員權限,用管理員權限打開命令行就能夠。

    (2)

httpd: Syntax error on line 39 of D:/Programs/Apache24/conf/httpd.conf: ServerRoot must be a valid directory

    緣由及解決:Apache服務地址錯誤,修改httpd.conf的   (38行)行ServerRoot "/Apache24"中的目錄爲實際Apache目錄,注意"/"

    (3)

Errors reported here must be corrected before the service can be started.

    不少人看到Errors都會想怎麼啓動就遇到錯誤啊,首先須要強調的是這句話並非說Apache啓動錯誤。 這句話是Apache內置的啓動提示語句,暫時沒有找到取消和更改的方法。

    這句話英文翻譯後能夠理解爲:

        Apache每次啓動都會檢測配置文件httpd.conf有沒有錯誤,若是在Errors reported here must be corrected before the service can be started.這句話下邊出現提示或錯誤時必須先把這些問題解決了才能成功啓動Apache服務。

        因此你們看到Errors reported here這句下邊沒有任何提示則說明Apache啓動很成功!能夠放心進行其餘相關操做。

相關文章
相關標籤/搜索