[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian, Git server, Nginx, Fcgiwrap, and git push can not create remote object directory



Hello,

"I'm assuming that you replaced 'git.domain.com' and 'domain.com'
in this config with real domain names, and that they are
functional and tested."

Yes, the real domains are functional and tested.

"All this is to set up a fastCGI-compliant server protected with
HTTP basic auth and accessed via a socket at
/var/run/fcgiwrap.socket.

Is it running? Is it configured for a socket there?

are username and password properly set up in .gitpasswd?"

Yes, the fcgiwrap is running and the socket is there. Yes, usernames
and passwords are also set up in .gitpasswd.

"And here's a different one to run PHP scripts. Is php8.2
installed, is the fpm module installed and running, is
/run/php/php8.2-fpm.sock actually present?"

Yes, PHP 8.2 is installed and running, again that socket is also working.

Thanks.
Dave..


On 9/9/23, Dan Ritter <dsr@randomstring.org> wrote:
> David Mehler wrote:
>> I'm trying to set up a git server on Debian 12, served by Nginx via
>> https. I used this as a debian-specific starter though I have done
>> this in the past using a FreeBSD and Apache type setup:
>>
>> https://esc.sh/blog/setting-up-a-git-http-server-with-nginx/
>
> ...
>
>> nginx configuration file:
>>
>> server {
>> listen       443 ssl http2;
>>
>> server_name git.domain.com;
>>
>> # ECC/ECDSA certificates (dual config)
>> ssl_certificate /etc/ssl/domain.com/domain.com.fullchain.crt.ecc;
>> ssl_certificate_key /etc/ssl/domain.com/domain.com.key.ecc;
>> ssl_session_cache shared:domainSSL:50m;
>> ssl_dhparam /etc/ssl/domain.com/dhparams.pem;
>
> I'm assuming that you replaced 'git.domain.com' and 'domain.com'
> in this config with real domain names, and that they are
> functional and tested.
>
>
>> location / {
>> # First attempt to serve request as file, then
>> # as directory, then fall back to displaying a 404.
>> try_files $uri $uri/ =404;
>> }
>
>> location ~ (/.*) {
>> client_max_body_size 0;
>> auth_basic "Git Login";
>> auth_basic_user_file /etc/nginx/.gitpasswd;
>> fastcgi_pass  unix:/var/run/fcgiwrap.socket;
>> include       fastcgi_params;
>> fastcgi_param SCRIPT_FILENAME     /usr/lib/git-core/git-http-backend;
>> # export all repositories under GIT_PROJECT_ROOT
>> fastcgi_param GIT_HTTP_EXPORT_ALL "";
>> fastcgi_param GIT_PROJECT_ROOT    /srv/git;
>> fastcgi_param REMOTE_USER $remote_user;
>> fastcgi_param PATH_INFO           $1;
>> }
>
> All this is to set up a fastCGI-compliant server protected with
> HTTP basic auth and accessed via a socket at
> /var/run/fcgiwrap.socket.
>
> Is it running? Is it configured for a socket there?
>
> are username and password properly set up in .gitpasswd?
>
>> # Pass PHP Scripts To FastCGI Server
>> location ~ \.php$ {
>> fastcgi_split_path_info ^(.+\.php)(/.+)$;
>> fastcgi_pass unix:/run/php/php8.2-fpm.sock; #depends on PHP versions
>> fastcgi_index index.php;
>> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
>> include fastcgi_params;
>> }
>> }
>
> And here's a different one to run PHP scripts. Is php8.2
> installed, is the fpm module installed and running, is
> /run/php/php8.2-fpm.sock actually present?
>
>
> This all smacks of following directions without understanding
> quite what they do. Everyone has to start somewhere.
>
> -dsr-
>


Reply to: