I finally figured it out in Apache!!! For anyone trying to get gitea running on Apache with a domain or subdomain, install apache:
sudo apt-get install apache2 -y
Next fix apache. There’s a localhost error that’s built into apache that drives me nuts… to fix it run:
echo "ServerName localhost" >> /etc/apache2/apache2.conf
Next fix apache for gitea. If you’re using a Gitea droplet apache will have thrown an error during install. This is ok, it’s just cuz its trying to initialize with a default setup on port 80 and Gitea is config’d to that port on DigitialOcean’s image. So to disable 000-default
sudo a2dissite 000-default.conf
Then there are 2 apache mods required, so to install those type:
sudo a2enmod proxy
sudo a2enmod proxy_http
Next create, enable, and edit a new conf file for apache:
sudo touch /etc/apache2/sites-available/gitea.conf
sudo a2ensite gitea
sudo nano /etc/apache2/sites-available/gitea.conf
Then add setup the reverse proxy
<VirtualHost *:80>
ServerName git.example.com
ProxyPreserveHost On
ProxyRequests off
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
</VirtualHost>
Finally restart apache (if you get an error about it already being stopped it’s cuz it never started because of the droplet error)
sudo service apache2 stop
sudo service apache2 start
systemctl status apache2.service
So… Apache vs Nginx for Gitea any advice? I remember from using GitLab that apache was a pain to setup so ended up caving n using nginx for ce n ci server.
Here’s my failed steps for Apache
Then I paste in this and restart apache
I’ve tried changing Gitea’s port to 3000 and tried changing apache’s reverse to 80/443 and just can’t get it working ^_^