rr- / malgraph4

MALgraph: statistics service for MyAnimeList.net users.
http://mal.oko.im
Other
158 stars 39 forks source link

Some FreeBSD details #153

Closed nslay closed 9 years ago

nslay commented 9 years ago

I got it to work on FreeBSD. I was loosely able to follow your instructions. My slight modifications are provided below.

Prerequisites: php56 mod_php56 php56-curl php56-dom php56-json php56-pdo php56-pdo_sqlite php56-sqlite3 php56-session

I tried php5 originally. That seemed to work. But I switched to php56 since the author of the wiki article reportedly was using 5.6.

These can be installed with the pkg tool: pkg install php56 mod_php56 php56-curl php56-dom php56-json php56-json php56-pdo php56-pdo_sqlite php56-sqlite3 php56-session

I used Apache 2.4 pkg install apache24

Have it started automatically at boot by adding:

apache24_enable="YES"

to /etc/rc.conf. The service can be started with /usr/local/etc/rc.d/apache24 start or use onestart if you did not add the above to /etc/rc.conf.

The Apache 2.4 service script insists on encryption. It always starts httpd with the -D NOHTTPACCEPT option

If you don't want to setup SSL, add the following:

apache24_http_accept_enable="YES"

to /etc/rc.conf and restart the service with /usr/local/etc/rc.d/apache24 restart

There's no a2ensite in FreeBSD. Just paste

<VirtualHost *:80>
    ServerName mg.example.com
    DocumentRoot /usr/local/www/malgraph4/public_html

    <Directory /usr/local/www/malgraph4/public_html>
        # Needed for .htaccess to work
        AllowOverride all
        Require all granted
    </Directory>
</VirtualHost>

into /usr/local/etc/apache24/httpd.conf

I'm not sure about the default Apache 2.4 install (my config is quite old), but I needed to add the following lines:

LoadModule php5_module        libexec/apache24/libphp5.so
LoadModule rewrite_module     libexec/apache24/mod_rewrite.so
LoadModule dir_module     libexec/apache24/mod_dir.so
LoadModule deflate_module     libexec/apache24/mod_deflate.so
LoadModule filter_module     libexec/apache24/mod_filter.so

to /usr/local/etc/apache24/httpd.conf

And was advised by mod_php56 to add:

<FilesMatch "\.php$">
    SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
</FilesMatch>

to /usr/local/etc/apache24/httpd.conf

Of course, in addition to chmod instructions, it's probably also a good idea to chown the entire malgraph4 folder to be owned by user www chown -R www /usr/local/www/malgraph4

Everything else in the instructions should work. One thing to point out is that Config::$downloaderProxy should be commented out in local.php. Otherwise scripts/init.php will not complete successfully.

Thanks a lot for the source code.

rr- commented 9 years ago

Why don't you add it to the wiki?