1.Установка необходимых php-модулей(подразумевается,что уже установлен Nginx и PHP-FPM)
1 |
# apt-get install php5-common php5-gd php5-imap |
2.Включаем и проверяем подключение модуля imap
1 |
# php5enmod imap |
1 |
# php5-fpm -t |
1 |
# service php5-fpm restart |
1 |
# ls -la /etc/php5/fpm/conf.d/ | grep imap |
1 |
lrwxrwxrwx 1 root root 29 Jun 3 22:29 20-imap.ini -> ../../mods-available/imap.ini |
3.Скачиваем и распаковываем дистрибутив OSticket
1 |
# mkdir /home/users/kamaok/support.kamaok.org.us |
wget https://github.com/osTicket/osTicket-1.8/releases/download/v1.9.8.1/osTicket-v1.9.8.1.zip
1 |
# unzip -d /home/users/kamaok/support.kamaok.org.us/ /tmp/osTicket-v1.9.8.1.zip |
1 |
# mv /home/users/kamaok/support.kamaok.org.us/upload/* /home/users/kamaok/support.kamaok.org.us/ |
1 |
# rm -rf /home/users/kamaok/support.kamaok.org.us/upload /tmp/osTicket-v1.9.8.1.zip |
1 |
# cd /home/users/kamaok/support.kamaok.org.us/ |
Копируем файл конфигурации,изменяем владельца и группу на имя пользователя,под которым работает пул PHP-FPM, даем полные права на конфигурационный файл на время установки
1 |
# cp include/ost-sampleconfig.php include/ost-config.php |
1 |
# chown -R kamaok:kamaok /home/users/kamaok/support.kamaok.org.us/ |
1 |
# chmod 777 include/ost-config.php |
4.Создаем базу данных и пользователя с доступом к этой базе
1 |
mysql> create database osticket; |
1 |
mysql> grant all privileges on osticket.* to osticketuser@'localhost' identified by 'ka6thootiesoo1neaTie'; |
1 |
mysql> flush privileges; |
5.Настройка Nginx
1 |
# nano /etc/nginx/conf.d/support.kamaok.org.us.conf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
server { listen 192.168.1.140:80; server_name support.kamaok.org.us *.support.kamaok.org.us; root /home/users/kamaok/support.kamaok.org.us; access_log /var/log/nginx/support.kamaok.org.us-access.log main; error_log /var/log/nginx/support.kamaok.org.us-error.log; location / { try_files $uri $uri/ /index.php?$args; location ~* ^.+\.(jpg|jpeg|gif|png|css|tgz|rar|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js|svg|js|mp3|ogg|mpe?g|avi|zip|gz|bz2?|swf|ico|woff|ttf|eot|otf)$ { expires +30d; add_header Cache-Control «public»; } } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php5-fpm-kamaok.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location = /favicon.ico { log_not_found off; access_log off; allow all; } location = /robots.txt { access_log off; log_not_found off; } location ~ /\.ht { deny all; } location ~ ^/(status-kamaok|ping-kamaok)$ { fastcgi_pass unix:/var/run/php5-fpm-kamaok.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; access_log off; allow 127.0.0.1; allow 192.168.1.0/24; deny all; } } |
6.Настройка PHP-FPM
1 |
# cat /etc/php5/fpm/php-fpm.conf | grep -v \; | grep -v ^\$ |
1 2 3 4 5 6 7 8 |
[global] pid = /var/run/php5-fpm.pid error_log = /var/log/php5-fpm.log emergency_restart_threshold = 10 emergency_restart_interval = 1m process_control_timeout = 10s daemonize = yes include=/etc/php5/fpm/pool.d/*.conf |
1 |
# cat /etc/php5/fpm/pool.d/kamaok.conf | grep -v \; | grep -v ^\$ |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
[kamaok] user = kamaok group = kamaok listen = /var/run/php5-fpm-kamaok.sock listen.owner = kamaok listen.group = kamaok listen.mode = 0666 pm = dynamic pm.max_children = 5 pm.start_servers = 2 pm.min_spare_servers = 1 pm.max_spare_servers = 3 pm.status_path = /status-kamaok ping.path = /ping-kamaok ping.response = pong access.log = /var/log/$pool.access.log slowlog = /var/log/$pool.log.slow request_slowlog_timeout = 3s chdir = / catch_workers_output = yes php_flag[display_errors] = off php_admin_value[error_log] = /var/log/fpm-php.kamaok.log php_admin_flag[log_errors] = on php_admin_value[memory_limit] = 50M |
7.Установку продолжаем через Web-интерфейс
http://support.kamaok.org.us
8.После установки изменяем права на файл ost-config.php и удаляем папку установки в целях безопасности
1 |
# chmod 0644 include/ost-config.php |
1 |
# rm -rf setup |
Источник:
http://osticket.com/wiki/Installation
http://linux-notes.org/ustanovka-osticket-na-centos-redhat-fedora/
https://secure.rosehosting.com/blog/how-to-install-lamp-and-run-osticket-on-a-centos-6-vps/
http://lwathcrunch.blogspot.com/2014/02/install-osticket-in-your-ubuntu.html