綠色版Apache + PHP的環境搭建

來源:互聯網
上載者:User
Apache

1. httpd.exe -k install

D:\DevelopPlatform\Apache24X86\bin>httpd.exe -k install
Installing the 'Apache2.4' service
The 'Apache2.4' service is successfully installed.
Testing httpd.conf....
Errors reported here must be corrected before the service can be started.
httpd.exe: Syntax error on line 37 of D:/DevelopPlatform/Apache24X86/conf/httpd.
conf: ServerRoot must be a valid directory
修正錯誤:
進入httpd.conf, 設定ServerRoot:(apache安裝目錄)
樣本:ServerRoot "D:/DevelopPlatform/Apache24X86"

1.1. httpd.exe -k uninstall

Removing the 'Apache2.4' service
The 'Apache2.4' service has been removed successfully.

2. httpd.exe -k install

Installing the 'Apache2.4' service
The 'Apache2.4' service is successfully installed.
Testing httpd.conf....
Errors reported here must be corrected before the service can be started.
AH00526: Syntax error on line 244 of D:/DevelopPlatform/Apache24X86/conf/httpd.c
onf:
DocumentRoot must be a directory
修正錯誤:
進入httpd.conf, DocumentRoot:(apache htdocs目錄)
樣本:DocumentRoot "D:\DevelopPlatform\Apache24X86\htdocs"

2.1. httpd.exe -k uninstall

Removing the 'Apache2.4' service
The 'Apache2.4' service has been removed successfully.

3. httpd.exe -k install

Installing the 'Apache2.4' service
The 'Apache2.4' service is successfully installed.
Testing httpd.conf....
Errors reported here must be corrected before the service can be started.

4.

至此, apache已經安裝完畢,
然後配置一下apache
進入httpd.conf
找到
Listen 80改為8080(將監聽連接埠改為8080,防止80連接埠被佔用出錯)
開啟ServerName
改為ServerName localhost:8080
重新啟動下apache, 進入瀏覽器輸入: localhost:8080/index.html 進行訪問
這時有可能發生錯誤, 網頁會輸出如下內容:
You don't have permission to access /index.html on this server.
我的解決辦法是進入httpd.conf
在DocumentRoot "D:\DevelopPlatform\Apache24X86\htdocs"下一行的
找到

  • 相關文章

    聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.