I have a vps in IONOS with ubuntu 18.04.
I have followed this tuto to configure apache , and my new website.
Right now , the website work only with ip address but not with domain name.
This is www.mydomainname.com.conf under /etc/apache2/sites-available
<VirtualHost *:80>
ServerAdmin admin@mydomainname.com
ServerName www.mydomainname.com
DocumentRoot /var/www/html/www.mydomainname.com
<Directory /var/www/html/www.mydomainname.com/>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
and this is my the config under /etc/hosts
127.0.0.1 localhost.localdomain localhost
127.0.1.1 localhost
82.165.112.22 www.mydomainname.com
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
That's all