It sounds like Airtime comes with its own web server, but "cast (whatever that is) doesn't. Is this correct?
Anyway, the general problem can be handled in many ways:
You can run both applications within the same web server, if possible. This would only be impossible if one of the applications depends on a very specific version of the web server (assuming Apache based on the Airtime config file) that is incompatible with the other application. But if you can get all the requisite Apache modules loaded into a single instance of Apache, sufficient to run both apps, then yes, you just have to put each application in a separate path within the document root, e.g. /var/www/airtime and /var/www/cast, and it'll "just work". Alternately, you can map any directory in the filesystem into the document root, either by simlinking into /var/www, or by Apache config directives.
You can run two different web servers but run them on different ports. This will change the URL to at least one of the instances to require a port number after the domain, e.g. http://example.com:8080/blah
where the :8080
is the port (I recommend choosing a value greater than 1024 but less than 65000, and google the number before using it to make sure it's not a well known port for a service you are already running).
You can run two different web servers but run them on different IP addresses. You can keep the port default at 80 (or 443 for https
) this way, but you'll need two different IPs.
You can run two different web servers but run them on the same IP address but on different subdomains. You can then use URL Rewriting to automatically map requests to http://airtime.example.com
to the airtime application and from http://cast.example.com
to the cast application.
For all of the above, you can even do it within one web server if the configuration is robust enough -- and the Apache web server is robust enough to do all of the above within one web server instance, although you'll need some more exotic configuration settings for some of the choices. Note that I highly recommend trying to run it all within one web server instance first, because this way is more flexible and easier to manage, plus you probably can configure it without having to worry about ports or IP addresses, which complicate things for your users in the former case and for you in the latter case.
The problem with the Airtime config is that it's trying to be a vhost for *:80
which means that every request to your server on port 80 is going to be mapped into the document root for airtime, i.e. /usr/share/airtime/public
. You need to get both the cast
application and the airtime
application within the same vhost, or else, constrain the vhost of airtime from *:80
to something like airtime.example.com:80
so that only requests to that subdomain will get passed to airtime.
Your Apache config that comes builtin with Debian is at /etc/apache2/
directory, so go there and look at apache.conf
. Notice that it also has a <VirtualHost *:80>
directive. Well, you can't have two virtual hosts claiming to handle all requests on port 80; only one of them can win. Therein lies the problem.
subdomain.example.com
unless you want everyone that views this question to visit it and possibly start snooping around.