-2

I'm setting up my raspberry pi for shared hosting. My aim is to host more websites by purchasing domain names through providers such as ovh.com or register.com I am using webmin to create the web servers, I have installed the modules: Apache Web Server, DNS Bind Server. My problem is that mine is a home hosting so I have only one public ip address, how do I make sure to use the same shared ip address with multiple domain names? it's possible to do it?

image

  • 1
    Questions involving web hosting control panels are off-topic because they customize their systems so that standard system administration methods no longer apply. Some related topics may be asked on Webmasters – djdomi May 21 '22 at 17:44

1 Answers1

0

Yes, these are called virtual hosts in Apache lingo. See the Apache documentation:

https://httpd.apache.org/docs/current/mod/core.html#virtualhost

Basically you'll define at least a Virtual Host name and a folder from which to serve its web pages for each website you wish to host.

Something like:

<VirtualHost <your IP>:80>
  ServerAdmin webmaster@host.example.com
  DocumentRoot "/www/docs/host.example.com"
  ServerName host.example.com
  ErrorLog "logs/host.example.com-error_log"
  TransferLog "logs/host.example.com-access_log"
</VirtualHost>

Repeated for each hostname for which you want your server to serve queries.

As for the Webmin Apache module, it has a "Virtual Host" section.

Notice that in your case, your public (internet facing) IP address may not be fixed; so you may need to use a dynamic DNS system. Also, generally you'll need to forward the proper ports from your router to your server (generally 80 and 443 for TLS).

wazoox
  • 6,918
  • 4
  • 31
  • 63
  • I've done all of this but how should I set up my domain name? I created an A record from the domain name provider pointing to the public address, but doing so in both domains example1.it and example2.org point to the same page and not their folders – antoniodilorenzo May 22 '22 at 10:18
  • @antoniodilorenzo show your Apache configuration file. Remember that there are two different configurations for http and https, too. – wazoox May 23 '22 at 15:22