Bookworm-project / BookwormDB

Tools for text tokenization and encoding
MIT License
84 stars 12 forks source link

Apache setup is hard on OS X (and *very* hard under el capitan) #81

Open bmschmidt opened 9 years ago

bmschmidt commented 9 years ago

Some things that bookworm config apache could do, but mostly noted here for troubleshooting OS x installations.

  1. Ensure that /usr/bin/env python returns a good version of python py putting this into the EnvironmentVariables dict of /System/Library/LaunchDaemons/org.apache.httpd.plist
<key>EnvironmentVariables</key>
<dict>
   <key>PATH</key>
   <string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/usr/local/bin</string>
</dict>
  1. Possibly not necessary, though I've had to do it after running setup.py: allow apache to write to a python eggs directory.
mkdir /Library/WebServer/.python-eggs
chown -u _www /Library/WebServer/.python-eggs
  1. In /etc/apache2/httpd.conf:

    • Uncomment the line LoadModule cgi_module libexec/apache2/mod_cgi.so
    • Something like the following to allow python scripts to run themselves.
    <Directory "/Library/WebServer/CGI-Executables">
    AllowOverride None
    Options ExecCGI
    AddHandler cgi-script .cgi .pl .tcl .py
    Order allow,deny
    Allow from all
    Require all granted
    </Directory>
bmschmidt commented 8 years ago

Under el capitan, this has become even worse.

/System/Library/LaunchDaemons/org.apache.httpd.plist is in one of the directories that Apple no longer lets even the root user write to. Some possible solution here.

What I've done is simply reboot without system integrity protection using this method, and then edited the plist file.

kaspesla commented 7 years ago

Thank you for this!