jetapps-eu / publigator-vps-installer

Publigator installer script for clean VPS with CentOS 6 minimal
http://publigator.com
6 stars 6 forks source link

Publigator installer script for clean VPS with CentOS 6

Prerequisites

First you need a VPS with minimum 512MB RAM and 20GB disk drive with CentOS 6.x minimal installed. You can order VPS from DigitalOcean.com with these parameters just for $5 per month!

If you would use a VPS provided by firstvds.ru, don’t select OpenVZ virtualization! Select KVM instead of that (a bit expensive). In other case you will can’t create a swap file!

Also you should have the domain, ex. yourdomain.com with set DNS records for VPS Hostname and for domain/subdomain for Publigator. So if your domain is yourdomain.com you need to create A records in your domains manager:

serv.yourdomain.com A 14400 1.2.3.4
publigator.yourdomain.com A 14400 1.2.3.4

Where is 1.2.3.4 the IP of your VPS. If you plan to use the dedicated domain for the script, you don’t need to create DNS record for the subdomain.

So if you call dig serv.yourdomain.com you should see the IP of your VPS.

Actions

Next connect to VPS by SSH as root. You should be in the home directory of the user (root).

Copy and run next command:

curl -O https://raw.githubusercontent.com/jetapps-eu/publigator-vps-installer/master/publigator-install-step1.sh && bash publigator-install-step1.sh

The installed will ask you about your e-mail for send you access info for VestaCP control panel, which will be installed.

Also it will ask you about hostname, about domain for Publigator, IP of the VPS, credentials for the DB.

When step-1 will finished, copy next step-2 command and run:

curl -O https://raw.githubusercontent.com/jetapps-eu/publigator-vps-installer/master/publigator-install-step2.sh && bash publigator-install-step2.sh

By default PHP working via as mod_ruid2. If you need SuPHP or Fcgid mode, check same steps below.

Or step-2 with SuPHP:

curl -O https://raw.githubusercontent.com/jetapps-eu/publigator-vps-installer/master/publigator-install-step2-suphp.sh && bash publigator-install-step2-suphp.sh

Will be installed SuPHP with dedicated hosting package suphp and special templates suphp for Apache and Nginx.

Or step-2 with Fcgid:

curl -O https://raw.githubusercontent.com/jetapps-eu/publigator-vps-installer/master/publigator-install-step2-fcgid.sh && bash publigator-install-step2-fcgid.sh

Will be installed Fcgid with dedicated hosting package phpfcgid and special templates pbl_phpfcgid for Apache and Nginx.

==========

When system will ask you some data like paths for components, just press enter. You have to wait the actions will be finished.

Next you will see URL and database credentials. Copy it and go to showed URL. You will be able to see Publigator installer system.

Special instructions for RunAbove

After you’ll created an instance, and login as admin via SSH, please run following commands:

sudo su -

Next set password for the root.

passwd

Next copy SSH keys:

mv /root/.ssh /root/.ssh.orig
cp -r /home/admin/.ssh /root/
exit
exit

Now login as root via SSH (with login/password or login and SSH key). And run commands:

userdel admin
rm -rf /home/admin

Now you can run step-1 of the installer. Please carefully specify your hostname and IP address of your VPS (instead of 127.0.0.1).

Issues

  1. Wrong /etc/resolv.conf on firstvds.ru VPS images. You should change that file (also see Vim cheatsheet ):
    vi /etc/resolv.conf

    or

    nano /etc/resolv.conf

Example:

#Generated by NetworkManager
nameserver 188.120.247.2
nameserver 8.8.8.8
nameserver 8.8.4.4
search

How to install the cron-task

You can install the cron-task from root SSH with these commands:

export EDITOR=nano
export TERM=xterm-color
crontab -u admin -e

You should add the new row with command according your system. In common case (of using this installer) it will be:

* * * * * /usr/bin/php /home/admin/web/publigator/console job-manager2 > /dev/null 2>&1

After editing press CTRL+O to save file and CTRL+X to exit.