Getting started after deploy
In addition to the package installation, the One-Click also:
- Enables the UFW firewall to allow only SSH (port
22, rate limited), HTTP (port
80), and HTTPS (port
- Sets the MySQL root password and runs
- Sets up the
debian-sys-maintuser in MySQL so the system’s init scripts for MySQL will work without requiring the MySQL
After you create a LAMP One-Click VM :
- You can view the LAMP instance immediately by visiting the VM’s IP address in your browser.
- You can log into the VM as
rootusing either the password emailed to you or with an SSH key, if you added one during creation.
- The MySQL root password is in
- The web root is
- You can get information about the PHP installation by logging into the VM and running
In addition, there are a few customized setup steps that we recommend you take.
Creating an Apache virtual hosts file for each site maintains the default configuration as the fallback, as intended, and makes it easier to manage changes when hosting multiple sites.
To do so, you’ll need to create two things for each domain: a new directory in
/var/www for that domain’s content, and a new virtual host file in
/etc/apache2/sites-available for that domain’s configuration. For a detailed walkthrough.
Setting up an SSL certificate enables HTTPS on the web server, which secures the traffic between the server and the clients connecting to it. Certbot is a free and automated way to set up SSL certificates on a server. It’s included as part of the LAMP One-Click to make securing the VM easier.
To use Certbot, you’ll need a registered domain name and two DNS records:
- An A record from a domain (e.g.,
example.com) to the server’s IP address
- An A record from a domain prefaced with
www.example.com) to the server’s IP address
Additionally, if you’re using a virtual hosts file, you’ll need to make sure the server name directive in the VirtualHost block (e.g.,
ServerName example.com) is correctly set to the domain.
Once the DNS records and, optionally, the virtual hosts files are set up, you can generate the SSL certificate. Make sure to substitute the domain in the command.
certbot --apache -d example.com -d www.example.com
HTTPS traffic on port
443 is already allowed through the firewall. After you set up HTTPS, you can optionally deny HTTP traffic on port
ufw delete allow 80/tcp
You can serve files from the web server by adding them to the web root (
/var/www/html) using SFTP or other tools.
A newly-created LAMP VM includes an
index.html web page. You can change this by uploading a custom
index.html file or remove it.