diff options
Diffstat (limited to 'docs/content/doc/installation/run-as-service-in-ubuntu.en-us.md')
-rw-r--r-- | docs/content/doc/installation/run-as-service-in-ubuntu.en-us.md | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/docs/content/doc/installation/run-as-service-in-ubuntu.en-us.md b/docs/content/doc/installation/run-as-service-in-ubuntu.en-us.md index 3d58167bf2..e004e3a0d3 100644 --- a/docs/content/doc/installation/run-as-service-in-ubuntu.en-us.md +++ b/docs/content/doc/installation/run-as-service-in-ubuntu.en-us.md @@ -13,56 +13,55 @@ menu: identifier: "linux-service" --- -### Run as service in Ubuntu 16.04 LTS - -#### Using systemd +### Run as service in Ubuntu 16.04 LTS -Run below command in terminal: +#### Using systemd + +Run the below command in a terminal: ``` sudo vim /etc/systemd/system/gitea.service -``` +``` -Add code to the file from [here](https://github.com/go-gitea/gitea/blob/master/contrib/systemd/gitea.service). +Copy the sample [gitea.service](https://github.com/go-gitea/gitea/blob/master/contrib/systemd/gitea.service). -Uncomment any service need to be enabled like mysql in this case in Unit section. +Uncomment any service that needs to be enabled on this host, such as MySQL. -Change the user(git) accordingly to yours. And /home/git too if your username is different than git. Change the PORT or remove the -p flag if default port is used. +Change the user, home directory, and other required startup values. Change the +PORT or remove the -p flag if default port is used. -Lastly start and enable gitea at boot: +Enable and start gitea at boot: ``` +sudo systemctl enable gitea sudo systemctl start gitea -``` ``` -sudo systemctl enable gitea -``` -#### Using supervisor +#### Using supervisor -Install supervisor by running below command in terminal: +Install supervisor by running below command in terminal: ``` sudo apt install supervisor -``` +``` -Create a log dir for the supervisor logs(assuming gitea is installed in /home/git/gitea/): +Create a log dir for the supervisor logs: ``` +# assuming gitea is installed in /home/git/gitea/ mkdir /home/git/gitea/log/supervisor -``` +``` -Open supervisor config file in vi/vim/nano etc. +Open supervisor config file in a file editor: ``` sudo vim /etc/supervisor/supervisord.conf -``` +``` -And append the code at the end of the file from [here](https://github.com/go-gitea/gitea/blob/master/contrib/supervisor/gitea). +Append the configuration from the sample +[supervisord config](https://github.com/go-gitea/gitea/blob/master/contrib/supervisor/gitea). -Change the user(git) accordingly to yours. And /home/git too if your username is different than git. Change the PORT or remove the -p flag if default port is used. +Change the user(git) and home(/home/git) settings to match the deployment +environment. Change the PORT or remove the -p flag if default port is used. -Lastly start and enable supervisor at boot: +Lastly enable and start supervisor at boot: ``` +sudo systemctl enable supervisor sudo systemctl start supervisor -``` ``` -sudo systemctl enable supervisor -``` - |