Apache Webserver

1. About

Use this component to deploy a Apache Webserver.

2. How to use

2.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.

../_images/apache1.png

Figure 1. 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.

../_images/apache2.png

Figure 2. Example index.html

2.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.

2.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.

../_images/apache3.png

Figure 3. 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.

../_images/apache4.png

Figure 4. 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).

../_images/dns2.png

Figure 5. DNS Endpoint

3. 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.

2.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.

../_images/apache5.png

Figure 6. PHP

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

../_images/apache6.png

Figure 7. Configure Apache vhost

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