Apache 伺服器簡單配置例項

2021-04-06 23:09:16 字數 1401 閱讀 4865

本人最近學習無線程式設計,需要

apache

apache2.0

web伺服器,在自己家裡瞎搞了好長一段時間,把我這配置好的過程共享給沒有經驗的

apache

初級使用者。

1.首先,假如你把檔案儲存在「

e:/web/www」中。

2.c:/program files/apache group/apache2/conf 中找到httpd.conf檔案,用編輯工具開啟該檔案,在httpd.conf中最後插入

這是配置好的例項:

「listen 8002

serveradmin [email protected]

documentroot " e:/web/www"

servername apach1

#    serverpath /domain

#    errorlog logs/dummy-host.example.com-error_log

#    customlog logs/dummy-host.example.com-access_log common」 

必須項如下:

a)listen 監聽埠,如果你要用該埠在httpd.conf尋找一下,是否已經占用了,如果沒有你就可以使用該埠,為了不與其他伺服器使用的埠衝突,自己取一沒有用到的埠,如果你機器安裝了iis伺服器,你就不能用80埠。

b) c) serveradmin [email protected]  ,這個可以隨便輸入。

d)  documentroot "d:/webtest/wml"  這個非常重要,記住,是用「/」

e)  servername apach1  這個名字可以隨便取。

f)  這個要與前面的對應

3.然後儲存httpd.conf檔案,再重新啟動monitor apache servers伺服器。如果伺服器可以啟動,基本上是沒有問題的。

4.在瀏覽器裡面輸入:htt://127.0.0.1:8002 ,就可以開啟頁面。

最後需要注意一點的是:

# the index.html.var file (a type-map) is used to deliver content-

# negotiated documents.  the multiviews option can be used for the

# same purpose, but it is much slower.

#directoryindex index.html index.html.var  test.wml  main.html

把你需要開啟的檔案新增到後面,我的主頁名稱是「main.html」

就這樣,如果你在遊覽器裡面能開啟,就說明你已經配置好了,如果你用伺服器名開啟的話,需要配置dsn網域名稱解析。

-----謝春迪 於2006/05/03  

Apache伺服器幾點簡單配置

1.禁止目錄瀏覽設定 開啟conf目錄下的httpd.conf檔案,然後搜尋 options indexes followsymlinks 去掉 indexes 也就是變為 options followsymlinks 即可。2 全域性預設頁面設定 directoryindex index.shtm...

apache伺服器配置

1.首先說明監聽埠 listen 80 2.然後是主站點的配置 基本配置 serveradmin com documentroot var www html servername test.com errorlog logs amc error log customlog logs amc acce...

Apache服務 前端伺服器配置

一 重要概念 虛擬主機 virtualhost 對外開的虛擬主機和埠號 vhosts.conf 虛擬主機配置檔案 workers.properties worker的配置檔案,tomcat 或其他伺服器 的連線池配置 hosts 本地host檔案,做本地的網域名稱對映,網域名稱解析會首先找到這個檔案...