Skip to content

Instantly share code, notes, and snippets.

@soupault
Last active July 19, 2016 10:31
Show Gist options
  • Save soupault/9ffd5035891657a9f1499b12d15f32c6 to your computer and use it in GitHub Desktop.
Save soupault/9ffd5035891657a9f1499b12d15f32c6 to your computer and use it in GitHub Desktop.
Installation and running LabelMeAnnotationTool in Archlinux

Install the required packages:

$ sudo pacman -S apache perl perl-cgi php php-cgi php-apache

Download the application code, put it to the server directory, and configure:

$ sudo git clone https://github.com/CSAILVision/LabelMeAnnotationTool.git /srv/http/LabelMeAnnotationTool
$ cd /srv/http/LabelMeAnnotationTool
$ sudo make

If using default /etc/httpd/conf/httpd.conf, perform the following changes:

### Switch to `mod_mpm_prefork.so`. ! THIS IS A MUST FOR PHP7 !
# LoadModule mpm_event_module modules/mod_mpm_event.so
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

### Uncomment
<IfModule !mpm_prefork_module>
	LoadModule cgid_module modules/mod_cgid.so
</IfModule>
<IfModule mpm_prefork_module>
	LoadModule cgi_module modules/mod_cgi.so
</IfModule>
...
LoadModule rewrite_module modules/mod_rewrite.so

### Add `php7_module`
LoadModule php7_module modules/libphp7.so

### We'll use a virtual host, so uncomment this
Include conf/extra/httpd-vhosts.conf

Comment the examples in /etc/httpd/conf/extra/httpd-vhosts.conf and put the following configuration:

### If you'd like to work locally
#<VirtualHost 127.0.0.1:80>
### If you'd like to expose the service to the network
<VirtualHost *:80>
    ServerAdmin WRITE_YOUR_EMAIL_HERE

    Redirect permanent /labelme /LabelMeAnnotationTool/tool.html

    <Directory /srv/http/LabelMeAnnotationTool>
        Options Indexes FollowSymLinks MultiViews Includes ExecCGI
        AddHandler cgi-script .cgi
        AddHandler cgi-script .pl
        AddHandler application/x-httpd-php .php
        AllowOverride all
        Require all granted
    </Directory>

    LogLevel debug
</VirtualHost>

Start Apache server:

$ sudo systemctl start httpd

The application should be working now. To verify, navigate your browser to:

http://127.0.0.1/LabelMeAnnotationTool/tool.html?collection=LabelMe&mode=f&folder=example_folder&image=img1.jpg

or simply

http://127.0.0.1/labelme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment