Instalacja
instalacja za pomocą github
Najpierw zainstalujmy Nigix z następującymi poleceniami:
sudo apt-get update
sudo apt install nginx
Następnie zainstaluj PHP i wymagane moduły:
sudo apt install php7.0 php7.0-mysqli php7.0-fpm php7.0-mbstring php7.0-xml php7.0-imap php7.0-json php7.0-zip php7.0-gd
Następnie zainstaluj MySQL z następującym poleceniem:
sudo apt install mysql-server libmysqlclient-dev
Teraz uruchom następujące polecenie, aby zainstalować GIT:
sudo apt install git
Zaloguj się do MySQL i utwórz bazę danych i użytkownika FreeScout:
CREATE DATABASE `freescout` CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON `freescout`.* TO `freescout`@`localhost` IDENTIFIED BY “XXX”;
EXIT;
Utwórz katalog Freescout i pobieraj aplikację z GitHub.
mkdir -p /var/www/html
sudo chown www-data:www-data /var/www/html
cd /var/www/html
git clone https://github.com/freescout-helpdesk/freescout
Zmień właściciela i przypisz uprawnienia użytkownikowi:
chown -R www-data:www-data /var/www/html
sudo usermod -a -G www-data freescout
find /var/www/html -type f -exec chmod 664 {} \;
find /var/www/html -type d -exec chmod 775 {} \;
Utwórz plik konfiguracyjny Nigix:
sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/example.com
rm /etc/nginx/sites-enabled/default
ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/example.com
sudo nano /etc/nginx/sites-enabled/example.com
Plik konfiguracyjny Nigix powinien być jak następujący:
server {
listen 80;
listen [::]:80;
server_name example.com http://www.example.com;
root /var/www/html/public;
index index.php index.html index.htm;
error_log /var/www/html/storage/logs/web-server.log;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# Uncomment this location if you want to improve attachments downloading speed.
# Also make sure to set APP_DOWNLOAD_ATTACHMENTS_VIA=nginx in the .env file.
#location ^~ /storage/app/attachment/ {
# internal;
# alias /var/www/html/storage/app/attachment/;
#}
location ~* ^/storage/attachment/ {
expires 1M;
access_log off;
try_files $uri $uri/ /index.php?$query_string;
}
location ~* ^/(?:css|js)/.*\.(?:css|js)$ {
expires 2d;
access_log off;
add_header Cache-Control “public, must-revalidate”;
}
location ~* ^/(?:css|fonts|img|installer|js|modules|[^\\\]+\..*)$ {
expires 1M;
access_log off;
add_header Cache-Control “public”;
}
location ~ /\. {
deny all;
}
}
Następnie ponownie załaduj Nigix:
nginx -t
service nginx reload
Zainstaluj certbot i włącz HTTPS:
apt-get update
apt-get install software-properties-common
add-apt-repository universe
add-apt-repository ppa:certbot/certbot
apt-get update
apt-get install certbot python-certbot-nginx
certbot –nginx –register-unsafely-without-email
certbot renew –dry-run
Zapytany Wybierz Opcję 2: Przekierowanie - Zrób wszystkie żądania przekieruj, aby uzyskać dostęp HTTPS. Skonfiguruj Cronjob do automatycznego odnowy.
0 12 * * * /usr/bin/certbot renew –quiet
Na koniec otwórz instalator internetowy https://example.com/install i śledź instrukcje
instalacja za pomocą Docker
Wyciągnij obraz Freescout z Hub.docker.com:
docker pull tiredofit/freescout
Skonfiguruj Docker-Compose.yml:
version: ‘2’
services:
freescout-app:
image: tiredofit/freescout
container_name: freescout-app
links:
– freescout-db
volumes:
#### If you want to perform customizations to the source and have access to it, then uncomment this line – This includes modules
#- ./data:/www/html
#### Or, if you just want to use Stock Freescout and hold onto persistent files like cache and session use this, one or the other.
– ./data:/data
#### If you want to just keep the original source and add additional modules uncomment this line
#- ./modules:/www/html/Modules
– ./logs/:/www/logs
environment:
– VIRTUAL_HOST=freescout.example.com
– VIRTUAL_NETWORK=nginx-proxy
– VIRTUAL_PORT=80
– LETSENCRYPT_HOST=freescout.example.com
– LETSENCRYPT_EMAIL=admin@example.com
– ZABBIX_HOSTNAME=freescout-app
– DB_HOST=freescout-db
– DB_NAME=freescout
– DB_USER=freescout
– DB_PASS=freescout
– SITE_URL=https://freescout.example.com
– ADMIN_EMAIL=admin@admin.com
– ADMIN_PASS=freescout
– ENABLE_SSL_PROXY=FALSE
– DISPLAY_ERRORS=FALSE
– TIMEZONE=America/Vancouver
networks:
– proxy-tier
restart: always
freescout-db:
image: tiredofit/mariadb
container_name: freescout-db
volumes:
– ./db:/var/lib/mysql
environment:
– ROOT_PASS=password
– DB_NAME=freescout
– DB_USER=freescout
– DB_PASS=freescout
– ZABBIX_HOSTNAME=freescout-db
networks:
– proxy-tier
restart: always
freescout-db-backup:
container_name: freescout-db-backup
image: tiredofit/db-backup
links:
– freescout-db
volumes:
– ./dbbackup:/backup
environment:
– ZABBIX_HOSTNAME=freescout-db-backup
– DB_HOST=freescout-db
– DB_TYPE=mariadb
– DB_NAME=freescout
– DB_USER=freescout
– DB_PASS=freescout
– DB_DUMP_FREQ=1440
– DB_DUMP_BEGIN=0000
– DB_CLEANUP_TIME=8640
– COMPRESSION=BZ
– MD5=TRUE
networks:
– proxy-tier
restart: always
networks:
proxy-tier:
external:
name: nginx-proxy
Utwórz plik środowiska. Lista środowiska dostępnego pod numerem httpsgithubComtiredOfitdockerFreesceStenvironmentVariables
Mapa utrzymująca się przechowywanie, przeglądanie konfiguracji danych w objętości danych pod numerem httpsgithubcomtiredOifitDockerFreESCoutDatavoluumes Upewnij się, że żądane porty są dostępne i ujawnione. Wreszcie uruchamiaj kompozycję Docker. Gratulacje! Z powodzeniem zainstalowałeś Freescout.