Serverpilot : Easiest way to Setup | Manage | Secure your PHP Website with Amazon Cloud EC2 Servers
ServerPilot is the easiest way to run PHP applications such as Laravel, Yii, Coordinator, Magento, WordPress on Amazon EC2 servers to keep your server secure.
If you’re not a sysadmin, you should use a developer-friendly environment with ServerPilot.
- Setup EC2 Instance
- Connect EC2 Server to ServerPilot
Setup EC2 Instance
Log in to the AWS Management Console. Once logged in, click on EC2.
Then click Instances in the left menu and then click Instance Launch button. The instance creation tool starts.
Now, select Ubuntu Server 16.04 LTS 64-bit or Ubuntu Server 18.04 LTS 64-bit as your Amazon Machine Image (AMI).
Configure the Security Group
You can see the name of the security group for your instance in the instance details screenshot above (in this case, it’s “launch-wizard-1”).
By default, Amazon blocks ports 80 (HTTP) and 443 (HTTPS). If you don’t perform the following steps, your apps won’t work.
Then, click on the Inbound tab to see the firewall rules for your server. As you can see below, the default firewall for EC2 servers allows only port 22 (SSH).
Wow, EC2 is complicated. Thankfully, your server’s now ready for ServerPilot.
Connect EC2 Server to ServerPilot
You just need your server’s IP address so you can SSH into it.
Now, SSH into your server as the user ubuntu. The ubuntu user has full sudo privileges and was created by EC2. The SSH key you chose when creating your EC2 server will be able to log in as this user.
Once you’re able to SSH in, you’ll need to manually connect your server to ServerPilot.
Next, Log in to in ServerPilot, go to the Servers page and click Connect Server.
Place a check mark in the box next to I don’t have a root password or public IP address.
In the new fields, enter the name for the server you’re connecting to ServerPilot.
If you would like to use passwords rather than SSH keys to upload files to your apps over SFTP, do notremove the check mark from the second box. Leave this checked, and ServerPilot will automatically enable SSH password authentication on your server.
Click Connect to ServerPilot.
Then, show you a unique command to run on your server. This command will install the ServerPilot agent in EC2.
Log in to your server through SSH with the root user. Copy the command and paste it into the terminal. Once the installation is complete, your server will show as connected in ServerPilot, and you’ll be prompted to create your first app.
Once the installation is complete, your server will show as connected in ServerPilot, and you’ll be prompted to create your first app.
ServerPilot configures Nginx as the public-facing web server because it is much more scalable than Apache. Unlike Apache, Nginx can handle handle tens of thousands of simultaneous client connections. As Nginx waits until it has completely received the request before proxying the request through to Apache, your server is safe from Slowloris attacks. For your SSL-enabled apps, Nginx also provides extremely efficient SSL handling and HTTP/2 support.