Apache Webserver

About

Use this component to deploy a Apache Webserver.

How to use

1. How to deploy Apache Webserver?

  1. Drop the Apache component on a Compute.
  2. Specify the document_root, where httpd will serve files. Defaults to /var/www/html.

Fig. Apache Webserver

Expect result

  • After deployment, you can access the example index.html via the floating IP. The security groups to allow incoming traffic on port 80 and 443 are auto created.

Fig. Example index.html

2. How to enable SSL with self-signed certificates?

  • Select Apache / ssl_enabled / choose selfsigned.

Expect result

  • Self-signed certificates are generated at: /etc/apache2/ssl.
  • Apache listens on port 443 and uses the self-signed certificates.
  • Apache redirects HTTP to HTTPS.

3. How to generate Let's Encrypt certificates with a domain name?

  1. Connect the Compute to the Public network.
  2. Select Apache / ssl_enabled / letsencrypt.

Fig. Apache letsencrypt

  1. Input myexample.com in the dns_name field.
  2. Configure the nameservers of your domain at the domain registrar to: ns1.open-telekom-cloud.com and ns2.open-telekom-cloud.com.

Fig. Apache domain name

Expect result

  1. One DNS public zone myexample.com. with 2 record sets type A myexample.com. and www.myexample.com. will be created on Open Telekom Cloud.
  2. The record sets point to the floating IP of the public compute, which hosts the Apache Webserver (e.g., 80.158.62.203).

Fig. DNS Endpoint

  1. Let's encrypt is installed on the VM in stand-alone mode (before Apache is up and running). In the stand-alone mode, it brings up a webserver, and generates certificates for the given domain myexample.com and subdomain www.myexample.com and performs the HTTP-01 challenge on port 80 to verify the domain. The certifcates are generated at /etc/letsencrypt/live/DNS_NAME.
note
  • The domain takes effect only after you update the nameservers of your domain at the domain registrar to: ns1.open-telekom-cloud.com and ns2.open-telekom-cloud.com. Otherwise, the HTTP-01 challenge for the given domain will fail.

4. How to deploy PHP with the Apache Webserver?

  1. Drop the PHP-FPM on a Compute.
  2. Connect PHP-FPM / depend_on_webserver to the Apache component.

Fig. PHP

  1. Configure Apache vhost with the following extra_parameters to enable passthrough to PHP-FPM:

Fig. PHP

ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/var/www/html"

Links