Lighttpd
sudo apt-get install lighttpd #安装lighttpd安装后系统会自动启动lighttpd,打开http://localhost 便是,如果你之前有装Apache,那默认主页换成 http://localhost/index.lighttpd.html 。
web服务器的根目录是在 /var/www/ ,图片目录是:/usr/share/images/,配置文件是在/etc/lighttpd/lighttpd.conf。
重启lighttpd的命令
sudo /etc/init.d/lighttpd restart
|
启用用户目录后,每个用户的home目录便有自个的web目录。命令:
sudo lighttpd-enable-mod userdir
重新载入配置
sudo service lighttpd reload
现在用户可以放置文件到home目录下的public_html文件夹内。比如qii用户需要放置文件到/home/joe/public_html,打开 http://loaclhost/~qii
Save this "Hello world !" source code example in /var/www/cgi-bin (create this directory if it not exists).
#include "stdio.h" int main(void) { printf( "Content-Type: text/plain\n\n" ); printf("Hello world !\n"); return 0; }
Compile it typing:
debarm:~# gcc hello.c -o hello.cgi
Change the server.modules list inside /etc/lighttpd/lighttpd.conf in:
server.modules = ( "mod_access", "mod_cgi", "mod_alias", "mod_accesslog", "mod_compress", )
and add these lines:
$HTTP["url"] =~ "/cgi-bin/" { cgi.assign = ( "" => "" ) } cgi.assign = ( ".cgi" => "" )
Restart lighttpd typing:
debarm:~# /etc/init.d/lighttpd restart
Access with your browser to the FOX Board web page using this URL:
http:///cgi-bin/hello.cgi