Skip to content

Instantly share code, notes, and snippets.

@clozed2u
Forked from anoochit/gogs.sh
Created May 13, 2016
Embed
What would you like to do?
gogs.sh config gogs with nginx
APP_NAME="gogs"
MYSQL_PASSWORD="change_me"
HOSTNAME="example.com"
# setup mysql server and database
debconf-set-selections <<CONFIG
mysql-server-5.5 mysql-server/root_password password ${MYSQL_PASSWORD}
mysql-server-5.5 mysql-server/root_password_again password ${MYSQL_PASSWORD}
CONFIG
apt-get install -y --force-yes mysql-server
mysql -uroot -p${MYSQL_PASSWORD} -e "create database if not exists ${APP_NAME};"
# setup nginx configuration
apt-get install -y nginx
cat > /etc/nginx/sites-available/default <<EOF
server {
listen 80;
server_name ${HOSTNAME};
location / {
proxy_pass http://localhost:3000;
}
}
EOF
sudo service nginx restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment