Skip to content

Xety/ServerPilot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Setup ServerPilot with Vagrant

This repository provides a sample Vagrantfile to create a Ubuntu 14.04 64-bit virtual machine. After following the installation instructions, you'll have a server managed by ServerPilot and accessible via your browser at local.io. Inspired from manjoker/Vagrantfile

https://serverpilot.io

Information

You will be able to setup as many sub-domain as you want. You will have phpMyAdmin running on your server and you will also be able to share your virtual machine with https://vagrantcloud.com

Getting Started

  1. Install dependencies
  1. Copy the Vagrantfile
  2. Execute the following commands to setup the virtual machine :
$ vagrant up
$ vagrant ssh

Connecting to ServerPilot

  • Log in to ServerPilot

  • Go to the Servers page and click + Connect Server

  • Click Install ServerPilot manually. at the bottom

    • Name => local.io
    • SFTP Password => Choose a password
  • Copy the whole command (and let the page open in your browser): fdf4c72543af0a52e47b3474b150e93b

  • Paste the command in the VM terminal and wait until to get this message : c5d6522793686dbc0ab42d75e5be7df1

  • Watch ServerPilot install 55a2c4882b4e624ef61a49d5de59c32a

  • Note : The part Testing server configuration may take several minutes (more than 20 minutes for me)

Create your Applications in ServerPilot

  • Go to the Apps page and click + Create App
    • Name => website
    • Domain => local.io
    • Server => local.io

Edit the hosts file

  • Edit the following file as administrator / root
    • Ubuntu/Mac OS X : /etc/hosts
    • Windows : C:\WINDOWS\system32\drivers\etc\hosts
  • Add the following code in this file :
    • 192.168.56.101 local.io
    • If you plan to add sub-domains, you can add them now in the hosts file :
192.168.56.101 local.io
192.168.56.101 subdomain1.local.io
192.168.56.101 subdomain2.local.io

Edit the Vagrantfile file

  • Now, you must edit the Vagrantfile and uncomment this line :
config.vm.synced_folder '/var/www/Sites/website', '/srv/users/serverpilot/apps/website/public', owner: "serverpilot", group: "serverpilot"
  • Adapt it to your system. The first part, is the path on your system. The second part, is the path on the VM system.
    • Note : Don't remove the owner and group keys. I have got some issues with the permissions, and this configuration seems to resolve all permissions bugs. If you want to add new synced_folder, you must add the owner and group keys with the serverpilot value.
  • Execute the following command to reload the VM with the modified Vagranfile :
vagrant@local:~$ exit
$ vagrant reload

Enjoy

  • Go to local.io in a new tab and you should see the ServerPilot splash page or your application. 6f7a24856a34bdc310657e9d92d6655c

More Configuration

The following configuration are not required, but can be usefull if you plan to install phpMyAdmin or setup a sub-domain.

Install phpMyAdmin

  • Create a new application on ServerPilot :
    • Name => pma
    • Domain => pma.local.io
    • Server => local.io
  • Download the latest version of phpMyAdmin :
  • Open the archive that you downloaded
  • Place the archive where you want on your system. For the tutorial, i have placed it in /var/www/Sites/pma.
  • Rename config.sample.inc.php to config.inc.php.
  • Now, open config.inc.php and set a random string of characters for the value of $cfg['blowfish_secret'] near the top of the file. Exemple :
$cfg['blowfish_secret'] = 'asdof7q230984(*^3q4';
  • Add 192.168.56.101 pma.local.io to your hosts file.
  • Uncomment and adapt (regarding to the path) the following line in the Vagranfile :
config.vm.synced_folder '/var/www/Sites/pma', '/srv/users/serverpilot/apps/pma/public', owner: "serverpilot", group: "serverpilot"
  • Execute the following command to reload the VM with the modified Vagranfile :
$ vagrant reload
  • Create a database on ServerPilot : 280552ce196fca4efcc75bb31060c1c2

  • Go to pma.local.io and login with the same username and password that you used to create the database.

Create a sub-domain

  • If you followed the phpMyAdmin installation, you already know how to setup a sub-domain. For the tutorial, I will setup a sub-domain named xety.local.io
  • Create a new application on ServerPilot :
    • Name => xety
    • Domain => xety.local.io
    • Server => local.io
  • Add 192.168.56.101 xety.local.io to your hosts file.
  • Uncomment and adapt (regarding to your path) the following line in the Vagranfile :
config.vm.synced_folder '/var/www/Sites/xety', '/srv/users/serverpilot/apps/xety/public', owner: "serverpilot", group: "serverpilot"
  • Execute the following command to reload the VM with the modified Vagranfile :
$ vagrant reload

Connect to the SFTP

Yes, you can connect to the server using the SFTP method !

  • Use your prefered software. I will use FileZilla.
  • Login in FileZilla with the following credentials :
    • Host => 192.168.56.101
    • User => serverpilot
    • Password => The SFTP password that you provided at the beginning of this tutorial
    • Port => 22
  • You can also login with the vagrant user :
    • Host => 192.168.56.101
    • User => vagrant
    • Password => vagrant
    • Port => 22
  • But i recommend you to use the serverpilot user and not the vagrant, else you will probably have some permissions issues (i.e : https://serverpilot.io/community/articles/how-to-fix-file-permissions.html)

Share your VM

About

Setup ServerPilot with Vagrant

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published