Apache-Nginx & PHP-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-host 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 in host panels

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

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

  		 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;

8. Restart nginx-server

$ sudo service nginx restart

9. Edit apache2.conf (eg. /home/admin/conf/web/apache2.conf)


DocumentRoot /home/admin/web/YOUR_DOMAIN/public_html


DocumentRoot /home/admin/web/YOUR_DOMAIN/public_html/public

and this:

<Directory /home/admin/web/YOUR_DOMAIN/public_html>

to this:

<Directory /home/admin/web/YOUR_DOMAIN/public_html/public>


$ sudo service apache2 restart

10. Add DB

$ 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


$ 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
command=php /home/admin/web/YOUR_DOMAIN/public_html/artisan queue:work --sleep=3 --tries=3 --daemon

15. Restart supervisor-service

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

16. Try ZENLIX, go to WEB, using login/password:

login: admin@local
password: p@ssw0rd