Commit 1f2cde21 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

1. cgi and fastcgi for lighttpd + php + python

parent 072dd78d
......@@ -4,15 +4,19 @@ IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMA
# remove not needed ipkg informations
IMAGE_INSTALL_append = " python-core \
htop \
i2c-tools \
mtd-utils \
ethtool \
openssh \
net-tools \
openssh \
nano \
lighttpd \
lighttpd-module-fastcgi \
lighttpd-module-cgi \
modphp \
apache2 \
php-cgi \
php-cli"
IMAGE_LINGUAS = " "
......
......@@ -26,7 +26,7 @@ server.modules = (
# "mod_simple_vhost",
# "mod_evhost",
# "mod_userdir",
# "mod_cgi",
"mod_cgi",
# "mod_compress",
# "mod_ssi",
# "mod_usertrack",
......@@ -38,7 +38,7 @@ server.modules = (
## a static document-root, for virtual-hosting take look at the
## server.virtual-* options
server.document-root = "/www/pages/"
server.document-root = "/www/pages"
## where to send error-messages to
server.errorlog = "/www/logs/lighttpd.error.log"
......@@ -135,12 +135,12 @@ $HTTP["url"] =~ "\.pdf$" {
# 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" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".py")
######### Options that are good to be but not neccesary to be changed #######
## bind to port (default: 80)
#server.port = 81
server.port = 80
## bind to localhost (default: all interfaces)
#server.bind = "grisu.home.kneschke.de"
......@@ -211,27 +211,29 @@ static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
#### 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" =>
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/tmp/php-fastcgi.socket",
"bin-path" => "/usr/local/bin/php"
"max-procs" => 4,
)
),
".py" =>
(
"python-fcgi" =>
(
"socket" => socket_dir + "fastcgi.python.socket",
"bin-path" => "test.py",
"check-local" => "disable",
"max-procs" => 4,
"bin-path" => "/usr/bin/php-cgi",
"max-procs" => 4
)
)
# ),
# "/test" =>
# (
# "python-fcgi" =>
# (
# "socket" => "/tmp/fastcgi.python.socket",
# "bin-path" => "/usr/bin/python",
# "check-local" => "disable",
# "max-procs" => 4
# )
# )
)
#### CGI module
cgi.assign = ( ".py" => "/usr/bin/python" )
#cgi.assign = ( ".pl" => "/usr/bin/perl",
# ".cgi" => "/usr/bin/perl" )
#
......
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI_append = "file://lighttpd.conf"
SRC_URI_append = "file://lighttpd.conf \
file://test.py"
CONFFILES_${PN} = "${D}/lighttpd.conf"
do_install_append() {
cp ${WORKDIR}/test.py ${D}/www/pages/test.py
}
......@@ -212,8 +212,8 @@ ServerName localhost:81
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/usr/share/apache2/htdocs"
<Directory "/usr/share/apache2/htdocs">
DocumentRoot "/www/pages/"
<Directory "/www/pages">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
......@@ -505,5 +505,8 @@ SSLRandomSeed connect builtin
IncludeOptional /etc/apache2/conf.d/*.conf
IncludeOptional /etc/apache2/modules.d/*.conf
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
PidFile /run/httpd.pid
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment