Question

TLDR: Would a "real server" (Apache? Flask? Django?) be able to unify various services behind readable subdirectories (abc.work.com/svn, abc.work.com/hg) instead of using port numbers (abc.work.com:8000, abs.work.com:8001)?

Long Version: In the last year I've learned how to serve files with Mongoose, run a minimal python webserver, host version control repositories with Subversion and Mercurial, and host a Trac issue tracker/project management framework.

In each case I've been using the easy built-in webserver provided by each tool to host it from my Windows 7 laptop at work (I'm an engineer who codes, not actually paid to be a "software guy"). In order to avoid clashing I've used different port numbers in the 8000 range for each server to listen on, and sent my coworkers links like http://machinename.domain.com:8042 to access these magical things I've created.

The first obvious problem is that I'm running a lot of these things out of a command prompt and just letting it sit open on my desktop. I also know how to call cmd.exe from VBScript in order to hide the command prompt if that's all I wanted. Many of the built-in webservers even have options to run as a service, which can get harry with permissions, but is closer to the "right" way to host a server of any kind.

The bigger problem is that I'm sending people links to my machine with different port numbers. I'm ok with them having to use my machine name - I assume I'd need the network admin folks to add a DNS entry to call it TeamAwesome.company.com instead of machinename.company.com:8000?

The bigger question is, if I did something fancy like an Apache, Django, or Flask webserver, could I set it up like machinename.company.com/trac for the trac server and machinename.company.com/hg/project1 for the HG repository for project1? I'm looking at Apache, Django, and Flask because I've been diving into Python for 2 years now and those appear the most applicable/approachable for my needs.

I understand that ideally this stuff should be hosted on a separate linux-y server machine, but I'll need to prove the usefulness of the tools I'm developing before I request server resources from my boss (who hired me to do engineering, not programming, or web development, or systems administration, etc.).

I see this looks related. Are http proxies, virtual hosts, nginx, and WebSockets things to look at?

Looking at Apache VirtualHost examples looks promising though I can't decipher if one of those examples actually does what I'm talking about. Thanks for any suggestions as I go further down the rabbit hole with this stuff!

No correct solution

OTHER TIPS

Apache virtual hosts can be differentiated by listening ip and/or port number only. The mod_proxy module can do what you want if you want/have those services to be running separately as well:

 ProxyRequests Off
 <Proxy *>
     Allow from all
 </Proxy>

 ProxyPass      /folder_a       http://backend_a:1234/ retry=5
 ProxyPass      /folder_b       http://backend_b:8888/ retry=5
 # etc

However if you just want to point different urls to point to unrelated folders on your server then check the Location and Alias directives

No need for proxy settings. You can use a single virtual server, but run each application under a certain subdirectory: for example, with Django or another wsgi app, you would simply set WSGIScriptAlias to the relevant dir.

A big clarification, though: Django is not in any way a server. In fact, you need Apache or an equivalent in order to serve Django properly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top