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?
1 Answer 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).
7 Comments
/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.VirtualDocumentRoot: a DocumentRoot is enough and reference gitweb, not the Git repos./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!