3

I've installed virtualmin on my VPS to manage my websites. It's working perfect and as expected nearly a year now. Recently I wanted to add some features to one of my sites, and I need git integration.

I've correctly installed git & gitweb on my server, and I can create repositories and watch them under http://sub.domain.com/git/gitweb.cgi Here is the current relevant directory tree:

/home/user/domains/sub.domain.com/public_html/git/

drwxr-sr-x user   user .
drwxr-x--- user   user ..
-rw-r--r-- user   user git-favicon.png
-rw-r--r-- user   user git-logo.png
-rwxr-xr-x user   user gitweb.cgi
-rw-r--r-- user   user gitweb.css
drwxrwx--- apache user reponame.git

/home/user/domains/sub.domain.com/public_html/git/reponame.git/

drwxrwx--- apache user .
drwxr-sr-x user   user ..
drwxrwx--- apache user branches
-rwxrwx--- apache user config
-rwxrwx--- user   user description
-rwxrwx--- apache user HEAD
drwxrwx--- apache user hooks
drwxrwx--- apache user info
drwxrwx--- apache user objects
drwxrwx--- apache user refs

But I have some questions:

  1. When I'm visiting http://sub.domain.com/git/gitweb.cgi, the owner is listed as 'Apache'. why? how can I change that?

  2. Usually, to create a new git repository, I'll do something like:

    $ mkdir proj
    $ cd proj
    $ git init
    Initialized empty Git repository in /home/user/proj/.git/
    // here I'm creating the files or copy them from somewhere else
    $ git add *.php
    $ git add README
    $ git commit -m 'initial version'
    

But after creating the repository in virtualmin, I can find a new dir named 'reponame.git' but not the '.git' dir. When I'm trying to run any git command (e.g. git status) I'm receiving "fatal: This operation must be run in a work tree". How can I work with that repository?

  1. Currently I need to explicitly grant access for users to be able to view the repositories via gitweb. How can I make certain repositories public?
1

2 Answers 2

0

Did you install Virtualmin using the install.sh auto-install script we provide at Virtualmin.com? Or did you install Virtualmin manually?

The behavior you describe means your scripts are not being executed using suexec, but rather as the Apache user. If you used the install script, suexec should be configured, by default for all script types. If you installed manually, you'll need to set that up yourself, as well as recompile Apache (or, install the apache2-suexec-custom package, and configure it for /home, if you're using Debian/Ubuntu) to set the suexec docroot to /home.

We have some documentation about manual installs on our website, but a manual install still requires pretty significant knowledge and a big time investment. We recommend using the install script on a freshly installed Grade A supported OS, as documented on our Download page.

I don't know anything about gitweb, so I'll leave those questions unanswered.

0

Regarding the ownership issue: On some setups, the PHP configuration installed by a package manager (e.g. apt) overrides Virtualmin's fcgid config. The solution in this case is to edit /etc/apache2/mods-available/php5.conf, comment out the line SetHandler application/x-httpd-php, and then run apache2ctl graceful.

Not the answer you're looking for? Browse other questions tagged .