Linux下安装hiawatha轻服务器

2020年01月21日

hiawatha又叫海华沙,是一款轻服务器环境,
hiawatha官网下载地址:https://www.hiawatha-webserver.org/download
如果系统上安装的CMake版本低于3.0,请将其删除,从https://CMake.org/download/#latest下载最新版本并安装。先安装cmake

yum install libxml2 libxsl -y
tar -xzf cmake-.tar.gz
cd cmake-
./configure
make install

 

Install hiawatha

wget https://www.hiawatha-webserver.org/files/hiawatha-10.10.tar.gz
tar zxvf hiawatha-10.10.tar.gz
cd hiawatha-10.10
mkdir build
cd build
cmake .. -DENABLE_CACHE=ON -DENABLE_DEBUG=off -DENABLE_IPV6=off -DENABLE_MONITOR=off -DENABLE_RPROXY=ON -DENABLE_SSL=ON -DENABLE_TOMAHAWK=off -DENABLE_TOOLKIT=ON -DENABLE_XSLT=off
make && make install
hiawatha -k //检测安装是否成功,如果输出以下提示,则表示安装成功
Reading hiawatha.conf
Configuration OK

 

Installation
============
If the CMake version installed on your system is lower than 3.0, remove it, download the latest version from https://cmake.org/download/#latest and install it.

	tar -xzf cmake-.tar.gz
	cd cmake-
	./configure
	sudo make install

Use the following commands to compile and install Hiawatha. This will install Hiawatha in /usr/local.

	mkdir build
	cd build
	cmake .. [options]
	sudo make install/strip

The following options for cmake are available. Default value is in uppercase.

	-DENABLE_CACHE=ON|off              Enable internal cache support.
	-DENABLE_MONITOR=on|OFF            Enable support for the Hiawatha Monitor.
	-DENABLE_RPROXY=ON|off             Enable reverse proxy support.
	-DENABLE_TLS=ON|off                Enable TLS (mbed TLS) support.
	-DENABLE_TOMAHAWK=on|OFF           Enable Tomahawk, the Hiawatha command shell.
	-DENABLE_TOOLKIT=ON|off            Enable the URL Toolkit.
	-DENABLE_XSLT=ON|off               Enable XSLT support.
	-DUSE_SYSTEM_MBEDTLS=on|OFF        Compile Hiawatha against the system's mbed TLS library (>=2.0.0).

The following path settings are available for cmake.

	-DCMAKE_INSTALL_PREFIX=      The prefix for all other CMAKE_INSTALL directories.
	-DCMAKE_INSTALL_BINDIR=      Location of the ssi-cgi binary.
	-DCMAKE_INSTALL_SBINDIR=     Location of the other Hiawatha binaries.
	-DCMAKE_INSTALL_SYSCONFDIR=  The configuration files will be installed in /hiawatha.
	-DCMAKE_INSTALL_LIBDIR=      The mbed TLS shared library will be installed in /hiawatha.
	-DCMAKE_INSTALL_MANDIR=      Manual pages will be installed in /man1.
	-DCONFIG_DIR=                Location of the Hiawatha configuration files.
	-DLOG_DIR=                   Log directory used in the default hiawatha.conf.
	-DPID_DIR=                   Location of the Hiawatha PID file.
	-DWEBROOT_DIR=               Webroot directory used in the default hiawatha.conf.
	-DWORK_DIR=                  Path of directory where Hiawatha can write temporary files.

Look inside the directory 'extra' for scripts to build packages for Debian, Red Hat, MacOS X and Windows (via Cygwin).

 

Configuration hiawatha

vi /usr/local/etc/hiawatha/hiawatha.conf

 

# Hiawatha main configuration file
# 

# GENERAL SETTINGS # ServerId = www:www ConnectionsTotal = 250 ConnectionsPerIP = 25 SystemLogfile = /usr/local/var/log/hiawatha/system.log GarbageLogfile = /usr/local/var/log/hiawatha/garbage.log

# BINDING SETTINGS # A binding is where a client can connect to. # Binding { Port = 80 # Interface = 127.0.0.1 # MaxKeepAlive = 30 # TimeForRequest = 3,20 } # #Binding { # Port = 443 # Interface = ::1 # MaxKeepAlive = 30 # TimeForRequest = 3,20 # SSLcertFile = hiawatha.pem #}

# BANNING SETTINGS # Deny service to clients who misbehave. # BanOnGarbage = 300 BanOnMaxPerIP = 60 BanOnMaxReqSize = 300 KickOnBan = yes RebanDuringBan = yes

# COMMON GATEWAY INTERFACE (CGI) SETTINGS # These settings can be used to run CGI applications. # #CGIhandler = /usr/bin/perl:pl #CGIhandler = /usr/local/php/bin/php-cgi:php #CGIhandler = /usr/bin/python:py #CGIhandler = /usr/bin/ruby:rb #CGIhandler = /usr/bin/ssi-cgi:shtml #CGIextension = cgi

FastCGIserver { FastCGIid = PHP5 ConnectTo = /var/lib/hiawatha/php-fcgi.sock //根据自己所在的位置填写 Extension = php }

# URL TOOLKIT # This URL toolkit rule was made for the Banshee PHP framework, which # can be downloaded from https://www.hiawatha-webserver.org/banshee # #UrlToolkit { # ToolkitID = banshee # RequestURI isfile Return # Match ^/(css|files|images|js|slimstat)($|/) Return # Match ^/(favicon.ico|robots.txt|sitemap.xml)$ Return # Match .*\?(.*) Rewrite /index.php?$1 # Match .* Rewrite /index.php #}

# DEFAULT WEBSITE # It is wise to use your IP address as the hostname of the default website # and give it a blank webpage. By doing so, automated webscanners won't find # your possible vulnerable website. # Hostname = 127.0.0.1 WebsiteRoot = /home/wwwroot StartFile = index.html AccessLogfile = /usr/local/var/log/hiawatha/access.log ErrorLogfile = /usr/local/var/log/hiawatha/error.log ErrorHandler = 404:/error.cgi

# VIRTUAL HOSTS # Use a VirtualHost section to declare the websites you want to host. # #VirtualHost { # Hostname = 127.0.0.1 # WebsiteRoot = /home/wwwroot # StartFile = index.php # AccessLogfile = /var/www/my-domain/log/access.log # ErrorLogfile = /var/www/my-domain/log/error.log # TimeForCGI = 5 # UseFastCGI = PHP5 # UseToolkit = banshee #}

# DIRECTORY SETTINGS # You can specify some settings per directory. # #Directory { # Path = /home/baduser # ExecuteCGI = no # UploadSpeed = 10,2 #}

 


sicnature ---------------------------------------------------------------------
I P 地 址: 3.146.105.137
区 域 位 置: 美国
系 统 信 息: 美国
Original content, please indicate the source:
同福客栈论坛 | 蟒蛇科普海南乡情论坛 | JiaYu Blog
sicnature ---------------------------------------------------------------------
Welcome to reprint. Please indicate the source https://myzhenai.com/post/3113.html

没有评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注