关于web:Lighttpd-1453-移植指南openEuler-2003-LTS-SP1

5次阅读

共计 2451 个字符,预计需要花费 7 分钟才能阅读完成。

介绍

简要介绍

Lighttpd 是开源 Web 服务器软件,其基本的目标是提供一个专门针对高性能网站,平安、疾速、兼容性好并且灵便的 Web Server 环境。具备非常低的内存开销、CPU 占用率低、效力好以及丰盛的模块等特点。

Lighttpd 是泛滥 OpenSource 轻量级的 Web Server 中较为优良的一个。反对 FastCGI,CGI,Auth,输入压缩 (output compress),URL 重写,Alias 等重要性能;而 Apache 之所以风行,很大水平也是因为功能丰富,在 Lighttpd 上很多性能都有相应的实现了,这点对于 Apache 的用户是十分重要的,因为迁徙到 Lighttpd 就必须面对这些问题。

开发语言:C

一句话形容:Web 服务器

倡议的版本

倡议应用版本为“Lighttpd 1.4.53”。

环境要求

硬件要求

硬件要求如下所示。

我的项目 阐明
服务器 TaiShan 200 服务器(型号 2280)
CPU 鲲鹏 920 5250 处理器
磁盘分区 对磁盘分区无要求

操作系统要求

操作系统要求如下所示。

我的项目 版本
openEuler 20.03 sp1 aarch64
Kernel 4.19

阐明:

 如果是全新装置操作系统,装置形式倡议不要应用最小化装置,否则很多软件包须要手动装置,可抉择“Server with GUI”装置形式。

配置编译环境

  1. 装置依赖库

    yum -y install gcc gcc-c++ glib2-devel pcre-devel bzip2-devel zlib-devel gamin-devel

  2. 获取源码

    下载地址:https://download.lighttpd.net…

配置装置

cp lighttpd-1.4.53.tar.gz $HOME && cd $HOME
tar xzvf lighttpd-1.4.53.tar.gz

编译装置

cd lighttpd-1.4.53
./configure  --prefix=/usr/local/lighttpd  --with-fam
make -j60 && make install

阐明:

–prefix=PATH:指定 Lighttpd 的装置目录。
–with-fam:fam 用于缩小 stat() 函数调用次数。

参数配置

创立软件目录

cd /usr/local/lighttpd/
mkdir log webpages cache config

拷贝配置文件 / 目录

cp $HOME/lighttpd-1.4.53/doc/config/lighttpd.conf  /usr/local/lighttpd/config/
cp $HOME/lighttpd-1.4.53/doc/config/modules.conf   /usr/local/lighttpd/config/
cp $HOME/lighttpd-1.4.53/doc/config/conf.d         /usr/local/lighttpd/config/ -r

阐明:

Lighttpd 装置后的装置门路下只有三个文件夹 lib,sbin 和 share,其余文件须要本人拷贝和创立。

批改 lighttpd.conf

vi /usr/local/lighttpd/config/lighttpd.conf

批改第 16-20 行为:

var.log_root       =   "/usr/local/lighttpd/log"
var.server_root    =   "/usr/local/lighttpd"
var.state_dir      =   "/usr/local/lighttpd"
var.home_dir       =   "/usr/local/lighttpd"
var.conf_dir       =   "/usr/local/lighttpd/config"

批改第 61 行为:

var.cache_dir      =   "/usr/local/lighttpd/cache"

第 93 行加正文:

#server.use-ipv6 = "enable"

批改第 104-105 行(该项为操作权限,不倡议应用 root)为:

server.username  =  "lighttpd1"
server.groupname  =  "lighttpd"

批改第 115 行(拜访页面寄存门路)为:

server.document-root  =  server_root + "webpages"

批改第 246 行(缓存模式,默认为 simple,官网解释 fam 要优于 simple)为:

server.stat-cache-engine = "fam"

在第 182 行增加如下内容(该项为配置多过程模式,Lighttpd 默认单过程, 数值可依据理论需要批改):

server.max-worker = 4

创立用户组

groupadd  lighttpd
useradd -g lighttpd  lighttpd1

批改权限

chown lighttpd1  /usr/local/lighttpd/log

增加测试页面

cd /usr/local/lighttpd/webpages
vi index.html

    <html>
    <head>
    <title>lighttpd test</title>
    </head>
    <body>
    <p>this is a testing</p>
    </body>
    </html>

服务测试

启动 lighttpd:

/usr/local/lighttpd/sbin/lighttpd -f /usr/local/lighttpd/config/lighttpd.conf

查看程序过程:

ps -ef |grep lighttpd

进行 apache:

pkill lighttpd

测试网页:

http://{{server_ip}}:80/index.html

正文完
 0