1

I have my local environment configured with VirtualDocumentRoot directive. My virtual host config looks as following:

<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>

So basically I put files into sample-project/www directory. Now wondering how should I merge this configuration and this approach with Git repositories.

I'm using gitweb to share my repos on my local LAN network. However, when the directory is sample-project gitweb shows it as sample-project/.git, but when I change directory name to sample-project.git it looks as I want.

I know some of more advanced users may think it's really stupid question, but this is quite important for me. I just started learning good practices, have new environment and want to know good advices.

And ideas?

asked Feb 17, 2012 at 0:48

1 Answer 1

1

If you want to use gitweb, you need to call the gitweb.cgi script of your gitweb installation.

You will find in my Apache httpd.conf an example of such a config (with SSL and LDAP authentication that you can ignore)

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>

You would then configure your gitweb (like for instance, explained here), and your gitweb.conf (as shown here for example).

answered Feb 17, 2012 at 7:06
Sign up to request clarification or add additional context in comments.

7 Comments

Thanks for the reply. Just wondering, what structure of directories would you recommend for efficient management?
@DaveW: by structure of directories, are you referring to the directories declared in the httpd.conf, or the directories where the git repos are stored, or the directories within a Git repo data?
Just everything. I'm completely lost with all the configuration stuff right now. I'm storing all my projects in /var/www/html/ directory. VirtualDocumentRoot directive allows me to use virtual subdomains however I'm wondering how I should store Git repos with this structure. Any suggestion will be really appreciated.
@DaveW: when using in conjunction with GitWeb, the simplest structure is the best: you just need all your repos within one root directory, and you would reference that in your gitweb.conf as mentioned in gofedora.com/how-to-install-configure-gitweb. This is very different from the VirtualDocumentRoot: a DocumentRoot is enough and reference gitweb, not the Git repos.
Thanks for your time. Last question, if you don'y mind: please clarify, I do not have to store my repositories in my projects directory tree, am I right? Could I store repos in /var/www/git/ and projects in /var/www/html/? Every file changed is being uploaded into my remote machine. Would it be correct? Once again, thanks for your replies and effort!
|

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.