Hello,

i'am very new to linux and hosting and so on and the tutorials here on the page are very very great. Thank u for that i’ve learned so much the last days!
But now i getting stuck a bit with some questions i cant find.

  1. Apache

I want to setup Nextcloud, Couchpotato, Bookmarkservice and some other litte things.
The goal is to setup each service in \var\www<servicename>.
Do i have to configure in apache2.conf a ServerAlias for each service?(also watch question No3 please)

  1. Let’s Encrypt

I setup my certbot like this:

sudo certbot --authenticator standalone --installer apache -d <mydomain.com> -d <www.mydomain.com> --pre-hook "service apache2 stop" --post-hook "service apache2 stop"

Now i struggle with the renew of the certificate.

if i run sudo certbot renew --dry-run to test if renew works correct i get the following output:

Attempting to renew cert (mydomain.com) from /etc/letsencrypt/renewal/mydomain.com.conf produced an unexpected error: Problem binding to port 80: Could not bind to IPv4 or IPv6.. Skipping.
All renewal attempts failed. The following certs could not be renewed:
  /etc/letsencrypt/live/mydomain.com/fullchain.pem (failure)

First i thought its ufw but Ports are open:

sudo ufw app list
Available applications:
  Apache
  Apache Full
  Apache Secure
  OpenSSH

The goal is to renew certificate without restarting any service if possible.

  1. Subdomains

As mentioned in Question No1 i like to setup different services.
As far as i understand by now is that i have to configure A records.
But what i have to do that e.g. nextcloud.mydomain.com refers to mydomain.com/nextcloud and couchpotato.mydomain.com to mydomain.com/couchpotato and so on?

Hope there is somebody who can help me out with this questions.
Keep up the work!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hello,

Regarding question 1, you would need to create separate Virtual Hosts, you can do that by following the steps here:

https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04

Regarding question2, in order for Let’s Encrypt to issue the certificate, the A record of the domain name needs to point to the IP address of your server.

Question 3, yes once you have configured your Apache VHosts, then you have to point the A records of your subdomains to the server IP address.

Regards,
Bobby

by Brennen Bearnes
The Apache web server is the most popular way to serve web content on the internet. Apache has the ability to serve multiple domains from a single server by using a mechanism called "virtual hosts". If a virtual host is configured correctly for each domain, the web server can correctly route traffic to the appropriate files based on the domain name requested. In this guide, we'll demonstrate how to configure Apache virtual hosts on an Ubuntu 16.04 server.
Submit an Answer