To setup Forgejo, perform the following:
* Create a user and database for forgejo (while granting rights)
* Start forgejo.service
* Change the configuration under [server] in /etc/forgejo/conf/app.ini and then
call http://server:port/ (default is http://localhost:3000) to finish setup.
Alternatively, you can call http://server:port/ and setup from there and
change /etc/forgejo/conf/app.ini afterwards.
You can create an admin user on the console by running:
su - git
forgejo --name admin --password somePassword --email some@email.com --admin
---
If you want to access forgejo through httpd (apache), install the forgejo-httpd
subpackage, and change /etc/httpd/conf.d/forgejo.conf. There are comments in that
file that give you examples of how to set it up, either as a vhost or as a
subdirectory like /git
This will require you to also change the [server] section, in particular,
ROOT_URL to match what you are expecting.
---
I would highly recommend that you setup the webserver to run on a socket rather
than a simple web server. That way, when you setup httpd or nginx, you can run
the reverse proxy into the socket. For example.
<Location />
ProxyPass unix:/run/forgejo/forgejo.socket|http://127.0.0.1/
ProxyPassReverse unix:/run/forgejo/forgejo.socket|http://127.0.0.1/
</Location>
---
If you plan on using SSH on the native 22 port, you do *not* have to disable
your default sshd service. Instead, you can add the following line to
/etc/ssh/sshd_config or /etc/ssh/sshd_config.d/99-forgejo.conf (EL9 and Fedora):
AcceptEnv GIT_PROTOCOL