2012-02-17 64 views
1

我的本地環境配置爲VirtualDocumentRoot指令。我的虛擬主機的配置看起來如下:使用Git倉庫的本地開發配置

<VirtualHost *:80> 
    ServerName dev 
    ServerAlias *.dev 
    UseCanonicalName Off 
    VirtualDocumentRoot "/var/www/html/%1/www" 

    <Directory "/var/www/html/%1/web"> 
     Options Indexes FollowSymLinks MultiViews 
     AllowOverride All 
     Allow from All 
    </Directory> 

    # Possible values include: debug, info, notice, warn, error, crit, alert, emerg 
    LogLevel warn 

    LogFormat "%{Host}i %h %l %u %t \"%r\" %s %b" vcommon 
    CustomLog logs/access_log vcommon 
    ErrorLog logs/error_log 

    Alias /info/ "/var/www/html/info.php" 
    Alias /info "/var/www/html/info.php" 
</VirtualHost> 

所以基本上我把文件放到sample-project/www目錄。現在想知道我應該如何將這個配置和這個方法與Git倉庫合併。

我使用gitweb在本地局域網上共享我的回購協議。但是,當目錄是sample-project gitweb顯示它爲sample-project/.git,但是當我將目錄名更改爲sample-project.git它看起來像我想要的。

我知道一些更高級的用戶可能會認爲這真的很愚蠢的問題,但這對我來說非常重要。我剛開始學習良好的做法,有新的環境,想知道好的建議。

和想法?

回答

1

如果你想使用gitweb,你需要調用你的gitweb安裝的gitweb.cgi腳本。

您將在我的Apache httpd.conf找到這樣一個配置的(使用SSL和LDAP認證,你可以忽略)爲例

DocumentRoot /home/auser/compileEverything/gitweb 
Alias /git /home/auser/compileEverything/gitweb 
<FilesMatch "\.(cgi|shtml|phtml|php)$"> 
    SSLOptions +StdEnvVars 
</FilesMatch> 
<Directory /home/auser/compileEverything/gitweb> 
</Directory> 

你可以這樣配置你的GitWeb(例如像,explained here),和您的gitweb.conf (as shown here for example)

+0

感謝您的回覆。只是想知道,你會推薦什麼結構的目錄進行高效管理? – DaveW 2012-02-17 12:05:42

+0

@DaveW:通過目錄結構,你指的是httpd.conf中聲明的目錄,或者存儲git倉庫的目錄,或者Git倉庫中的目錄? – VonC 2012-02-17 12:20:30

+0

只是一切。我現在完全喪失了所有的配置。我將所有項目存儲在'/ var/www/html /'目錄中。 'VirtualDocumentRoot'指令允許我使用虛擬子域,但是我想知道如何用這個結構來存儲Git倉庫。任何建議將非常感激。 – DaveW 2012-02-17 13:03:42