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

from-binary.en-us.md 3.3 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. ---
  2. date: "2017-06-19T12:00:00+02:00"
  3. title: "Installation from binary"
  4. slug: "install-from-binary"
  5. weight: 10
  6. toc: true
  7. draft: false
  8. menu:
  9. sidebar:
  10. parent: "installation"
  11. name: "From binary"
  12. weight: 20
  13. identifier: "install-from-binary"
  14. ---
  15. # Installation from binary
  16. All downloads come with SQLite, MySQL and PostgreSQL support, and are built with
  17. embedded assets. This can be different for older releases. Choose the file matching
  18. the destination platform from the [downloads page](https://dl.gitea.io/gitea), copy
  19. the URL and replace the URL within the commands below:
  20. ```sh
  21. wget -O gitea https://dl.gitea.io/gitea/1.4.3/gitea-1.4.3-linux-amd64
  22. chmod +x gitea
  23. ```
  24. ## Verify GPG signature
  25. Gitea signs all binaries with a [GPG key](https://pgp.mit.edu/pks/lookup?op=vindex&fingerprint=on&search=0x2D9AE806EC1592E2) to prevent against unwanted modification of binaries. To validate the binary download the signature file which ends in `.asc` for the binary you downloaded and use the gpg command line tool.
  26. ```sh
  27. gpg --keyserver pgp.mit.edu --recv 0x2D9AE806EC1592E2
  28. gpg --verify gitea-1.5.0-linux-amd64.asc gitea-1.5.0-linux-amd64
  29. ```
  30. ## Test
  31. After getting a binary, it can be tested with `./gitea web` or moved to a permanent
  32. location. When launched manually, Gitea can be killed using `Ctrl+C`.
  33. ```
  34. ./gitea web
  35. ```
  36. ## Recommended server configuration
  37. ### Prepare environment
  38. Check that git is installed on the server, if it is not install it first.
  39. ```sh
  40. git --version
  41. ```
  42. Create user to run gitea (ex. `git`)
  43. ```sh
  44. adduser \
  45. --system \
  46. --shell /bin/bash \
  47. --gecos 'Git Version Control' \
  48. --group \
  49. --disabled-password \
  50. --home /home/git \
  51. git
  52. ```
  53. ### Create required directory structure
  54. ```sh
  55. mkdir -p /var/lib/gitea/{custom,data,indexers,public,log}
  56. chown git:git /var/lib/gitea/{data,indexers,log}
  57. chmod 750 /var/lib/gitea/{data,indexers,log}
  58. mkdir /etc/gitea
  59. chown root:git /etc/gitea
  60. chmod 770 /etc/gitea
  61. ```
  62. **NOTE:** `/etc/gitea` is temporary set with write rights for user `git` so that Web installer could write configuration file. After installation is done it is recommended to set rights to read-only using:
  63. ```
  64. chmod 750 /etc/gitea
  65. chmod 644 /etc/gitea/app.ini
  66. ```
  67. ### Copy gitea binary to global location
  68. ```
  69. cp gitea /usr/local/bin/gitea
  70. ```
  71. ### Create service file to start gitea automatically
  72. See how to create [Linux service]({{< relref "run-as-service-in-ubuntu.en-us.md" >}})
  73. ## Troubleshooting
  74. ### Old glibc versions
  75. Older Linux distributions (such as Debian 7 and CentOS 6) may not be able to load the
  76. Gitea binary, usually producing an error such as ```./gitea: /lib/x86_64-linux-gnu/libc.so.6:
  77. version `GLIBC\_2.14' not found (required by ./gitea)```. This is due to the integrated
  78. SQLite support in the binaries provided by dl.gitea.io. In this situation, it is usually
  79. possible to [install from source]({{< relref "from-source.en-us.md" >}}) without sqlite
  80. support.
  81. ### Running gitea on another port
  82. For errors like `702 runWeb()] [E] Failed to start server: listen tcp 0.0.0.0:3000:
  83. bind: address already in use` gitea needs to be started on another free port. This
  84. is possible using `./gitea web -p $PORT`. It's possible another instance of gitea
  85. is already running.