home | list info | list archive | date index | thread index

Re: Multiple sites and URL on a single Apache server

  • Subject: Re: Multiple sites and URL on a single Apache server
  • From: Dianne Skoll <dianne [ at ] skoll [ dot ] ca>
  • Date: Fri, 16 Jul 2021 15:08:32 -0400
On Fri, 16 Jul 2021 14:44:28 -0400
jean-Francois Messier <jf [ at ] messier [ dot ] ca> wrote:

> Can someone explain or point me to a site that explains how I can have
> multiple apps or sites on a single Apache server, using the same main
> hostname, followed by different subdirs

> - https://vps.messier.ca/app1 that would point to /var/www/app1
> - https://vps.messier.ca/app2 that would point to /var/www/app2
> - https://vps.messier.ca/app3 that would point to /var/www/app3

That's easy; just put your apps in subdirectories if they support it.

> or different hostnames that would point to different locations on the
> server (all hostnames would point to the same IP)

> - vps1.messier.ca that would point to /var/www/app1
> - vps2. messier.ca that would point to /var/www/app2
> - vps3.messier.ca that would point to /var/www/app3

That's a better way.  You can use Name-Based Virtual Hosts.  If you're
using Apache: https://httpd.apache.org/docs/2.4/vhosts/name-based.html

I don't know how to do it using Nginx, but I'm sure if you google
"Name-based Virtual Hosts Nginx" you'll find something useful.

Regards,

Dianne.

To unsubscribe send a blank message to linux+unsubscribe [ at ] linux-ottawa [ dot ] org
To get help send a blank message to linux+help [ at ] linux-ottawa [ dot ] org
To visit the archives: https://lists.linux-ottawa.org

references