vatic icon indicating copy to clipboard operation
vatic copied to clipboard

Instructions for OSX

Open varun-nagaraja opened this issue 10 years ago • 8 comments

Installation on OSX

The following procedure shows how to install Vatic on OSX with Anaconda Python and Homebrew. The rest of the instructions for using turkic remains the same as mentioned in README.

Author: Varun Nagaraja ([email protected])

Dependencies

  • OpenSSL installed via Homebrew will not be linked as OSX already provides one. Hence you need to force link it.
$ brew install openssl
$ brew link —force openssl
  • MySQL
$ brew install mysql
$ mysql.server start
  • Apache
$ brew install httpd24
$ brew tap home-brew/apache
$ brew update

Before installing mod_wsgi execute the command to create symlink as mentioned on https://github.com/Homebrew/homebrew-apache

$ brew install mod_wsgi
  • Other python packages
$ pip install sqlalchemy parsedatetime

Download Vatic

$ wget http://mit.edu/vondrick/vatic/vatic-install.sh
$ chmod +x vatic-install.sh
$ ./vatic-install.sh
$ cd vatic

Setup Apache

Edit /etc/apache2/httpd.conf

  • to include LoadModule wsgi_module /usr/local/Cellar/mod_wsgi/3.4/libexec/mod_wsgi.so
  • uncomment Include /private/etc/apache2/extra/httpd-vhosts.conf

On Yosemite, you will also have to uncomment LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so

Edit etc/apache2/extra/httpd-vhosts.conf instead of sites-enabled/000-default as done on Linux.

Remember to set the right path for anaconda python.

WSGIDaemonProcess www-data python-eggs=/tmp/.python-eggs
WSGIProcessGroup www-data

WSGIPythonHome /Users/<username>/anaconda

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot /Library/WebServer/vatic/public
    WSGIScriptAlias /server /Library/WebServer/vatic/server.py
    CustomLog /var/log/apache2/access.log combined
    <Directory "/Library/WebServer/vatic">
        Options Indexes FollowSymLinks MultiViews Includes
        AllowOverride None
        #For Yosemite
        Require all granted
        #For Mavericks, uncomment the below two lines and comment the above Require line
        #Order allow,deny
        #Allow from all
    </Directory>
</VirtualHost>

Restart the apache server

$ sudo apachectl graceful

Setup MySQL

$ mysql -u root
mysql> create database vatic;

Setup Vatic

Copy vatic folder to /Library/WebServer/vatic so that you do not have to provide write access to folders inside the home directory.

Videos

  • The video frames should also be in a public folder like /Library/WebServer/vatic
  • On OSX, there might be some hidden folders with the name .DS_STORE created after extracting and moving the frames folder. Turkic will throw errors in cli.py. For now, you can just delete that .DS_STORE folder.

Permissions

  • The home directory should have both read and execute permissions so that the anaconda python directory is accessible by the apache server.
  • Ensure that private and sensitive folders inside the home directory have no read permission for others except you.

P.S: If things don’t work check /var/log/apache2/error.log. It tells you if there is any module that is not accessible or missing.

varun-nagaraja avatar Sep 04 '14 07:09 varun-nagaraja

I thought this might be helpful for others trying to install on OSX. It would be nice to add it in either README_OSX or in the existing README.

varun-nagaraja avatar Sep 04 '14 07:09 varun-nagaraja

Possible typo: brew tap home-brew/apache

Should be: brew tap homebrew/apache

chris838 avatar Mar 17 '15 18:03 chris838

Another small typo: Edit etc/apache2/extra/httpd-vhosts.conf

Should be: Edit /etc/apache2/extra/httpd-vhosts.conf

chris838 avatar Mar 17 '15 18:03 chris838

Thanks for the fixes Chris.

varun-nagaraja avatar Mar 17 '15 19:03 varun-nagaraja

The .sh file contains apt-get install commands. Replacing it with brew leads to certain conflicts. Also packages like mysql and python packages parsedatetime are installed again by calling the .sh file. Brew could not dig up libavcodec and stuff. Is it possible to release a .sh installer which address all these and does every installation on the fly ?

sm176357 avatar Sep 23 '15 13:09 sm176357

I add some python import errors in my apache error.log and adding python-eggs=/path/.python-eggs fixed it! Thank

corentin87 avatar May 24 '17 01:05 corentin87

Also i had brew install mod_wsgi --with-homebrew-httpd24 --with-homebrew-python otherwise i was getting a conflict error from mod_wsgi because of not using the brew python!

corentin87 avatar May 25 '17 07:05 corentin87

@corentin87 Hi, do you know why i always got No nodule named parsedatetime as the following show: beans@Beans:~/Annotation/vatic$ turkic setup --database Traceback (most recent call last): File "/usr/local/bin/turkic", line 5, in pkg_resources.run_script('turkic==0.2.5', 'turkic') File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 528, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1394, in run_script execfile(script_filename, namespace, namespace) File "/usr/local/lib/python2.7/dist-packages/turkic-0.2.5-py2.7.egg/EGG-INFO/scripts/turkic", line 12, in import cli File "/home/beans/Annotation/vatic/cli.py", line 22, in import parsedatetime ImportError: No module named parsedatetime %%%%%%%%%%%%%%%%%%%%%%%%%% But when I run python and import parsedatetime, it works. beans@Beans:~$ python Python 2.7.14 |Anaconda custom (64-bit)| (default, Oct 16 2017, 17:29:19) [GCC 7.2.0] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import parsedatetime

Any idea about this problem? Thank you very much.

YangBain avatar Nov 10 '17 00:11 YangBain