From 55c72bc2e90d2aee9b029930c56bfcd2a1463ee0 Mon Sep 17 00:00:00 2001 From: Britney Fransen Date: Fri, 30 Dec 2022 16:13:56 -0500 Subject: linhes-system: lighttpd addition --- linhes/linhes-system/PKGBUILD | 14 +- linhes/linhes-system/lh_lighttpd.conf | 270 ++++++++++++++++++++++++++++++++ linhes/linhes-system/lh_server.cnf | 47 ------ linhes/linhes-system/lh_sqlserver.cnf | 47 ++++++ linhes/linhes-system/lh_system_start.sh | 8 +- 5 files changed, 333 insertions(+), 53 deletions(-) create mode 100644 linhes/linhes-system/lh_lighttpd.conf delete mode 100644 linhes/linhes-system/lh_server.cnf create mode 100644 linhes/linhes-system/lh_sqlserver.cnf diff --git a/linhes/linhes-system/PKGBUILD b/linhes/linhes-system/PKGBUILD index c754b54..3d27a22 100755 --- a/linhes/linhes-system/PKGBUILD +++ b/linhes/linhes-system/PKGBUILD @@ -1,6 +1,6 @@ pkgname=linhes-system pkgver=9.0.0 -pkgrel=18 +pkgrel=20 arch=('x86_64') #install=$pkgname.install pkgdesc="Everything that makes LinHES a system" @@ -17,8 +17,8 @@ source=($binfiles 'myth_mtc.cron' 'paccache.cron' 'xfs_defrag.cron' 'readme_is_xml' 'add_storage.readme' '79-cronie.hook' 'fstrim.hook' 'openssh.hook' - '10-monitor.conf' 'x11vnc.override.conf' - 'system-sudo.rules' 'linhes-profile.sh' 'lh_server.cnf' + '10-monitor.conf' 'x11vnc.override.conf' 'lh_lighttpd.conf' + 'system-sudo.rules' 'linhes-profile.sh' 'lh_sqlserver.cnf' 'lh_system_start.sh.desktop') sha256sums=('7f91d2afcb76e8e9063c6bbe05f5c3d134a6f67541aead8894d342c32d34ad98' 'b0e8fe4d04e1f779d52a28156489fb51efc13e173efccba2d6d458044bf35904' @@ -27,7 +27,7 @@ sha256sums=('7f91d2afcb76e8e9063c6bbe05f5c3d134a6f67541aead8894d342c32d34ad98' '11168c9cd3b117decaab6bc665c183b4aab917cf0a976bce4c1b5e4686a27bc9' 'ae34515e144830f424d3bd3f6b1b446892d62beed20bca6f0fb19b0bbb779f27' '23358a7bff4968eccd469613b81b1415c2ae0ebe77f14f74426697333e4d88d7' - '918dda99d7d4045af4bc7f36d7bcf1af5be8d76af1bc0e1ab990957a8ea3606e' + '4100bf50d5e9d8cb7d44827395d7b8e0661af23759481536077824d10d6b005e' '6d4fb0ed1a5ed961b3a3884dce093118e50c2981a9cd5837d20abc5a6d4fd8aa' '87875d9e5f5ce18208f419698ce69b6bcbcd08955a57a4a13940e715af58b787' '91bdec992bb2c933e15625c181f2195c402060b879168ebf35944cb064c904b9' @@ -48,6 +48,7 @@ sha256sums=('7f91d2afcb76e8e9063c6bbe05f5c3d134a6f67541aead8894d342c32d34ad98' '890482242434e333024c7819e8bf3c889dc16548d0a1745479c8523930fb32f7' 'dead17906b33a7f9d66ad13bb1c083a23438f45ece9bd5ec41ff86eda01c132a' '2c9152ed542bb9c3aa516c6009125a757065100a060e0fa597243d4cbd92844f' + '2523c92128f52ad1e7fd291ddbfd3c0396f37115dabc5cf6828a0d21b99a667b' 'a9d0a94ff442453f0bec0b2e8afd591cf17b2845b6ae45ff300530114efd30af' '47ace62d7e7e651f25dc7c0a2e96d0862f5efe1a583eeda2843b1fc1499141fe' '4b89eb5aeb6ea8f0be5fd16cae3c2536114dfb0b594c64e9f44e7c2394079e7e' @@ -74,7 +75,10 @@ package() { install -Dm644 $srcdir/x11vnc.override.conf $pkgdir/etc/systemd/system/x11vnc.service.d/override.conf #sql files - install -Dm644 $srcdir/lh_server.cnf $pkgdir/etc/my.cnf.d/lh_server.cnf + install -Dm644 $srcdir/lh_sqlserver.cnf $pkgdir/etc/my.cnf.d/lh_sqlserver.cnf + + #lighttpd files + install -Dm644 $srcdir/lh_lighttpd.conf $pkgdir/etc/lighttpd/conf.d/lh_lighttpd.conf #readme files install -Dm644 $srcdir/readme_is_xml $pkgdir/etc/gen_is_xml.d/readme_is_xml diff --git a/linhes/linhes-system/lh_lighttpd.conf b/linhes/linhes-system/lh_lighttpd.conf new file mode 100644 index 0000000..d339a9b --- /dev/null +++ b/linhes/linhes-system/lh_lighttpd.conf @@ -0,0 +1,270 @@ +####################################################################### +# lighttpd configuration file +####################################################################### + +## modules to load +# at least mod_access and mod_accesslog should be loaded +# all other module should only be loaded if really neccesary +# - saves some time +# - saves memory +server.modules = ( + "mod_rewrite", +# "mod_redirect", + "mod_alias", + "mod_access", +# "mod_cml", +# "mod_trigger_b4_dl", + "mod_auth", + "mod_status", + "mod_setenv", + "mod_fastcgi", + "mod_proxy", +# "mod_simple_vhost", +# "mod_evhost", +# "mod_userdir", + "mod_cgi", +# "mod_compress", + "mod_ssi", +# "mod_usertrack", +# "mod_expire", +# "mod_secdownload", +# "mod_rrdtool", + "mod_accesslog" ) + +## a static document-root, for virtual-hosting take look at the +## server.virtual-* options +server.document-root = "/data/srv/httpd/htdocs" + +## where to send error-messages to +#server.errorlog = "/var/log/lighttpd/error.log" +#### accesslog module +#accesslog.filename = "/var/log/lighttpd/access.log" + +##send errors to syslog +server.errorlog-use-syslog = "enable" +$HTTP["url"] !~ "\.(jpe?g|png|gif|css)" { accesslog.use-syslog = "enable" } + +## File uploads +# Make sure this folder exists and is writable to server.username +# Add /data/storage/disk0/media/tmp/ for large file downloads in MythWeb +server.upload-dirs = ( "/var/tmp/", "/data/storage/disk0/media/tmp/" ) + +# files to check for if .../ is requested +index-file.names = ( "index.php", "index.html", + "index.htm", "default.htm" , "mythweb.php" ) + +## set the event-handler (read the performance section in the manual) +# server.event-handler = "freebsd-kqueue" # needed on OS X + +# mimetype mapping +mimetype.assign = ( +".pdf" => "application/pdf", +".sig" => "application/pgp-signature", +".spl" => "application/futuresplash", +".class" => "application/octet-stream", +".ps" => "application/postscript", +".torrent" => "application/x-bittorrent", +".dvi" => "application/x-dvi", +".gz" => "application/x-gzip", +".pac" => "application/x-ns-proxy-autoconfig", +".swf" => "application/x-shockwave-flash", +".tar.gz" => "application/x-tgz", +".tgz" => "application/x-tgz", +".tar" => "application/x-tar", +".zip" => "application/zip", +".mp3" => "audio/mpeg", +".m3u" => "audio/x-mpegurl", +".wma" => "audio/x-ms-wma", +".wax" => "audio/x-ms-wax", +".ogg" => "application/ogg", +".wav" => "audio/x-wav", +".gif" => "image/gif", +".jar" => "application/x-java-archive", +".jpg" => "image/jpeg", +".jpeg" => "image/jpeg", +".png" => "image/png", +".xbm" => "image/x-xbitmap", +".xpm" => "image/x-xpixmap", +".xwd" => "image/x-xwindowdump", +".css" => "text/css", +".html" => "text/html", +".shtml" => "text/html", +".htm" => "text/html", +".js" => "text/javascript", +".asc" => "text/plain", +".c" => "text/plain", +".cpp" => "text/plain", +".log" => "text/plain", +".conf" => "text/plain", +".text" => "text/plain", +".txt" => "text/plain", +".dtd" => "text/xml", +".xml" => "text/xml", +".mpeg" => "video/mpeg", +".mpg" => "video/mpeg", +".mp4" => "video/quicktime", +".mov" => "video/quicktime", +".qt" => "video/quicktime", +".avi" => "video/x-msvideo", +".asf" => "video/x-ms-asf", +".asx" => "video/x-ms-asf", +".wmv" => "video/x-ms-wmv", +".bz2" => "application/x-bzip", +".tbz" => "application/x-bzip-compressed-tar", +".tar.bz2" => "application/x-bzip-compressed-tar", +# default mime type +"" => "application/octet-stream", +) + +# Use the "Content-Type" extended attribute to obtain mime type if possible +#mimetype.use-xattr = "enable" + + +## send a different Server: header +## be nice and keep it at lighttpd +# server.tag = "lighttpd" + + +## deny access the file-extensions +# +# ~ is for backupfiles from vi, emacs, joe, ... +# .inc is often used for code includes which should in general not be part +# of the document-root +url.access-deny = ( "~", ".inc" ) + +$HTTP["url"] =~ "\.pdf$" { + server.range-requests = "disable" +} +ssi.extension = ( ".shtml" ) + +## +# which extensions should not be handle via static-file transfer +# +# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi +static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" ) + +######### Options that are good to be but not neccesary to be changed ####### + +## bind to port (default: 80) +#server.port = 81 + +## bind to localhost (default: all interfaces) +#server.bind = "127.0.0.1" + +## error-handler for status 404 +server.error-handler-404 = "/index.html" + +## to help the rc.scripts +server.pid-file = "/var/run/lighttpd/lighttpd.pid" + + +###### virtual hosts +## +## If you want name-based virtual hosting add the next three settings and load +## mod_simple_vhost +## +## document-root = +## virtual-server-root + virtual-server-default-host + virtual-server-docroot +## or +## virtual-server-root + http-host + virtual-server-docroot +## +#simple-vhost.server-root = "/srv/http/vhosts/" +#simple-vhost.default-host = "www.example.org" +#simple-vhost.document-root = "/htdocs/" + + +## +## Format: .html +## -> ..../status-404.html for 'File not found' +#server.errorfile-prefix = "/usr/share/lighttpd/errors/status-" +#server.errorfile-prefix = "/srv/http/errors/status-" + +## virtual directory listings +#dir-listing.activate = "enable" +## select encoding for directory listings +#dir-listing.encoding = "utf-8" + +## enable debugging +#debug.log-request-header = "enable" +#debug.log-response-header = "enable" +#debug.log-request-handling = "enable" +#debug.log-file-not-found = "enable" + +### only root can use these options +# +# chroot() to directory (default: no chroot() ) +#server.chroot = "/" + +## change uid to (default: don't care) +server.username = "http" + +## change uid to (default: don't care) +server.groupname = "http" + +#### compress module +#compress.cache-dir = "/var/cache/lighttpd/compress/" +#compress.filetype = ("text/plain", "text/html") + +#### proxy module +## read proxy.txt for more info +#proxy.server = ( ".php" => +# ( "localhost" => +# ( +# "host" => "192.168.0.101", +# "port" => 80 +# ) +# ) +# ) + +#### fastcgi module +## read fastcgi.txt for more info +## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini +fastcgi.server = ( + ".php" => (( + "bin-path" => "/usr/bin/php-cgi", + "socket" => "/var/run/lighttpd/mythtv-php-fcgi.socket", + "broken-scriptfilename" => "enable", + "bin-environment" => ( + "db_server" => "localhost", + "db_name" => "mythconverg", + "db_login" => "mythtv", + "db_password" => "mythtv" + ) + )) + ) + + setenv.add-environment = ( + "db_server" => "localhost", + "db_name" => "mythconverg", + "db_login" => "mythtv", + "db_password" => "mythtv" +) +#### CGI module +cgi.assign = ( ".pl" => "/usr/bin/perl", + ".cgi" => "/usr/bin/perl", + ".sh" => "/usr/bin/bash", + ".py" => "/usr/bin/python") + +alias.url += ( "/cgi-bin" => "/data/srv/httpd/cgi-bin/") + +$HTTP["url"] =~ "^/cgi-bin" { + cgi.assign = ( "" => "" ) + } + +#### url handling modules (rewrite, redirect, access) +#url.rewrite = ( "^/$" => "/server-status" ) +#url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" ) + +#### setenv +#setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" ) +#setenv.add-response-header = ( "X-Secret-Message" => "42" ) + +#### include +#include "/etc/lighttpd/auth-inc.conf" +## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf" +#include "lighttpd-inc.conf" + +#### include_shell +#include_shell "echo var.a=1" +## the above is same as: +#var.a=1 diff --git a/linhes/linhes-system/lh_server.cnf b/linhes/linhes-system/lh_server.cnf deleted file mode 100644 index 1850f8e..0000000 --- a/linhes/linhes-system/lh_server.cnf +++ /dev/null @@ -1,47 +0,0 @@ -# -# These groups are read by MariaDB server. -# Use it for options that only the server (but not clients) should see -# -# See the examples of server my.cnf files in /usr/share/mysql/ -# - -# this is read by the standalone daemon and embedded servers -[server] - -# this is only for the mysqld standalone daemon -[mysqld] - -# -# * Galera-related settings -# -[galera] -# Mandatory settings -#wsrep_on=ON -#wsrep_provider= -#wsrep_cluster_address= -#binlog_format=row -#default_storage_engine=InnoDB -#innodb_autoinc_lock_mode=2 -# -# Allow server to accept connections on all interfaces. -# -#bind-address=0.0.0.0 -# -# Optional setting -#wsrep_slave_threads=1 -#innodb_flush_log_at_trx_commit=0 - -# this is only for embedded server -[embedded] - -# This group is only read by MariaDB servers, not by MySQL. -# If you use the same .cnf file for MySQL and MariaDB, -# you can put MariaDB-only options here -[mariadb] -datadir=/data/srv/mysql - -# This group is only read by MariaDB-10.8 servers. -# If you use the same .cnf file for MariaDB of different versions, -# use this group for options that older servers don't understand -[mariadb-10.8] - diff --git a/linhes/linhes-system/lh_sqlserver.cnf b/linhes/linhes-system/lh_sqlserver.cnf new file mode 100644 index 0000000..1850f8e --- /dev/null +++ b/linhes/linhes-system/lh_sqlserver.cnf @@ -0,0 +1,47 @@ +# +# These groups are read by MariaDB server. +# Use it for options that only the server (but not clients) should see +# +# See the examples of server my.cnf files in /usr/share/mysql/ +# + +# this is read by the standalone daemon and embedded servers +[server] + +# this is only for the mysqld standalone daemon +[mysqld] + +# +# * Galera-related settings +# +[galera] +# Mandatory settings +#wsrep_on=ON +#wsrep_provider= +#wsrep_cluster_address= +#binlog_format=row +#default_storage_engine=InnoDB +#innodb_autoinc_lock_mode=2 +# +# Allow server to accept connections on all interfaces. +# +#bind-address=0.0.0.0 +# +# Optional setting +#wsrep_slave_threads=1 +#innodb_flush_log_at_trx_commit=0 + +# this is only for embedded server +[embedded] + +# This group is only read by MariaDB servers, not by MySQL. +# If you use the same .cnf file for MySQL and MariaDB, +# you can put MariaDB-only options here +[mariadb] +datadir=/data/srv/mysql + +# This group is only read by MariaDB-10.8 servers. +# If you use the same .cnf file for MariaDB of different versions, +# use this group for options that older servers don't understand +[mariadb-10.8] + diff --git a/linhes/linhes-system/lh_system_start.sh b/linhes/linhes-system/lh_system_start.sh index cd7ae8a..d44f33a 100755 --- a/linhes/linhes-system/lh_system_start.sh +++ b/linhes/linhes-system/lh_system_start.sh @@ -81,6 +81,12 @@ function sql_setup(){ sudo mariadb -u root mythconverg < /tmp/custom.sql.fixed } +function localweb_setup(){ + sudo pacman -Syyy --noconfirm linhes-web + sudo cp /usr/share/linhes/templates/lighttpd.conf.template /etc/lighttpd/lighttpd.conf + sudo systemctl enable --now lighttpd.service +} + function first_configure(){ if [ ! -f ~/.config/lh_configured ]; then #apply settings for all system types @@ -107,7 +113,7 @@ function first_configure(){ # run mythfilldatabase #nice -n 19 mythfilldatabase --quiet & #msg "Guide data is being loaded." "Until this completes some shows will appear as unknown in the program guide." - sudo systemctl enable --now lighttpd.service + localweb_setup else msg "Frontend Only" #Frontend_only cmds -- cgit v0.12