<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    hello world

    隨筆 - 2, 文章 - 63, 評論 - 0, 引用 - 0
    數據加載中……

    開發板上搭建lighttpd環境

    要在開發板上搭建lighttpd環境,首先要在ubuntu上搭建交叉編譯環境,然后對lighttpd的源碼進行編譯,最后將編譯好的文件和配置文件拷貝到開發板上,就可以運行了。

    1、在ubuntu下搭建交叉編譯環境
         1) 將開發板提供的gcc拷貝到ubuntu環境下,如我本地拷貝完后的bin目錄為:
         /home/acer/source/arm-gcc/fsl-linaro-toolchain/bin/
         2) 配置ubuntu的環境變量文件:
          我的ubuntu版本是10.04,打開/etc/bash.bashrc文件,然后在文件末尾增加環境變量。

          網上通用配置都包括如下一句
          export PATH=/opt/liunx/arm-gcc/fsl-linaro-toolchain/bin:$PATH
          但是因為開發板不同,我的還要增加如下幾句:
           export ARCH=arm
           export CROSS_COMPILE=/home/acer/source/arm-gcc/fsl-linaro-toolchain/bin/arm-none-linux-gnueabi-
           配置完成后,保存文件

          3)重新加載環境變量:
           source /etc/bash.bashrc
         
          4)驗證交叉編譯環境,我的會輸出如下提示:
           acer@ace:~/lighttpd/lighttpd-1.4.18$ arm-linux-gcc -v
    Using built-in specs.
    COLLECT_GCC=arm-linux-gcc
    COLLECT_LTO_WRAPPER=/opt/liunx/arm-gcc/fsl-linaro-toolchain/bin/../libexec/gcc/arm-fsl-linux-gnueabi/4.6.2/lto-wrapper
    Target: arm-fsl-linux-gnueabi
    Configured with: /work/build/.build/src/gcc-linaro-4.6-2011.06-0/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-fsl-linux-gnueabi --prefix=/work/fsl-linaro-toolchain-2.13 --with-sysroot=/work/fsl-linaro-toolchain-2.13/arm-fsl-linux-gnueabi/multi-libs --enable-languages=c,c++ --with-pkgversion='Freescale MAD -- Linaro 2011.07 -- Built at 2011/08/10 09:20' --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --with-gmp=/work/build/.build/arm-fsl-linux-gnueabi/build/static --with-mpfr=/work/build/.build/arm-fsl-linux-gnueabi/build/static --with-mpc=/work/build/.build/arm-fsl-linux-gnueabi/build/static --with-ppl=/work/build/.build/arm-fsl-linux-gnueabi/build/static --with-cloog=/work/build/.build/arm-fsl-linux-gnueabi/build/static --with-libelf=/work/build/.build/arm-fsl-linux-gnueabi/build/static --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm -L/work/build/.build/arm-fsl-linux-gnueabi/build/static/lib -lpwl' --enable-threads=posix --enable-target-optspace --enable-plugin --enable-multilib --with-local-prefix=/work/fsl-linaro-toolchain-2.13/arm-fsl-linux-gnueabi/multi-libs --disable-nls --enable-c99 --enable-long-long --with-system-zlib
    Thread model: posix
    gcc version 4.6.2 20110630 (prerelease) (Freescale MAD -- Linaro 2011.07 -- Built at 2011/08/10 09:20)

    至此,交叉編譯環境搭建完畢

    2、ubuntu上編譯lighttpd
    我的lighttpd版本為1.4.18,可以自己去lighttpd官網上下載。

    1)配置configure命令
    首先進入lighttpd安裝文件夾下
    cd /home/acer/lighttpd/lighttpd1.4.18
    ./configure --prefix=/lighttpd --host=arm-linux --build=i486-linux-gnu --disable-FEATURE -disable-ipv6 -diable-lfs
    2)編譯
    make
    3)構建
    創建/lighttpd文件夾(同configure中的prefix跟的路徑),然后授權,最后在lighttpd的安裝文件夾下構建
    sudo mkdir /lighttpd
    sudo chmod 777 /lighttpd
    cd /home/acer/lighttpd/lighttpd1.4.18
    make install

    上述三步運行完之后,在/lighttpd下會生成lib、bin、sbin、share四個文件夾,這就是要拷貝到開發板上的文件。

    3、開發板,創建目錄,同時拷貝文件到開發板:
    1)創建根目錄/lighttpd(同編譯時configure命令中的prefix后跟的路徑),授予權限
    mkdir /lighttpd
    chmod 777 /lighttpd

    然后將ubuntu上/lighttpd中的四個文件夾lib、bin、sbin、share拷貝到開發板的/lighttpd下,具體什么方式,自己定吧,我們使用tftp考的的,在此不冗述。

    2)創建web根目錄/htdocs
    mkdir /htdocs
    chmod 777 /htdocs

    3)創建日志保存目錄/var/log/lighttpd
    mkdir /var/log/lighttpd
    chmod 777 /var/log/lighttpd

    4、配置并拷貝配置文件到開發板
    在ubuntu的lighttpd安裝文件中,找到lighttpd.config文件
    cd /home/acer/lighttpd/lighttpd1.4.18/doc
    打開lighttpd.config,作如下修改:
    server.document-root        = "/htdocs/"
    server.errorlog             = "/var/log/lighttpd/error.log"
    然后注釋掉:
    #$HTTP["url"] =~ "\.pdf$" {
    #  server.range-requests = "disable"
    #}
    保存后,將lighttpd.config拷貝到開發板的/etc/目錄下,至此,已經配置完成

    5、啟動lighttpd
    在開發板上運行:
    /lighttpd/sbin/lighttpd -f /etc/lighttpd.conf

    然后將一個.html文件放到/htdocs文件夾下,訪問web服務器試下吧!

    參考文件:
    http://www.linuxidc.com/Linux/2011-09/43619.htm
    http://www.linuxidc.com/Linux/2013-06/85902.htm
    http://blog.163.com/ljf_gzhu/blog/static/131553440201211522317367/

    posted on 2015-03-19 11:08 聽風 閱讀(814) 評論(0)  編輯  收藏 所屬分類: 嵌入式

    主站蜘蛛池模板: 在线观看成人免费视频不卡| 中文在线观看免费网站| 亚洲视频在线观看免费视频| 亚洲AV无码一区东京热久久| 花蝴蝶免费视频在线观看高清版| 国产aⅴ无码专区亚洲av麻豆| 一边摸一边桶一边脱免费视频| 波多野结衣一区二区免费视频| 亚洲国产成人AV网站| 国产禁女女网站免费看| 免费大片黄在线观看| 亚洲免费日韩无码系列| 国产精品免费久久久久久久久 | 在线永久免费的视频草莓| 中文字幕亚洲第一在线| 免费观看激色视频网站bd| 中国china体内裑精亚洲日本| 热99re久久免费视精品频软件| 337P日本欧洲亚洲大胆精品| 国产偷国产偷亚洲高清日韩| 日本三级在线观看免费| 亚洲成人免费电影| 全免费a级毛片免费看无码| 成人a毛片视频免费看| 亚洲AV电影院在线观看| 18禁男女爽爽爽午夜网站免费| 亚洲午夜理论片在线观看| 一本色道久久88亚洲综合| 国产一区二区免费| 亚洲中文字幕无码一去台湾| 尤物永久免费AV无码网站| 国产日韩在线视频免费播放| 噜噜噜亚洲色成人网站∨| 成年女人毛片免费视频| 男女一进一出抽搐免费视频| 亚洲综合婷婷久久| 手机看片久久国产免费| 久久久国产精品福利免费| 亚洲永久网址在线观看| 亚洲日韩激情无码一区| 国产啪精品视频网免费|