diff options
-rw-r--r-- | README.md | 7 | ||||
-rw-r--r-- | nginx | 2 | ||||
-rwxr-xr-x | run.sh | 11 | ||||
-rwxr-xr-x | setup.sh | 17 |
4 files changed, 22 insertions, 15 deletions
@@ -4,7 +4,6 @@ Run LibreTranslate on Ubuntu 20.04. Uses [LibreTranslate WSGI](https://community.libretranslate.com/t/is-wsgi-currently-supported/24/3) with [Gunicorn and Nginx](https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-18-04). ``` - # Add argosopentech user useradd argosopentech mkdir /home/argosopentech @@ -21,6 +20,12 @@ sudo swapon --show # Download and run LibreTranslate-init git clone https://github.com/argosopentech/LibreTranslate-init.git ~/LibreTranslate-init + +# Run LibreTranslate on port 5000 ~/LibreTranslate-init/setup.sh +# Run LibreTranslate WSGI with nginx and systemd +~/LibreTranslate-init/run.sh + ``` + @@ -1,6 +1,6 @@ server { listen 80; - server_name localhost translate.argosopentech.com; + server_name localhost; location / { include proxy_params; @@ -0,0 +1,11 @@ +# Setup systemd +sudo cp ~/LibreTranslate-init/libretranslate.service /etc/systemd/system/ +sudo systemctl start libretranslate +sudo systemctl enable libretranslate +# sudo systemctl status libretranslate + +# Configure Nginx +sudo cp ~/LibreTranslate-init/nginx /etc/nginx/sites-available/default +sudo nginx -t +sudo systemctl restart nginx + @@ -13,25 +13,16 @@ sudo apt-get install -y libicu-dev python3-icu pkg-config sudo apt-get install -y nginx # Download LibreTranslate source -git clone https://github.com/argosopentech/LibreTranslate.git ~/LibreTranslate +git clone https://github.com/LibreTranslate/LibreTranslate.git ~/LibreTranslate # Setup virtualenv virtualenv ~/LibreTranslate/env source ~/LibreTranslate/env/bin/activate -# Install LibreTranslate -pip install -e ~/LibreTranslate/ - # Install gunicorn pip install gunicorn -# Setup systemd -sudo cp ~/LibreTranslate-init/libretranslate.service /etc/systemd/system/ -sudo systemctl start libretranslate -sudo systemctl enable libretranslate - -# Configure Nginx -sudo cp ~/LibreTranslate-init/nginx /etc/nginx/sites-available/default -sudo nginx -t -sudo systemctl restart nginx +# Install and run LibreTranslate on port 5000 +pip install -e ~/LibreTranslate/ +libretranslate |