By travisreames
Hey I’ve tried Apache and Nginx and can’t get either working with the image from the DigitalOcean Marketplace. So Here’s what I have:
I’ve tried:
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.