简体   繁体   中英

Local Development Configuration with Git repositories

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM