From 06c8c0ba0aadf73e8ed9d5c4ace5b52b974c3b50 Mon Sep 17 00:00:00 2001 From: 53hornet Date: Sun, 12 Sep 2021 17:34:00 -0400 Subject: feat: add php cgi --- Bastillefile | 16 +++++++++------- usr/local/etc/lighttpd/conf.d/cgi.conf | 2 ++ usr/local/etc/lighttpd/lighttpd.conf | 8 ++++---- var/cron/tabs/www | 1 - 4 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 usr/local/etc/lighttpd/conf.d/cgi.conf delete mode 100644 var/cron/tabs/www diff --git a/Bastillefile b/Bastillefile index 13ec2bd..ddba70d 100644 --- a/Bastillefile +++ b/Bastillefile @@ -1,10 +1,12 @@ -# Simple web server for my personal site pages -PKG lighttpd +# Simple web server for my web site + +# Prerequisites +PKG lighttpd php74 OVERLAY usr -OVERLAY var -CMD fetch -o /tmp http://192.168.1.50:3000/53hornet/53hor/archive/master.tar.gz -CMD tar -C /var -xvf /tmp/master.tar.gz --exclude drafts --exclude Makefile --exclude templates -CMD mv /tmp/master.tar.gz /tmp/master.tar.gz.bak +CMD mkdir -p /var/www +FSTAB /zroot/www/htdocs /var/www nullfs ro 0 0 + +# Start server SYSRC lighttpd_enable=YES -SERVICE lighttpd start +SERVICE lighttpd restart diff --git a/usr/local/etc/lighttpd/conf.d/cgi.conf b/usr/local/etc/lighttpd/conf.d/cgi.conf new file mode 100644 index 0000000..cee0470 --- /dev/null +++ b/usr/local/etc/lighttpd/conf.d/cgi.conf @@ -0,0 +1,2 @@ +server.modules += ( "mod_cgi" ) +cgi.assign = ( ".php" => "/usr/local/bin/php-cgi" ) diff --git a/usr/local/etc/lighttpd/lighttpd.conf b/usr/local/etc/lighttpd/lighttpd.conf index 658060a..c165e62 100644 --- a/usr/local/etc/lighttpd/lighttpd.conf +++ b/usr/local/etc/lighttpd/lighttpd.conf @@ -1,12 +1,12 @@ -## Note: use kqueue var.log_root = "/var/log/lighttpd" include "conf.d/access_log.conf" include "conf.d/dirlisting.conf" include "conf.d/mime.conf" -#include "modules.conf" -index-file.names += ("index.html") -server.document-root = "/var/53hor" +include "conf.d/cgi.conf" +index-file.names += ("index.php") +server.document-root = "/var/www" server.errorlog = log_root + "/error.log" +server.breakagelog = log_root + "/breakage.log" server.network-backend = "sendfile" server.port = 80 server.username = "www" diff --git a/var/cron/tabs/www b/var/cron/tabs/www deleted file mode 100644 index e436e15..0000000 --- a/var/cron/tabs/www +++ /dev/null @@ -1 +0,0 @@ -0 */6 * * * fetch -o /tmp -i /tmp/master.tar.gz.bak http://192.168.1.50:3000/53hornet/53hor/archive/master.tar.gz && tar -C /var -xf /tmp/master.tar.gz --exclude drafts --exclude Makefile --exclude templates && mv /tmp/master.tar.gz /tmp/master.tar.gz.bak -- cgit v1.2.3