Apache Webserver¶
1. About¶
Use this component to deploy a Apache Webserver.
2. How to use¶
2.1. How to deploy Apache Webserver¶
Drop the Apache component on a Compute.
Specify the document_root, where httpd will serve files. Defaults to
/var/www/html
.
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.
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?¶
Connect the Compute to the Public network.
Select Apache / ssl_enabled / letsencrypt.
Input
myexample.com
in the dns_name field.Configure the nameservers of your domain at the domain registrar to:
ns1.open-telekom-cloud.com
andns2.open-telekom-cloud.com
.
Expect result¶
One DNS public zone
myexample.com.
with 2 record sets type Amyexample.com.
andwww.myexample.com.
will be created on Open Telekom Cloud.The record sets point to the floating IP of the public compute, which hosts the Apache Webserver (e.g.,
80.158.62.203
).
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?¶
Drop the PHP-FPM on a Compute.
Connect PHP-FPM / depend_on_webserver to the Apache component.
Configure Apache vhost with the following
extra_parameters
to enable passthrough to PHP-FPM:
ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/var/www/html"
3. Links¶
See an example to deploy the Nextcloud application in: Topology template /
Nextcloud
.