How to configure Mountain Lion Server to run Web2py with wsgi?

I am trying to config Mountain Lion Server to run Web2py with mod_wsgi. I get an error saying: "Premature end o scritp Header" wsgihandler.py (which is the wsgi file for Web2py).
I had it working fine in Snow Leopard and Lion Servers but not in Mountain Lion Server.
Thanks for your help.
Flavio.

I don't run web2py framework so can't tell you specifically.
That error means your script is not writing an http header to the browser so the browser can't decode whatever string it is getting. Your script is running as a plain old Python script. This is most likely because the Server.app in 10.8 now includes mod_wsgi built-in and configured from the GUI.
You can insert an intercept anywhere in your code to check any variable by saying this:
##########   PROGRAMMING HERE  ###############
print("Content-type:text/plain\n\n")
print(someVariable)
# raise SystemExit
The above sends an "http header" so the browser knows what to do. These headers are invisible in the browser window. But depending on your Python version, the pring statement may not work (I am running Python3). The SystemExit statement is optional, just in case your script crashes downstream.
WSGI sends a header like this:
startResponse("200 OK", [("Content-Type", "text/plain")])
but it sounds like mod_wsgi is not even being invoked. Normally your WSGI script is named *.wsgi and your Apache is set up to run the Python script as CGI under the mod_wsgi handler using this directive:
AddHandler wsgi-script .wsgi
The file having the config is located at
/Library/Server/Web/Config/apache2/httpd_wsgi.webapp.conf
where webapp is the name of your webapp. I would suggest copying the file called httpd_wsgi.conf and renaming it to your webapp name. When Server.app is configured properly, you enable wsgi webapps in the GUI Advanced wndow for your domain.

