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

1. cgi and fastcgi for lighttpd + php + python

parent 072dd78d
...@@ -4,16 +4,20 @@ IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMA ...@@ -4,16 +4,20 @@ IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMA
# remove not needed ipkg informations # remove not needed ipkg informations
IMAGE_INSTALL_append = " python-core \ IMAGE_INSTALL_append = " python-core \
i2c-tools \ htop \
mtd-utils \ i2c-tools \
ethtool \ mtd-utils \
openssh \ ethtool \
net-tools \ net-tools \
lighttpd \ openssh \
lighttpd-module-fastcgi \ nano \
modphp \ lighttpd \
apache2 \ lighttpd-module-fastcgi \
php-cli" lighttpd-module-cgi \
modphp \
apache2 \
php-cgi \
php-cli"
IMAGE_LINGUAS = " " IMAGE_LINGUAS = " "
......
...@@ -26,7 +26,7 @@ server.modules = ( ...@@ -26,7 +26,7 @@ server.modules = (
# "mod_simple_vhost", # "mod_simple_vhost",
# "mod_evhost", # "mod_evhost",
# "mod_userdir", # "mod_userdir",
# "mod_cgi", "mod_cgi",
# "mod_compress", # "mod_compress",
# "mod_ssi", # "mod_ssi",
# "mod_usertrack", # "mod_usertrack",
...@@ -38,7 +38,7 @@ server.modules = ( ...@@ -38,7 +38,7 @@ server.modules = (
## a static document-root, for virtual-hosting take look at the ## a static document-root, for virtual-hosting take look at the
## server.virtual-* options ## server.virtual-* options
server.document-root = "/www/pages/" server.document-root = "/www/pages"
## where to send error-messages to ## where to send error-messages to
server.errorlog = "/www/logs/lighttpd.error.log" server.errorlog = "/www/logs/lighttpd.error.log"
...@@ -135,12 +135,12 @@ $HTTP["url"] =~ "\.pdf$" { ...@@ -135,12 +135,12 @@ $HTTP["url"] =~ "\.pdf$" {
# which extensions should not be handle via static-file transfer # which extensions should not be handle via static-file transfer
# #
# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi # .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 ####### ######### Options that are good to be but not neccesary to be changed #######
## bind to port (default: 80) ## bind to port (default: 80)
#server.port = 81 server.port = 80
## bind to localhost (default: all interfaces) ## bind to localhost (default: all interfaces)
#server.bind = "grisu.home.kneschke.de" #server.bind = "grisu.home.kneschke.de"
...@@ -211,27 +211,29 @@ static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" ) ...@@ -211,27 +211,29 @@ static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
#### fastcgi module #### fastcgi module
## read fastcgi.txt for more info ## read fastcgi.txt for more info
## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini ## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini
fastcgi.server = ( ".php" => fastcgi.server = ( ".php" =>
( "localhost" => ( "localhost" =>
(
"socket" => "/tmp/php-fastcgi.socket",
"bin-path" => "/usr/local/bin/php"
"max-procs" => 4,
)
),
".py" =>
(
"python-fcgi" =>
( (
"socket" => socket_dir + "fastcgi.python.socket", "socket" => "/tmp/php-fastcgi.socket",
"bin-path" => "test.py", "bin-path" => "/usr/bin/php-cgi",
"check-local" => "disable", "max-procs" => 4
"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 module
cgi.assign = ( ".py" => "/usr/bin/python" )
#cgi.assign = ( ".pl" => "/usr/bin/perl", #cgi.assign = ( ".pl" => "/usr/bin/perl",
# ".cgi" => "/usr/bin/perl" ) # ".cgi" => "/usr/bin/perl" )
# #
......
FILESEXTRAPATHS_prepend := "${THISDIR}/files:" FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI_append = "file://lighttpd.conf" SRC_URI_append = "file://lighttpd.conf \
file://test.py"
CONFFILES_${PN} = "${D}/lighttpd.conf" CONFFILES_${PN} = "${D}/lighttpd.conf"
do_install_append() {
cp ${WORKDIR}/test.py ${D}/www/pages/test.py
}
...@@ -212,8 +212,8 @@ ServerName localhost:81 ...@@ -212,8 +212,8 @@ ServerName localhost:81
# documents. By default, all requests are taken from this directory, but # documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations. # symbolic links and aliases may be used to point to other locations.
# #
DocumentRoot "/usr/share/apache2/htdocs" DocumentRoot "/www/pages/"
<Directory "/usr/share/apache2/htdocs"> <Directory "/www/pages">
# #
# Possible values for the Options directive are "None", "All", # Possible values for the Options directive are "None", "All",
# or any combination of: # or any combination of:
...@@ -505,5 +505,8 @@ SSLRandomSeed connect builtin ...@@ -505,5 +505,8 @@ SSLRandomSeed connect builtin
IncludeOptional /etc/apache2/conf.d/*.conf IncludeOptional /etc/apache2/conf.d/*.conf
IncludeOptional /etc/apache2/modules.d/*.conf IncludeOptional /etc/apache2/modules.d/*.conf
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
PidFile /run/httpd.pid 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