2010-03-16

於 Ubuntu 手動安裝 Apache HTTP Server (Manuel install the Apache HTTP Server in Ubuntu)

前往 http://httpd.apache.org/
Visit http://httpd.apache.org/

點擊 Downloads > from a mirror
Click Downloads > from a mirror

點擊 2.2.15 後下載 httpd-2.2.15.tar.gz (暫時儲存至 Desktop 位置方便尋找)
(2.2.15 是 2010-03-16 最新版本)
Click 2.2.15 and download httpd-2.2.15.tar.gz (Save at Desktop for easy find)
(2.2.15 is the latest version on 2010-03-16)

下載 .tar.gz 檔案後開啟 Terminal
輸入以下指令
After download the .tar.gz file then open the Terminal
Enter the command below

cd "/home/abc/Desktop"
abc 是使用者登入名稱
abc is the user login name

tar -zxvf "./httpd-2.2.15.tar.gz"
將 .tar.gz 檔案解壓縮
Unzip the .tar.gz

cd "./httpd-2.2.15"
進入 httpd 的目錄
change directory to httpd directory

"./configure" --prefix="/usr/local/apache"
設定配置資料 (除了 prefix 還有其他 options 可以調整但現在只進行基本配置)
setup the config file (unless prefix there are other options but we install the general settings)

make
編譯配置資料
Compile the file

sudo make install
第一次使用 sudo 後需要輸入使用者登入密碼
進行安裝
You need to enter the password when you use sudo
Begin to install

以上三句指令都需時間處理
The above 3 commands need more time to deal

處理後
After the process

sudo gedit "/usr/local/apache/conf/httpd.conf"
開啟 gedit 後在 #ServerName www.example.com:80 下一行輸入
ServerName 127.0.0.1:80
(若不是使用 port 80 是可以更改的)
Open gedit and search #ServerName www.example.com:80
and type ServerName 127.0.0.1:80 at the next line
(If you don't use port 80 you can change it)

sudo /usr/local/apache/bin/apachectl start
起動 Apache HTTP Server
Start the Apache HTTP Server

有需要的話可以輸入以下指令
If you need you can enter this command

sudo cp "/usr/local/apache/bin/apachectl" "/etc/init.d/httpd"
這樣便可以透過
This can be through

sudo service httpd start
來起動 Apache HTTP Server 不用記著太長的檔案路徑
Start the Apache HTTP Server and don't need to type a long path

(將 start 改為 stop 則是終止運作)
(change start to stop to stop the server)

開啟任何瀏覽器並於網址列輸入 http://127.0.0.1:80/
若能夠顯示 It works! 表示設定完成 Apache HTTP Server 可以運作
若不能夠願顯示則未設定好完成請重新確認設定資料,有需要時由頭重新設定
Open any Web Browser and type http://127.0.0.1:80/ in URL bar
If shows It works! that means the Apache HTTP Server is running
If can't, check the config file, or you need to re-install the Server

沒有留言 :

張貼留言