Nginx/PHP-fpm/MySQL

This manual adapt for installing ander OS Ubuntu Server. For use on another Linus dist, try specific commands (ex. yum instead apt-get).

1. Update package tree

$ sudo apt-get update

2. Install VESTA-panel

$ curl -O http://vestacp.com/pub/vst-install.sh
$ sudo bash vst-install.sh --nginx yes --phpfpm yes --apache no --vsftpd yes --proftpd no \
--exim no --dovecot no --spamassassin no --clamav no --named no --iptables no --fail2ban no \
--mysql yes --postgresql no --remi yes --quota no

3. Install REDIS-server

$ wget http://download.redis.io/releases/redis-stable.tar.gz
$ tar xzf redis-stable.tar.gz
$ cd redis-stable
$ make
$ sudo make install
$ cd utils
$ sudo ./install_server.sh
$ sudo update-rc.d redis_6379 defaults

4. Install PHP-libs & NodeJS/NPM

$ sudo apt-get install -y php5-imap php5-ldap nodejs npm
$ sudo php5enmod imap
$ sudo service apache2 restart
$ sudo ln -s /usr/bin/nodejs /usr/bin/node

5. Install NodeJS-libs

$ sudo npm install dotenv --save -g
$ sudo npm install pm2 -g
$ sudo npm install express socket.io ioredis dotenv
$ sudo cd /home/admin/web/YOUR_DOMAIN/public_html/nodejs/
$ sudo pm2 start server.js -n zenserver --watch
$ sudo pm2 startup
$ sudo pm2 save
$ sudo pm2 install pm2-logrotate

6. Add WEB-domain to host panel

$ sudo /usr/local/vesta/bin/v-add-domain admin YOUR_DOMAIN

7. Edit nginx.conf (eg. /home/admin/conf/web/nginx.conf)

 		 location / {
 		 	try_files $uri $uri/ /index.php?$query_string;
 		 }
  		
                 location /socket.io {
  		   proxy_set_header Upgrade $http_upgrade;
  		   proxy_set_header Connection "upgrade";
  		   proxy_http_version 1.1;
  		   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  		   proxy_set_header Host $host;
  		   proxy_pass http://127.0.0.1:3001/socket.io/;
  		 }

8. Edit nginx.conf

Instead

root        /home/admin/web/YOUR_DOMAIN/public_html;

this

root        /home/admin/web/YOUR_DOMAIN/public_html/public;

9. Restart nginx-server

$ sudo service nginx restart

10. Add database

$ sudo /usr/local/vesta/bin/v-add-database admin zenlix zenlix YOUR_PASSWORD

11. Unpack arch, rename .env.example to .env and go to http://YOUR_DOMAIN/ using:

		DB host: localhost
		DB user: admin_zenlix
		DB name: admin_zenlix
		DB user password: YOUR_PASSWORD

12. Add cron-task

* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1

or via VESTA-CLI

$ sudo /usr/local/vesta/bin/v-add-cron-job admin * * * * * "php /home/admin/web/YOUR_DOMAIN/public_html/artisan schedule:run >> /dev/null 2>&1"

13. Install SUPEVISOR-service

$ sudo apt-get install supervisor


14. Configure supervisor-service


$ sudo nano /etc/supervisor/conf.d/laravel-worker.conf
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /home/admin/web/YOUR_DOMAIN/public_html/artisan queue:work --sleep=3 --tries=3 --daemon
autostart=true
autorestart=true
user=admin
numprocs=8

15. Restart supervisor-service

$ sudo supervisorctl reread
$ sudo supervisorctl update
$ sudo supervisorctl start laravel-worker:*


16. Check installing ZENLIX, go over WEB, using login/password:

login: admin@local
password: p@ssw0rd