gcc版本:
Using built-in specs.
Target: mipsel-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.5-8' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --disable-libssp --enable-targets=all --enable-checking=release --build=mipsel-linux-gnu --host=mipsel-linux-gnu --target=mipsel-linux-gnu
Thread model: posix
gcc version 4.4.5 (Debian 4.4.5-8)
lighttpd版本:
lighttpd-1.4.15 - a light and fast webserver
Build-Date: Oct 16 2019 23:14:14
下载地址:http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.15.tar.gz
一、编译准备
1、解压
tar -zxvf lighttpd-1.4.15.tar.gz
2、进入源文件
cd lighttpd-1.4.15/src
3、更改server.c文件内第711行
vim server.c
:set nu //显示行号
:711 //跳转到711行
注释 /*return -1;*/ 否则编译后报:(server.c.709) I will not set uid to 0 并且结束程序,使之不能运行。
二、编译
cd lighttpd-1.4.15
./configure
make
make install
如果安装成功,在命令行内输入 lighttpd -v则显示如下:
lighttpd-1.4.15 - a light and fast webserver
三、建立配置文件
vim /etc/lighttpd.conf
在该文件内粘贴如下内容:
server.document-root = "/var/www"
server.port = 80
server.username = "root"
mimetype.assign = (
".html" => "text/html; charset=utf-8",
".htm" => "text/html; charset=utf-8",
".css" => "text/css; charset=utf-8",
".js" => "text/javascript; charset=utf-8",
".txt" => "text/plain; charset=utf-8",
".jpg" => "image/jpeg",
".png" => "image/png",
"" => "application/octet-stream"
)
index-file.names = ( "index.html" )
四、建立测试网页文件
vim /var/www/index.html
在该文件内粘贴如下内容:
<html><body><h1>It works!</h1>
<p>Lighttpd start success!</p>
</body></html>
五、启动并校验
lighttpd -f /etc/lighttpd.conf
在windows或其它平台的网页浏览器中输入 http://你的龙芯2f的IP/
浏览器显示如下:
It works!
Lighttpd start success!