/ web

One Server, Multiple Domains

It is possible to have one server host multiple domains, this of course increases the chance of failure (if one server goes down so do ALL of your domains). That being said this saves you tons of money, if uptime is not crucial for you, then this can save you tons of money.
This guide assumes you are on Linux, using either Apache or Nginx!

There are two files you need to edit to get Apache to server webpages on different ports. We are using "/var/www/html" on port 80 as the default settings and "/var/www/html2" on port 88 as the domain we are going to add.

  1. "/etc/apache2/ports.conf"

Add "Listen 88" directly below "Listen 80" in this file.
2. "/etc/apache2/sites-enabled/000-defaut.conf"

Add the follow directly below the closing of the first Virtual Host.

<VirtualHost *:88>
        # The ServerName directive sets the request scheme, hostname and port t$
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html2

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf


We are using "/usr/share/nginx/html" on port 80 as the default and "/usr/share/nginx/html2" on port 88 as the domain we are adding.

Edit "/etc/nginx/sites-enabled/default" and add the following directly below the first server text.

server {
        listen 88 default_server;
        listen [::]:88 default_server ipv6only=on;

        root /usr/share/nginx/html2;
        index index.html index.htm;

        # Make site accessible from http://localhost/
        server_name localhost;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
                # Uncomment to enable naxsi on this location
                # include /etc/nginx/naxsi.rules