Mobile app version of vmapp.org
Login or Join
Kaufman445

: Hosting several HTTP servers on single domain name Several people have got a single domain name server.company.com server, where they are now supposed to host their infrastructure or temporal projects,

@Kaufman445

Posted in: #BestPractices #SharedHosting

Several people have got a single domain name server.company.com server, where they are now supposed to host their infrastructure or temporal projects, written in different ways even in different programming languages. How do they divide the domain?


Split into subdomains: john.server.company.com, kate.server.company.com, etc.
This would need a lot of admins' assistance, time, etc. -- there would be no way for John and Kate to do it themselves.
Split into url namespaces: server.company.com/john/, server.company.com/kate/, etc.
Pro: They now can make a single welcome page at root with any additional info (if they need?)
Con: Each server would need to know their namespace string constant, and hrefs like / whould need patching.
Split into ports: server.company.com:8080, server.company.com:8081, etc. and make a single :80 welcome page.
Pro: They still can make a single welcome page at :80
Con: ???


I would like to know more pros and cons for 2 and 3 solution.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Kaufman445

2 Comments

Sorted by latest first Latest Oldest Best

 

@Becky754

Different content but same language? (guessing PHP here)

Assuming you're using Nginx I would go with something like this for a server configuration:

server {
listen 80;

server_name ~^(.+).server.company.com$;

set $site "";
if ($host ~ "^(.+).server.company.com$") {
set $site "/";
}

root /var/www$site;
index index.php index.html index.htm;
}


You'd still have a shared root directory of /var/www that contains all "sites" so they can update files there and point to their domains under it. Requests for host john.server.company.com would be served from the /var/www/john root directory. Of course you'll need a DNS wild card entry for anything * at .server.company.com so that you only need to updated DNS settings once. When a new user needs working space all they'd need is to have a working directory created under /var/www and they can access it with their name.server.company.com like everyone else.

Personally, their sharing of working directories for number 2 would depend on what's being done. If the projects are unique unto themselves then I wouldn't have them shared. If it is something as simple as template work then it's probably not a big deal.

Number 3 is completely out - to get to any location you'd have to manually enter the port in the browser's address bar but you could always book mark it I guess.

10% popularity Vote Up Vote Down


 

@Megan663

The concept of running multiple sites on a single server is known as "shared hosting." Shared hosting is very common and there are tools that you can install on a server to make it easier: cPanel, Plesk, or Webmin that make setting up sites (including the DNS) more self service for your users.

In all the cases that you mention, you are going to have to do some sort of administration tasks for each user such as adding DNS entries, adding virtual host entries, creating directories, setting permissions, or editing server configuration. The directories doesn't require DNS entries, or much server configuration, just directory creation and permissions, so it is probably easiest from an administration standpoint. The subdomains requires DNS entries and virtual host setup. The port numbers requires setting up a whole server instance running for each, or editing the configuration of a single server to listen on multiple ports then virtual host entries for each one.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme