敬告遊客:
以下內容枯燥無聊,若情非得已不建議進入。
若仍執意進入,當有頭暈嘔吐現象時請盡速離開本篇文章。
(1).need pcre to support lighttpd
1-a.use yum to install pcre if computer can access network
#yum install pcre
1-b.if computer can not access Internet,
download pcre package
download page:http://www.pcre.org/
#tar -zxvf pcre-7.7.tar.gz
#cd pcre-7.7
#./configure
#make
#make install
(2)install lighttpd-1.4.23
1.download lighttpd
download page:http://www.lighttpd.net/download
#./configure --prefix=/usr/local/lighttpd
#make
#make install
#mkdir conf
#cp /home/claire/lighttpd-1.4.23/doc/lighttpd.conf /usr/local/lighttpd/conf/
#vi /usr/local/lighttpd/conf/lighttpd.conf
server.document-root = "/home/claire/lighttpd-1.4.23/htdocs/" //the path of index.html
server.errorlog = "/home/claire/lighttpd-1.4.23/log/error.log"
accesslog.filename = "/home/claire/lighttpd-1.4.23/log/access.log"
2.run lighttpd
#cd /usr/local/lighttpd
#sbin/lighttpd -D -f conf/lighttpd.conf &
3.check lighttpd process is running
#ps -ef | grep light
#input url:httpl://172.19.67.157
the index.html should be displayed on browser.
(3)install fastcgi-2.4.0
1.download fcgi
download page:http://www.fastcgi.com/dist/
#tar -zxvf fcgi-2.4.0.tar.gz
#cd fcgi-2.4.0
#./configure --prefix=/usr/local
#make
#make install
2.run fcgi
#cd /usr/local/bin
#cgi-fcgi
displays the cgi-fcgi usage, it means the fcgi install successfully.
3.error log
fcgio.cpp: In destructor 'virtual fcgi_streambuf::~fcgi_streambuf()': fcgio.cpp:50: error: 'EOF' was not declared in this scope fcgio.cpp: In member function 'virtual int fcgi_streambuf::overflow(int)': fcgio.cpp:70: error: 'EOF' was not declared in this scope fcgio.cpp:75: error: 'EOF' was not declared in this scope fcgio.cpp: In member function 'virtual int fcgi_streambuf::sync()': fcgio.cpp:86: error: 'EOF' was not declared in this scope fcgio.cpp:87: error: 'EOF' was not declared in this scope fcgio.cpp: In member function 'virtual int fcgi_streambuf::underflow()': fcgio.cpp:107: error: 'EOF' was not declared in this scope |
reference:http://bugs.gentoo.org/show_bug.cgi?id=256654
solution:add #include <cstdio>
in fcgi-2.4.0/libfcgi/fcgio.cpp $HTTP["host"] == ".fcgi" {
(4)lighttpd+fastcgi
1.copy fcgi into lighttpd
#cd /home/claire/fcgi-2.4.0/examples
#cp -rf .libs /home/claire/lighttpd-1.4.23/htdocs/
#cp echo /home/claire/lighttpd-1.4.23/htdocs/echo.fcgi
2.start up lighttpd
#vi /usr/local/lighttpd/conf/lighttpd.conf
unmark "mod_auth" and "mod_fastcgi"
fastcgi.server = ( ".fcgi" =>
( "127.0.0.1" =>
(
"host" => "172.19.67.157",
"port" => 1026,
"check-local" => "disable"
# "bin-path" => "/usr/bin/php-cgi"
# "bin-path" => "/usr/local/bin/cgi-fcgi -bind -connect 127.0.0.1:1026"
# "bin-path" => "./htdocs/examples/echo.fcgi"
)
)
)
alias.url = ( "/fcgi-bin" => "/home/claire/lighttpd-1.4.23/htdocs/" )
}
#cd /usr/local/lighttpd/
#sbin/lighttpd -D -f conf/lighttpd.conf &
#ps -ef | grep light
root 13912 16970 0 13:32 pts/1 00:00:00 sbin/lighttpd -D -f conf/lighttpd.conf |
3.connect fcgi eith lighttpd
#cgi-fcgi -start -connect 172.19.67.157:1026 htdocs/echo.fcgi
#ps -ef | grep echo
root 15494 1 0 15:26 pts/1 00:00:00 lt-echo |
4.input url: http://172.19.67.157/echo.fcgi
the browser displays the echo page.