回精華區
作者tsaikd.bbs@bbs.tsaikd.org (千人斬) 看板: plan
標題Re: [問題] 關於首頁
時間地下惡魔城 (2005/09/11 Sun 12:39:12)
※ 引述《Fish.bbs@cpu.tfcis.org (魚笨魚蠢呆呆魚)》之銘言:
>     因為有執行 bhttpd
>     所以現在機器的首頁是 bhttpd 的首頁
>     那我如果希望一進入機器的首頁是其他首頁
>     位址要是 http://MyAddress/bbs 才進入 bhttpd 的首頁

  首先,將 bhttpd 改 port

: config.h

- #define BHTTP_PORT      80
+ #define BHTTP_PORT      8000

> ──────────────────────────────────── <

  若是 FreeBSD,則這樣做

: /etc/service 加入

bhttp           8000/tcp    www www-http         #Web BBS
bhttp           8000/udp    www www-http         #Web BBS

: /etc/inetd.conf 加入

bhttp   stream  tcp     wait    bbs     /home/bbs/bin/bhttpd    bhttpd -i

> ──────────────────────────────────── <

  若是 Linux,則這樣做

: /etc/xinetd.d/http 改回 apache 的

service http
{
        disable         = no
        socket_type     = stream
        protocol        = tcp
        wait            = no
        user            = nobody
        server          = /home/apache/bin/httpd
        nice            = 5
        log_on_sucess   -= HOST PID
}

: /etc/xinetd.d/bhttp 新增此檔案

service bhttp
{
        disable         = no
        flags           = REUSE
        socket_type     = stream
        wait            = yes
        user            = bbs
        server          = /home/bbs/bin/bhttpd
        port            = 8000
        server_args     = -i
}

> ──────────────────────────────────── <

  接著 apache 用 vhost,加入這個設定

<VirtualHost bbs.tsaikd.org:80>
    DocumentRoot "/var/www/localhost/htdocs"
    ServerName "bbs.tsaikd.org"
    Redirect "/" "http://bbs.tsaikd.org:8000/"
</VirtualHost>

進到 http://bbs.tsaikd.org/ 就會轉成 http://bbs.tsaikd.org:8000/

Redirect 就是轉址的動作

相關的設定找 google 會比較詳細...^_^

--
 千        人         斬    KD !! 地下惡魔城 telnet://bbs.tsaikd.org
 K Delete         殺殺殺 殺到你脫褲子 "放屁" !!
 i    ~~      ▄▃▂▁       ︿◎    ︿◎    ︿◎ 快逃啊!!
 l    ~~ ◤ ̄ ̄                  ◤﹀    ◤﹀    ◤﹀
 o   ~ /∣                  ..﹀〉....﹀〉....﹀〉

--
  Origin:  成大資訊˙地下惡魔城  bbs.tsaikd.org 
  Author: tsaikd 140.116.103.204 發表
精華選讀←離開[主題上]主題下(k)上篇(j)下篇S/a搜尋 G串列 TAB精華 ↑↓捲 Pg/Space翻