Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6688597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:25:17+00:00 2026-05-26T05:25:17+00:00

I’m trying to configure mod_mono with Apache2 on OSX. I would like to run

  • 0

I’m trying to configure mod_mono with Apache2 on OSX. I would like to run multiple MVC3 projects on the same virtual host, but for some reason only the first one listed is working. Any help on this would be much appreciated as there is not much documentation on this. I’ve tried a lot of different config options, none of which seem to work.

Listen *:9005
<VirtualHost *:9005>
  DocumentRoot "/Library/WebServer/vhosts/api"
  ServerName api
  MonoAutoApplication disabled

  Alias /gamecenter "/Library/WebServer/vhosts/api/gamecenter"
  AddMonoApplications gamecenter "/gamecenter:/Library/WebServer/vhosts/api/gamecenter"
  MonoServerPath gamecenter "/usr/bin/mod-mono-server4"
  MonoDebug gamecenter true
  MonoSetEnv gamecenter MONO_IOMAP=all
  MonoUnixSocket gamecenter-stage /tmp/mod_mono_server_gc
  <Location /gamecenter>
    Allow from all
    Order allow,deny
    MonoSetServerAlias gamecenter
    SetHandler mono
    SetOutputFilter DEFLATE
    SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip dont-vary
  </Location>

  Alias /gamecenter-stage "/Library/WebServer/vhosts/api/gamecenter-stage"
  MonoServerPath gamecenter-stage "/usr/bin/mod-mono-server4"
  MonoDebug gamecenter-stage true
  MonoSetEnv gamecenter-stage MONO_IOMAP=all
  AddMonoApplications gamecenter-stage "/gamecenter-stage:/Library/WebServer/vhosts/api/gamecenter-stage"
  MonoUnixSocket gamecenter-stage /tmp/mod_mono_server_gcs
  <Location /gamecenter-stage>
    Allow from all
    Order allow,deny
    MonoSetServerAlias gamecenter-stage
    SetHandler mono
    SetOutputFilter DEFLATE
    SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip dont-vary
  </Location>

  <IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript
  </IfModule>
</VirtualHost>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:25:17+00:00Added an answer on May 26, 2026 at 5:25 am

    your problem is that your Alias name and physical path are one and the same, so apache doesn’t know which one to serve up.

    NOTE: I’m giving the answer based on general Apache2 configuration, and not on mod_mono, maybe mod_mono does something to prevent this, I’ve not set MVC apps up under a *nix box before 🙂

    Anyway…

    if you look at your path configurations you have…

    /Library/WebServer/vhosts/api
    /Library/WebServer/vhosts/api/gamecenter
    /Library/WebServer/vhosts/api/gamecenter-stage
    

    without your aliases in place, these already resolve to the paths your trying to map.

    /Library/WebServer/vhosts/api  = /
    /Library/WebServer/vhosts/api/gamecenter  = /gamecenter
    /Library/WebServer/vhosts/api/gamecenter-stage  = /gamecenter-stage
    

    Your then telling Apache that

    / = /
    /gamecenter = /gamecenter
    /gamecenter-stage = /gamecenter-stage
    

    When Apache tries to deliver the content if there is no file subfix or existing slash (as in the last 2) it will automatically, subfix the folder with a / then issue a redirect (306 I believe) essentially telling the browser to redirect from EG:

    /gamecenter to /gamecenter/
    

    With the alias in place to tell it that Alias … is at location x it then has to try and make a desicion to serve

    /gamecenter/
    

    or

    /gamecenter/gamecenter/../ (Because in terms of folder structure the alias name is 1 folder level down in the web than it is physically)
    

    and ends up getting confused, and so does what any virtual host set up does when it’s unable to resolve the path, and that’s return the website root.

    AS I SAY however, this is general NON-MONO Apache behaviour, it is possible that mod_mono may alter the processing pipeline in some way to that may change this behaviour.

    What I would recommend is to split this into 3 virtual hosts which you can do very very easily even on just one IP.

    First thing you’ll want to do is somwhere in your master Apache config file, have a

    Listen 9005
    

    statement. This will make ALL virtual instances listen on that port as well as any other configured port EG: 80

    Next make sure you have a default catch all virtual host, this will catch any server name not mapped elsewhere:

    <VirtualHost *>
      DocumentRoot "/some/folder/where/the/default/is/"
      #Followed by other server directives. NOTE: there is NO servername line
    </VirtualHost>
    

    Once you have that set up, then move onto your “api” sub domain

    <VirtualHost *>
      ServerName api
      DocumentRoot "/Library/WebServer/vhosts/api/"
      #Other required directives here
    </VirtualHost>
    

    At this point, I’m going to pause to discuss your domain name. If this is an internal test system (Which I suspect it is) then you’ll find life with virtual domains way easier if you install a DNS server on you box, then set that up as a master domain using a private internal network address.

    EG:

    Create a root zone, and call it “mydevnetwork.local”

    then add machine names to it:

    EG: if your pc is called devpc1, create an IP address for “devpc1.mydevnetwork.local” and give your pc a static IP address of EG: 192.168.50.1

    Then set an alias for that so

    api.mydevnetwork.local = devpc1.mydevnetwork.local

    Iv’e not got the room to do a full DNS setup post here, but hopefully you get the idea.

    Once you have DNS (or at a minimum host file entries) set up, then your virtual hosts under Apache become really easy to manage:

    <VirtualHost *>
      ServerName api.mydevnetwork.local
      DocumentRoot "/Library/WebServer/vhosts/api/"
      #Other required directives here
    </VirtualHost>
    

    and easy to relocate to another machine should you need too.

    You can set the rest of your virtual hosts up in much the same way

    <VirtualHost *>
      ServerName gamecenter.mydevnetwork.local
      DocumentRoot "/Library/WebServer/vhosts/api/gamecenter/"
      #Other required directives here
    </VirtualHost>
    
    <VirtualHost *>
      ServerName gamecenter-stage.mydevnetwork.local
      DocumentRoot "/Library/WebServer/vhosts/api/gamecenter-stage/"
      #Other required directives here
    </VirtualHost>
    

    Note iv’e set the paths to be the same as you had above, and even though this will work, I’d strongly advise that you give each one it’s own unique folder, I generally do something like:

    wwwroot
        api.mydevnetwork.local
            htdocs   <-- Web files go here
            cgi-bin  <-- cgi scripts go here and it's mapped to /cgi-bin/
            logs     <-- logs here
            access   <-- htpasswd files here
    

    Hopefully if the above is not a complete solution, you might at least get some further ideas of investigation from it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to run a str_replace or preg_replace which looks for certain words
I would like to count the length of a string with PHP. The string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.