Similar Messages

  • HT4827 How to disable Mountain Lion Server?

    Typical of Apple to release software without documentation
    Please help me find current information for http://support.apple.com/kb/HT4827
    There is no "Dedicate system resources to server services" in Mountain Lion Server.....
    HELP

    Does not look like that would be verry effective - as I see many items in various lovcations from this app - sigh...

  • Configuring Mountain Lion Server for iOS MDM

    Hi all,
    I am an admitted newbie to the Mac world. That said, I am in the process of setting up an OsX 10.8 server to handle the MDM for our iPad deployment. This is in a school district that runs all Windows in Active Directory.
    I attempted to do the setup with no luck. So, I tried to reset the server back to the defaults and found that the settings I had made previously were still there.
    What I need to know is how should I go about getting back to essentially scratch with this setup? Once I have that, what is the correct setup process to get me to where I can enroll the iPads to do the wireless MDM? We do not need to have access to the server from any other devices. No other services are needed like email, file shares etc. We have several sites on many different subnets but all on the same network.
    A few specifics I do need to know is which network configuration would be preferred for our type of network? I'm thinking Private since everything will be handled internally. Also, regarding the certificates, is an SSL certificate required? And last, I read that there are some TCP ports that need to be opened. Is this required if we are running strictly internal with this?
    Sorry for rambling on and my inexperience. I appreciate any help anyone can give.
    Thanks!

    You can use .private but if there is EVER the possibility that this would be used outside your LAN, then I would use a FQDN.
    You do not need a commercial certificate. A self-signed will work fine.
    The default self-signed has a 1 year expire. If you don't want to deal with updating the cert in a year, I would create a new 5 year cert.
    This option is harder to find now with mountain lion.
    From the Certificates section in Server, first click the gear and choose 'show all certficates', then hit the + button and choose 'Create a trusted certificate'. You will see a button to override defaults. This allows you to have a different expire date.
    You can reset the profile manager data (stored in postgres) with:
    sudo /Applications/Server.app/Contents/ServerRoot/usr/share/devicemgr/backend/wipeDB.sh

  • How to uninstall Mountain Lion Server

    I recently had to uninstall OS X Server (version 2.2, for Mountain Lion, not the earlier Server for Lion), and I couldn't figure out how. Here's what worked:
    Start Applications/Server.
    Turn off all services that are running.
    Quit out of Server.
    Drag Applications/Server to the Trash.
         Doing so will cause an alert to pop up, saying that removal of Server has been detected. Okay that.
    Drag Macintosh HD/Library/Server to the Trash.
    Restart.
    I had to uninstall because I was trying to use Migration Assistant to copy everything to a new machine, and it refused to do so as long as Server was installed.

    Most of the world uses Linux or Windows Server, and that's why Apple doesn't put their highest standard of effort into OS X Server... And because of that, most of the world uses Linux or Windows Server, it's a Catch 22.
    Nevertheless, it is the best solution for managing an array of Apple devices, especially corporate iPads, I can think of nothing else that lets me do all of the things OS X Server lets me do.  Granted, I have a bunch of Apple products, I'm sure if I had a bunch of Android and Microsoft products, I'd be using Windows Server instead.
    Like I said though, if more people used OS X Server, I'm sure Apple would put more effort into it.  Heck, if they charged more for it, if that's what it takes for them to make it competitive with Windows Server, I'd pay the premium.
    @MeatyChi,
    You can copy the Server app from any Mac and put it on Another Mac.  Don't worry about the Library/Server directory, that's automatically created when Server.app runs its first-use operations.

  • Will OS X Mountain Lion Server work full feature with PC Clients?

    I have a small business with mixed PC and MACs, I want to purchase a Mac Mini Server and launch it in our company, we are about 25 employees that might increase to about 40 so I wonder if sevices like Calendar, VPN, Messages, Chat, Mail, Contacts, wiki, profile manager.. etc work with PC Clients, what will and what will not?
    I would like if at least, contacts, calendar, mail, wiki, open directory, VPN and iChat work, the basic things one needs in business to work with PC clients, will they work seemlessly, do I need to install certain software on PC clients... any thoughts or pointers?

    Hello,
    YamenQ wrote:
    I wonder if sevices like Calendar, VPN, Messages, Chat, Mail, Contacts, wiki, profile manager.. etc work with PC Clients, what will and what will not?
    I recommend using eM Client for windows. The software is not free however I find that windows users seem to like it better then the free software because its more like Outlook with everything in built in.
    I would setup both PPTP and L2TP VPN. PPTP for your windows clients and L2TP for your Mac Users. The VPN service on the Mac Server is pretty solid and I have very little problems with windows clients.
    Thanks,
    ebrind

  • Firewall gui for Mountain Lion Server

    Is there an easy firewall for Mountain Lion server? Im amazed Apple took this feature away. For what reason? I dont know command line very well and shouldnt have to learn it seeing as how Macs are supposed to be "user friendly". Doing a port scan I see about 20 ports open that I want to close but just dont know how as they're not application specifc (like pop3...). Any suggestions would be helpful.
    thanks.

    Scott Howe wrote:
    I meant to say "Is there a GUI for the Firewall for Mountain Lion Server"
    I totally agree with you, the whole point of OS X was to be easy to use i.e. GUI based, if we wanted a pure CLI system we would get Linux
    There are actually two different Firewalls on Mountain Lion Server, the 'standard' one you see in System Preferences which is an Application level firewall (ALF), and has extremely limited options but does have a GUI, and the CLI only one which is pfctl (Packet Filtering).
    Note: ipfw is depreciated in Mountain Lion.
    There is a third-party tool for configuring pfctl called IceFloor. Be careful though, I managed to screw up a system with it, as always make sure you have a backup before making changes.
    See http://www.hanynet.com/icefloor/

  • Will Mountain Lion Server be slower that Lion Server on my 2009 Mac Mini?

    I have a 2009 Mac Mini running Lion Server. Specs are: 2.0 GHz 8 GB ram.
    As always, I'm wanting to reap the benefits of the latest OS without upgrading my hardware. I know mirroring won't be supported, but who cares about that on a server.
    Does anybody have Mountain Lion on a similar setup?

    We've found Mountain Lion Server to run just as fast as Lion.  MLS boots a bit slower on our Mac minis, but it's
    neglegable.
    Also have had trouble migrating from Lion and 10.6.8 server to Mountain Lion Server.  Issues with Open Directory and Mail.
    Hope Apple puts out a .1 release to address the issues soon.

  • Configuring postfix on Mountain Lion Server

    I'm trying to upgrade from Snow Leopard Server to Mountain Lion Server and did an install of Mountain Lion Server on top of a working instance of Snow Leopard Server.  The "crippled" GUI on Mountain Lion Server is forcing me into using terminal to configure Postfix to handle incoming email.
    I would like to configure Postfix to only accept email that is forwarded from a gmail business account.  The public email address is [email protected] which is received by Google Mail, goes through their spam filters and then is auto-forwarded to  [email protected]
    The server WAN domain is nonpublic.com  The ip address is 96.231.165.126
    The server LAN is nonpublic.local  The ip address is 10.6.18.201
    The server is a MacMini running Mountain Lion Server 10.6.8 hostname server so the FQDN is server.public.com.
    The network on the MacMini is configured to handle both LAN and WAN traffic through the 1GB physical ethernet port which plugs into a CISCO 3750 switch.  The external traffic to the WAN flows through the switch as tagged packets.  The LAN traffic is not tagged.  The VLAN connection is running 802.1q
    When an email is sent through the WAN to [email protected] the Postfix SMTP log shows:
    Jun  7 19:29:22 server.public.com postfix/smtpd[42181]: connect from cisco.public.com[96.231.165.123]
    Jun  7 19:29:22 server.public.com postfix/smtpd[42181]: disconnect from cisco.public.com[96.231.165.123]
    I can send emails from a client on the LAN through this server with no problems.  The incoming mail server can connect to the machine via the Cisco router/switch but Postfix just shows "cisco" as the connection (that's the router's DNS name) and provides no more info.  I suspect Postfix possibly doesn't like the 802.1q connection and drops the SMTP request to connect on port 25.
    I have turned on "debug" logging in Postfix, but that is all that appears in the SMTP log file
    I've spent most of the week reading through everything I can find on how to install and configure postfix on Mountain Lion Server and work around the cripled GUI in the "server" application.  I'm barely OK using Terminal and not familiar at all with configuring Postfix directling editing the config file.
    What is the best approach to configure Postfix to allow SMTP connections from the outside to deliver incoming email that is forwarded from gmail.com?
    I did find an "aliases" file in /etc/postfix/aliases but I'm not sure how to add the aliases and if adding aliases with a text editor is going to cause the "server" app problems and if the changes will be lost when the machine is restarted.
    Any help would be appreciated.

    MrHoffman, thank you for your response to my challenge to get the new test server working.  This is a migration from Snow Leopard Server to Mountain Lion Server.
    Here is the "checkhostname" test results:
    blue:~ admin$ sudo changeip -checkhostname
    Password:
    Primary address     = 96.231.165.211
    Current HostName    = blue.pderby.com
    DNS HostName        = blue.pderby.com
    The names match. There is nothing to change.
    dirserv:success = "success"
    blue:~ admin$
    Here is the response from postconf -n
    blue:~ admin$ postconf -n
    biff = no
    command_directory = /usr/sbin
    config_directory = /etc/postfix
    daemon_directory = /usr/libexec/postfix
    data_directory = /var/lib/postfix
    debug_peer_level = 2
    debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin xxgdb $daemon_directory/$process_name $process_id & sleep 5
    dovecot_destination_recipient_limit = 1
    html_directory = /usr/share/doc/postfix/html
    imap_submit_cred_file = /Library/Server/Mail/Config/postfix/submit.cred
    inet_interfaces = loopback-only
    inet_protocols = all
    mail_owner = _postfix
    mailbox_size_limit = 0
    mailq_path = /usr/bin/mailq
    manpage_directory = /usr/share/man
    message_size_limit = 10485760
    mydomain_fallback = localhost
    newaliases_path = /usr/bin/newaliases
    queue_directory = /Library/Server/Mail/Data/spool
    readme_directory = /usr/share/doc/postfix
    recipient_delimiter = +
    sample_directory = /usr/share/doc/postfix/examples
    sendmail_path = /usr/sbin/sendmail
    setgid_group = _postdrop
    smtpd_tls_ciphers = medium
    smtpd_tls_exclude_ciphers = SSLv2, aNULL, ADH, eNULL
    tls_random_source = dev:/dev/urandom
    unknown_local_recipient_reject_code = 550
    use_sacl_cache = yes
    blue:~ admin$
    I agree that I should change the LAN domain from .local to something like .internal or whatever.   I've been running with .local for 5 years  on snow leopard server and never had any problems so that was a low priority.
    I hope I'm just not seeing some obvious setting in main.cf

  • OSX Mountain Lion Server - how do you uninstall this including services

    Hi All,
    Sorry if the question has been asked before.
    I have Mountain Lion 10.8.5 and installed OSX Mountain Lion Server (2.2.2) and run into a couple of issues after installed successfully.
    * I no longer can add users and groups.
    * Open Directory fails to connect.
    So I read some forums and uninstalled the server by trashing it, deleting /Libaray/Server, empty trash and reboot. But when I reinstalled the server it renabled all the services that I had previously and still not able to add users and groups. Open Directory fails to connect "not able to load replica" So I try to create a new OD and get an error the server is already a Network Server.
    So basicaly I want to start from scratch and need some assistance how to get rid of OSX Server.
    Thanks
    Sahid

    Wipe the disk, and reinstall OS X.  (Not fun, of course.  I just created a bootable USB disk for this purpose, and nuked an errant server configuration.  A "target practice" server used for testing purposes had gone awry, and needed to be wholly reset.  So I know what you're going through.  Visit here or here for some instructions.)
    FWIW, usual trigger for problems with OS X Server on a NAT'd network is bad DNS.  That step gets skipped, or folks think they can refer to ISP or off-LAN DNS servers, and problems ensue.  OS X Server needs LAN-local DNS when NAT is in use.

  • Error configuring services from Snow Leopard Server to Mountain Lion Server

    I am trying to upgrade a Snow Leopard Server Mac Mini to Mountain Lion Server.
    We have two Mac Mini servers at our office (production and backup) so I migrated the everything from our production server to the backup using the migration assistant when setting up the backup computer.
    I now have the backup at home trying to upgrade it to Mountain Lion Server.  I have downloaded and installed Mountain Lion as well as the Server App version 2.2.  I basically followed the simple directions found in the Apple documentation.
    I started the server app and it got to the part where it said "Upgrading services".  After running for a few minutes, I get a window that states "An error occurred while configuring your server."  It also sayd "The following actions failed or were not attempted:" with a red dot next to "Upgrading services".  The other three items:  "Authenticating to local directory", "Reading directory configuration" and "Authenticating to local directory services" have gray dots so I'm sure they were not even attempted.
    Our Snow Leopard server is setup for SMB file sharing, LDAP services, FTP, Web, DNS, DHCP.
    Can someone point me to where I can figure out what exactly is failing?  Are there specific log files I need to look into?
    Thanks

    Have EXACTLY the same issue - also tried reinstalling mountain lion server fresh and still had the same problem...

  • How do I share a folder over the internet with Mountain Lion server?

    I am new to using formal servers.  In Snow Leopard I was able to use web sharing to serve a small website and if I wanted to share a folder with someone I would  just provide the person I wanted to share a file with the path to the file inside the sites directory.  With Mountain Lion this functionality was removed from the sharing section of system preferences.
    I purchased mountain lion server and was able to restore the website serving ability, but I haven't been able to figure out how to share a folder.  I am still looking over what documentation I can find, but for the most part it just tells me to set up the services without telling me how.  Any assistance would be helpful.  Networking is not my area of expertise.
    Best Regards,
    David Finell

    I purchased server to assist with this as I am unfamiliar with the command line protocols for using apache.  Because of the UNIX architechture of OSX and I presume apache, I am uncomfortable using the command line for fear of causing serious problems.
    Unfortunately, the documentation that I have seen for mountain lion server is wanting in either its completeness or layout/functionability.  To summarize the server instructions as I understand them.  It just says to configure it and my system to meet my requirements without telling me how.
    I am confident that both the apache command line and server are capable of accomplishing what I was able to do before under snow leopard.  I just haven't figured out how.
    I was able to provide a link to family and clients like http://ipaddress/~user/folder
    This no longer works.

  • How well will Mountain Lion run on the following MacBook Pro?

    Thinking about biting the bullet and upgrading to Mountain Lion on my MacBook Pro. My specs are as follows:
    MacBook Pro 15"
    (Late 2008 model MacBookPro5,1)
    Intel core 2 duo 2.53Ghz
    8GB RAM
    1TB HD with 390GB free
    Mac OS X 10.6.8
    So, how well will Mountain Lion run on this configuration? Currently I'm finding my computer annoyingly slow, so am wondering whether an upgrade was worth trying or not?
    Any advice would be most appreciated!
    Thanks!
    Joe.

    Sorry, I should have been clearer - that's what I was thinking, which is why I was asking the question. I thought that if I was going to all the effort of a reformat etc that I should just upgrade to Mountain Lion while I was at it, but didn't want to do that if it was going to run really slowly anyway and then have to go through it all again to go back to Snow Leopard.
    etresoft wrote:
    .... Mountain Lion should run fine on that machine.
    So, have you had any personal experience of Mountain Lion running fine on this MacBook Pro? I know that officially it will run, but I'm wondering about the "real life" experience of it running on this model.
    Anyone out there able to share their expeience?

  • How to change store location of software updates on SUS on Mountain Lion Server?

    Such thing can be done on 10.6 server, and 10.7 server... Not on 10.8 as far as I can see?
    I'd appreciate any help.
    Thx,
    Vedran

    Another option is to 'replace' the built-in SUS server with a third-party one. I am using Reposado which is fully compatible but can easily be told to store the updates anywhere you want and while I am running it under Mountain Lion can be run on non-Mac platforms. If/when OS X 10.9 comes out it will be possible to continue running Reposado under Mountain Lion and add 10.9 updates to it without having to upgrade the server itself.
    Additionally, even if you run it on say Lion you can still download and server out Mountain Lion updates. The final major improvement is that you can define 'branches' like a released branch and a testing branch, so that initially you only allow access to new updates to machines configured to use the testing branch.
    As of itself Reposado has to be configured via Terminal, but you can install a web-interface called Margarita to allow configuring in a web-browser.
    Reposado - https://github.com/wdas/reposado
    Margarita - https://github.com/jessepeterson/margarita

  • How do I make a wiki on OS X Mountain Lion Server?

    I'm trying to make a wiki with my OS X Mountain Lion server my question is how do i do it? Please help me?

    When running Server.app do you see that little button that says 'Next Steps' in the bottom left corner of the window ?  Click on it and read stuff.
    Alternatively click on the 'Help' menu and type 'wiki' into the search field that appears.

  • Can't get Mountain Lion Server Server to upgrade properly - Configuring services

    Hi All,
    First of all thanks for any answers or suggestions you might have. We are a small business with about 25 employees. We have been running Lion Server for email and collaboration without much issue. Today we decided to upgrade to Mountain Lion Server, which was a big mistake apparently. We downloaded and installed Mountain Lion which went fine. We then downloaded and installed the new Server app and that's where things got hairy.
    The Server app got to the part where it says Configuring Services and just sat there spinning. After about an hour I figured something was up and noticed in the console that there were a bunch of errors trying to update certain things. Needless to say we had to force quit the Server app after a long while and nothing got updated/migrated. We were left with a non functional server. Luckily we had set up the Lion Server to clone to another drive and we were able to boot to that to get back to work.
    None of us have much experience with command line, part of the reason we got Lion Server in the first place was it's ease of use and GUI. So has anyone else had similar issues? We are kind of at a loss as to where to go next. Thanks!

    It is indeed an option to wait, although I did manage to upgrade four servers that all have working forward and reverse DNS from Lion Server to Mountain Lion 10.8.
    After installing OS X Server on top of that server specific items like mailboxes returned

Maybe you are looking for