{"id":18805800,"url":"https://github.com/mskian/gotify-apache","last_synced_at":"2025-08-08T15:35:14.392Z","repository":{"id":40310842,"uuid":"187148169","full_name":"mskian/gotify-apache","owner":"mskian","description":"Install and Configure Gotify without Docker in Apache Server","archived":false,"fork":false,"pushed_at":"2020-05-12T03:07:25.000Z","size":9,"stargazers_count":7,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T09:51:55.515Z","etag":null,"topics":["apache","apache2","certbot","gotify","nginx","push-notifications","server","vhost"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mskian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-17T04:46:30.000Z","updated_at":"2024-08-05T16:33:22.000Z","dependencies_parsed_at":"2022-08-26T12:34:15.848Z","dependency_job_id":null,"html_url":"https://github.com/mskian/gotify-apache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mskian%2Fgotify-apache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mskian%2Fgotify-apache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mskian%2Fgotify-apache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mskian%2Fgotify-apache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mskian","download_url":"https://codeload.github.com/mskian/gotify-apache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248766745,"owners_count":21158301,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache","apache2","certbot","gotify","nginx","push-notifications","server","vhost"],"created_at":"2024-11-07T22:45:03.635Z","updated_at":"2025-04-13T19:12:41.601Z","avatar_url":"https://github.com/mskian.png","language":"Shell","readme":"# Gotify Apache\n\nInstall and Configure Gotify without Docker in Apache Server.\n\n## Requirements\n\n- Ubuntu 18.04 64bit LTS\n- Apache\n- MYSQL\n\n## Installation\n\n- create new user\n\n`Replace \u003cuser\u003e with your username | if you are already having an user in your server skip the user creation step`\n\n```bash\nadduser \u003cuser\u003e\n```\n\n- Add superuser group permission to unlock admin privileges\n\n```bash\nusermod -aG sudo \u003cuser\u003e\n```\n\n- Login as user\n\n```bash\nsu - \u003cuser\u003e\n```\n\n- Update the packages\n\n```bash\nsudo apt-get update\n```\n\n```bash\nsudo apt-get upgrade\n```\n\n- Create a Folder for Gotify Installation\n\n```bash\nsudo mkdir -p /var/www/gotifypush\n```\n\n- Replace `\u003cuser\u003e` with the your username\n\n```bash\nsudo chown \u003cuser\u003e:\u003cuser\u003e /var/www/gotifypush\n```\n\n- Set correct Folder Permision\n\n```bash\nsudo chmod 775 /var/www/gotifypush\n```\n\n- Download Gotify\n\n```bash\ncd /var/www/gotifypush\n```\n\n- Download Latest Binary File From the Github respo \u003chttps://github.com/gotify/server/releases\u003e Release Page\n\n`Example`\n\n```bash\nwget https://github.com/gotify/server/releases/download/v2.0.5/gotify-linux-amd64.zip\n```\n\n```bash\nchmod +x gotify-linux-amd64\n```\n\n- Create a New File Named as `config.yml`\n\n```bash\nsudo nano config.yml\n```\n\n- Just add this Below Configuration\n\n\u003e Leave `ssl` Settings | Add your domain in `stream` settings | Add your Database user and Pass in `database` settings | Update your Account Admin User \u0026 pass in `defaultuser` settings also update your gotify installation Directory.\n\n```yml\n# Example configuration file for the server.\n# Save it to `config.yml` when edited\n\nserver:\n  listenaddr: \"\" # the address to bind on, leave empty to bind on all addresses\n  port: 9000 # the port the HTTP server will listen on\n\n  ssl:\n    enabled: false # if https should be enabled\n    redirecttohttps: false # redirect to https if site is accessed by http\n    listenaddr: \"\" # the address to bind on, leave empty to bind on all addresses\n    port: 443 # the https port\n    certfile: # the cert file (leave empty when using letsencrypt)\n    certkey: # the cert key (leave empty when using letsencrypt)\n    letsencrypt:\n      enabled: false # if the certificate should be requested from letsencrypt\n      accepttos: false # if you accept the tos from letsencrypt\n      cache:  # the directory of the cache from letsencrypt\n      hosts: # the hosts for which letsencrypt should request certificates\n      - push.example.com\n  \n  responseheaders: # response headers are added to every response (default: none)\n    Strict-Transport-Security: max-age=31536000\n    X-Xss-Protection: 1; mode=block\n\n  cors: # Sets cors headers only when needed and provides support for multiple allowed origins. Overrides Access-Control-* Headers in response headers.\n    alloworigins:\n      # - \"example.com\"\n    allowmethods:\n      # - \"GET\"\n      # - \"POST\"\n    allowheaders:\n      # - \"Authorization\"\n      # - \"content-type\"\n\n  stream:\n    allowedorigins: # allowed origins for websocket connections (same origin is always allowed)\n  #    - \".+.example.com\"\n  #    - \"push.example.com\"\n\ndatabase: # for database see (configure database section)\n  dialect: mysql\n  connection: root:DBPASS@tcp(127.0.0.1)/gotifydb?charset=utf8\u0026parseTime=True\u0026loc=Local\n\ndefaultuser: # on database creation, gotify creates an admin user\n  name: admin # the username of the default user\n  pass: admin # the password of the default user\npassstrength: 10 # the bcrypt password strength (higher = better but also slower)\nuploadedimagesdir: /var/www/gotifypush/data/images # the directory for storing uploaded images\npluginsdir: /var/www/gotifypush/data/plugins # the directory where plugin resides\n```\n\n### Note Point\n\nIf you Enable Firewall on your server allow the port `9000` and Don't Forget to Create a Database - Create a New database in MYSQL Named as `gotifydb`.\n\n- Next Create a New bash file named as `start.sh` in the Gotify Installed directory\n\n```bash\n#!/bin/bash\n\n./gotify-linux-amd64\n```\n\n```bash\nchmod +x start.sh\n```\n\n- Over all File listing in Gotify Installation Folder `var/www/gotifypush`\n\n```bash\n- config.yml\n- start.sh\n- gotify-linux-amd64\n```\n\n- Create a Vhost for Gotify\n- Apache VHost Configuration for HTTP\n\n```bash\nsudo nano /etc/apache2/sites-available/gotifypush.conf\n```\n\n`gotifypush.conf`\n\n```bash\n\u003cVirtualHost *:80\u003e\n\n    # The ServerName directive sets the request scheme, hostname and port that\n    # the server uses to identify itself. This is used when creating\n    # redirection URLs. In the context of virtual hosts, the ServerName\n    # specifies what hostname must appear in the request's Host: header to\n    # match this virtual host. For the default virtual host (this file) this\n    # value is not decisive as it is used as a last resort host regardless.\n    # However, you must set it for any further virtual host explicitly.\n\n    ServerName push.example.com\n    ServerAdmin webmaster@localhost\n    DocumentRoot /var/www/gotifypush\n    Keepalive On\n\n    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,\n    # error, crit, alert, emerg.\n    # It is also possible to configure the loglevel for particular\n    # modules, e.g.\n    #LogLevel info ssl:warn\n\n    ErrorLog ${APACHE_LOG_DIR}/error.log\n    CustomLog ${APACHE_LOG_DIR}/access.log combined\n\n    # For most configuration files from conf-available/, which are\n    # enabled or disabled at a global level, it is possible to\n    # include a line for only one particular virtual host. For example the\n    # following line enables the CGI configuration for this host only\n    # after it has been globally disabled with \"a2disconf\".\n    #Include conf-available/serve-cgi-bin.conf\n\n  RewriteEngine on\n  RewriteCond %{SERVER_NAME} =push.example.com\n  RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]\n\n    ProxyPreserveHost On\n    ProxyRequests off\n    #ProxyVia Full\n\n    # Proxy web socket requests to /stream\n    ProxyPass \"/stream\" ws://127.0.0.1:9000/ retry=0 timeout=5\n    # Proxy all other requests to /\n    ProxyPass \"/\" http://127.0.0.1:9000/ retry=0 timeout=5\n    ProxyPassReverse / http://127.0.0.1:9000/\n\n\u003c/VirtualHost\u003e\n\n# vim: syntax=apache ts=4 sw=4 sts=4 sr noet\n```\n\n- Enable Vhost\n\n```bash\nsudo a2ensite gotifypush.conf\n```\n\n- For SSL Use `https://certbot.eff.org/` (While a Creating SSL via Cetbot Select `NO` for Force SSL(HTTPS) Redirection Because already I added the Rewrite Rule for HTTPS Force Redirection)\n- Vhost Configuration for HTTPS (Actually It will Automatically Created by `certbot` but we need to Add some Extra Configuration to use Gotify/Server via HTTPS)\n\n```bash\nsudo nano /etc/apache2/sites-available/gotifypush-le-ssl.conf\n```\n\n`gotifypush-le-ssl.conf`\n\n```bash\n\u003cIfModule mod_ssl.c\u003e\n\u003cVirtualHost *:443\u003e\n    # The ServerName directive sets the request scheme, hostname and port that\n    # the server uses to identify itself. This is used when creating\n    # redirection URLs. In the context of virtual hosts, the ServerName\n    # specifies what hostname must appear in the request's Host: header to\n    # match this virtual host. For the default virtual host (this file) this\n    # value is not decisive as it is used as a last resort host regardless.\n    # However, you must set it for any further virtual host explicitly.\n\n    ServerName push.example.com\n    ServerAdmin webmaster@localhost\n    DocumentRoot /var/www/gotifypush\n    Keepalive On\n\n    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,\n    # error, crit, alert, emerg.\n    # It is also possible to configure the loglevel for particular\n    # modules, e.g.\n    #LogLevel info ssl:warn\n\n    ErrorLog ${APACHE_LOG_DIR}/error.log\n    CustomLog ${APACHE_LOG_DIR}/access.log combined\n\n    # For most configuration files from conf-available/, which are\n    # enabled or disabled at a global level, it is possible to\n    # include a line for only one particular virtual host. For example the\n    # following line enables the CGI configuration for this host only\n    # after it has been globally disabled with \"a2disconf\".\n    #Include conf-available/serve-cgi-bin.conf\n\n    SSLProxyEngine On\n    SSLProxyVerify require\n    SSLProxyCheckPeerName On\n    SSLCertificateFile /etc/letsencrypt/live/push.example.com/fullchain.pem\n    SSLCertificateKeyFile /etc/letsencrypt/live/push.example.com/privkey.pem\n    Include /etc/letsencrypt/options-ssl-apache.conf\n\n        RewriteEngine on\n        RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]\n        RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]\n        RewriteRule .* ws://127.0.0.1:9000%{REQUEST_URI} [P]\n\n        ProxyPreserveHost On\n        ProxyRequests off\n        #ProxyVia Full\n\n        # Proxy web socket requests to /stream\n        ProxyPass \"/stream\" ws://127.0.0.1:9000/ retry=0 timeout=5\n        # Proxy all other requests to /\n        ProxyPass \"/\" http://127.0.0.1:9000/ retry=0 timeout=5\n        ProxyPassReverse / http://127.0.0.1:9000/\n\n\u003c/VirtualHost\u003e\n\u003c/IfModule\u003e\n```\n\n```bash\nsudo service apache2 restart\n```\n\n- After all setup open Gotify Root Folder `var/www/gotifypush`\n- Run the Gotify \u0026 test the MYSQL database connection\n\n```bash\n./gotify-linux-amd64\n```\n\n- If the Test Passed Successfully Press CTRL + C to Stop the gotify/server\n- Setup systemd service to Run the Gotify/server Forever\n\n```bash\ncd /etc/systemd/system\n```\n\n```bash\nsudo nano gotifypush.service\n```\n\n`gotifypush.service`\n\n`Replace \u003cuser\u003e with the name of your user who will own this directory`\n\n```bash\n[Unit]\nDescription=Start Gotify - a simple server for sending and receiving messages\nRequires=network.target\nAfter=network.target\n\n[Service]\nType=simple\nUser=\u003cuser\u003e\nWorkingDirectory=/var/www/gotifypush\nExecStart=/bin/bash /var/www/gotifypush/start.sh\nRestart=always\nRestartSec=3\n\n[Install]\nWantedBy=multi-user.target\n```\n\n- CTRL + X \u0026 Enter to save the Service file Configuration\n- Next Enable the systemd service for Gotify server\n\n```bash\nsudo systemctl daemon-reload\n```\n\n```bash\nsudo systemctl enable gotifypush\n```\n\n```bash\nsudo systemctl start gotifypush\n```\n\n- Check status\n\n```bash\nsudo systemctl status gotifypush\n```\n\n- Restart\n\n```bash\nsudo systemctl restart gotifypush\n```\n\n- That's Successfully we Install and Setup Gotify on Apache Server without Docker\n\n## Update Gotify\n\nUpdate Gotify to the Latest Version - \u003chttps://github.com/mskian/gotify-apache/blob/master/upgrade.md\u003e\n\n## LICENSE\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmskian%2Fgotify-apache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmskian%2Fgotify-apache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmskian%2Fgotify-apache/lists"}