Created
March 15, 2016 14:41
-
-
Save anoochit/6c4b31b996d4d25bea65 to your computer and use it in GitHub Desktop.
gogs.sh config gogs with nginx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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