Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
laptop:mods [2017/07/07 07:26] matthias [PHP for PirateBox] |
laptop:mods [2017/07/07 07:27] (current) matthias [Modifications for PirateBox] |
||
|---|---|---|---|
| Line 17: | Line 17: | ||
| After this make a ''reboot''. All ''.php'' files are processed, as long as these are placed in the ''/content/'' folder. This folder is located in ''/opt/piratebox/share''. In fastcgi-php.conf, the thread limit is 1, if you run on a multiple core system you may want to increase it. | After this make a ''reboot''. All ''.php'' files are processed, as long as these are placed in the ''/content/'' folder. This folder is located in ''/opt/piratebox/share''. In fastcgi-php.conf, the thread limit is 1, if you run on a multiple core system you may want to increase it. | ||
| - | ====== Modifications for PirateBox 1.0 ====== | + | |
| ==== Change SSID ==== | ==== Change SSID ==== | ||
| Line 105: | Line 105: | ||
| /etc/init.d/cron enable && /etc/init.d/cron start | /etc/init.d/cron enable && /etc/init.d/cron start | ||
| - | |||
| - | ==== www offload ==== | ||
| - | This option is important for the OpenWRT users. You want a www folder on your USB stick? | ||
| - | Put your folder to | ||
| - | |||
| - | <usb device>/PirateBox/www_alt | ||
| - | |||
| - | Then install your box or run the following commands on your box | ||
| - | |||
| - | /etc/init.d/piratebox stop | ||
| - | /etc/init.d/piratebox updatePB | ||
| - | /etc/init.d/piratebox start | ||
| - | | ||
| - | The folder is recognized, if the following message apears: | ||
| - | <code> | ||
| - | ---------------------------------------------------- | ||
| - | #### Alternative www folder found #### | ||
| - | #### /mnt/usb/PirateBox/www_alt #### | ||
| - | #### switching directories #### | ||
| - | ---------------------------------------------------- | ||
| - | </code> | ||
| Line 139: | Line 118: | ||
| [[https://github.com/reinvented/openstreetbox|PirateBox + OpenStreetMap]] | [[https://github.com/reinvented/openstreetbox|PirateBox + OpenStreetMap]] | ||
| + | |||
| + | ==== PHP for PirateBox ==== | ||
| + | FIXME create an Laptop RPi version of this | ||
| + | |||
| + | FIXME php install routine | ||
| + | |||
| + | Then modify **/opt/piratebox/conf/lighttpd/lighttpd.conf**. Find this line | ||
| + | |||
| + | $HTTP["url"] =~ "^/cgi-bin/" { | ||
| + | cgi.assign = ( ".py" => "/usr/bin/python" ) | ||
| + | } | ||
| + | |||
| + | | ||
| + | Add below | ||
| + | |||
| + | $HTTP["url"] =~ "^/php/" { | ||
| + | cgi.assign = ( ".php" => "/usr/local/bin/php-cgi" ) | ||
| + | } | ||
| + | |||
| + | and find | ||
| + | |||
| + | static-file.exclude-extensions = ( ".php",".pl", ".fcgi" , ".cgi" , ".py" ) | ||
| + | |||
| + | change to | ||
| + | |||
| + | static-file.exclude-extensions = ( ".pl", ".fcgi" , ".cgi" , ".py" ) | ||
| + | |||
| + | Find in /etc/php.ini | ||
| + | |||
| + | doc_root = "/www" | ||
| + | |||
| + | and change it to | ||
| + | |||
| + | doc_root = "/opt/piratebox/www" | ||
| + | |||
| + | Now every create a folder called "php" to your /opt/piratebox/www/ | ||
| + | |||
| + | mkdir -p /opt/piratebox/www/php | ||
| + | chown -R nobody /opt/piratebox/www/php | ||
| + | | ||
| + | You can lay down you php files there or in subfolders now. You can lay down your php stuff on the USB-device and link to it. For example a link to my wiki located on the usb device: | ||
| + | |||
| + | ln -s /mnt/usb/PirateBox/wiki /opt/piratebox/www/php/wiki | ||