You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

windows-service.en-us.md 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. ---
  2. date: "2016-12-21T15:00:00-02:00"
  3. title: "Register as a Windows Service"
  4. slug: "windows-service"
  5. weight: 10
  6. toc: true
  7. draft: false
  8. menu:
  9. sidebar:
  10. parent: "installation"
  11. name: "Windows Service"
  12. weight: 30
  13. identifier: "windows-service"
  14. ---
  15. # Prerequisites
  16. The following changes are made in C:\gitea\custom\conf\app.ini:
  17. ```
  18. RUN_USER = COMPUTERNAME$
  19. ```
  20. Sets Gitea to run as the local system user.
  21. COMPUTERNAME is whatever the response is from `echo %COMPUTERNAME%` on the command line. If the response is `USER-PC` then `RUN_USER = USER-PC$`
  22. ## Use absolute paths
  23. If you use sqlite3, change the `PATH` to include the full path:
  24. ```
  25. [database]
  26. PATH = c:/gitea/data/gitea.db
  27. ```
  28. # Register as a Windows Service
  29. To register Gitea as a Windows service, open a command prompt (cmd) as an Administrator,
  30. then run the following command:
  31. ```
  32. sc create gitea start= auto binPath= "\"C:\gitea\gitea.exe\" web --config \"C:\gitea\custom\conf\app.ini\""
  33. ```
  34. Do not forget to replace `C:\gitea` with the correct Gitea directory.
  35. Open "Windows Services", search for the service named "gitea", right-click it and click on
  36. "Run". If everything is OK, Gitea will be reachable on `http://localhost:3000` (or the port
  37. that was configured).
  38. ## Unregister as a service
  39. To unregister Gitea as a service, open a command prompt (cmd) as an Administrator and run:
  40. ```
  41. sc delete gitea
  42. ```