国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統(tǒng) > CentOS > 正文

在CentOS系統(tǒng)中編譯安裝Hiawatha服務(wù)器的教程

2020-07-08 12:53:32
字體:
供稿:網(wǎng)友

Hiawatha 是一個Linux/UNIX下安全的Web服務(wù)器,其設(shè)計的最主要的目的就是安全,當(dāng)然它也是快速的而且易于配置。在安裝之后,確實發(fā)現(xiàn)他真的是輕量級的,安裝部署相當(dāng)?shù)目臁R韵率前惭b的過程:

第一步:下載編譯安裝cmake因為Hiawatha要求是cmake才能編譯,我的系統(tǒng)里沒有安裝,但是注意,這里的cmake是有版本要求的,至少是2.8.4以上的版本,索性我就安裝了最新的版本cmake 2.8.10.

   

復(fù)制代碼
代碼如下:
#wgethttp://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz</p><p> #tar xvf cmake-2.8.10.2.tar.gz</p><p> #cd cmake-2.8.10.2

本機上不存在cmake。則

   

復(fù)制代碼
代碼如下:
#./bootstrap</p><p> #make</p><p> #make install

    如果系統(tǒng)中已經(jīng)裝了低版本的cmake,輸入如下命令:

   

復(fù)制代碼
代碼如下:
#cmake</p><p> #make</p><p> #make install

第二步:下載Hiawatha(libxml2 and libxslt是hiavatha必須要求的,沒有的自行安裝,我已經(jīng)有了)


復(fù)制代碼
代碼如下:
#wget --no-check-certificate https://www.hiawatha-webserver.org/files/hiawatha-9.0.tar.gz //wget

可以下載http,https,ftp的鏈接,這里是https,所以我們設(shè)置為不檢查證書,直接下載,參考wget下載https鏈接(轉(zhuǎn))


復(fù)制代碼
代碼如下:
#tar -xzf hiawatha-9.0.tar.gz</p><p>#cd hiawatha-9.0</p><p>#mkdir build</p><p>#cd build</p><p>#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</p><p>#make</p><p>#make install</p><p>#hiawatha -k //檢測安裝是否成功,如果輸出以下提示,則表示安裝成功</p><p>Using
Reading hiawatha.conf
Configuration OK

注意:運行cmake時候如果出現(xiàn)


復(fù)制代碼
代碼如下:
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/usr/bin
CMake Error: Error executing cmake::LoadCache(). Aborting.

的錯誤提示,很大的可能不是你的cmake的設(shè)置有問題,輸入“echo $CMAKE_ROOT”,看返回時什么,如果沒有返回,或返回的不是你的cmake安裝的目錄,那么就肯定會出現(xiàn)這個錯誤,因為找不到 CMAKE_ROOT 這個變量值, 那我們就可以輸入以下命令,告訴系統(tǒng),cmake的安裝目錄是哪里,


復(fù)制代碼
代碼如下:
#export CMAKE_ROOT=/usr/local/bin/cmake

這個根據(jù)自身的安裝路徑設(shè)定,就可以解決這個錯誤了

有的可能在編譯的時候還出現(xiàn)下面的錯誤:


復(fù)制代碼
代碼如下:
bash: /usr/bin/cmake: No such file or directory</p><p>方法:這也是系統(tǒng)找不到cmake在哪,所以我們一樣要告訴系統(tǒng)


復(fù)制代碼
代碼如下:
#ln -s /usr/local/bin/cmake /usr/bin //做一個軟連接

如果上面都沒生效,你又記者用cmake編譯,最快的方法是用find命令,查看cmake的可執(zhí)行文件在哪里,然后直接用cmake可執(zhí)行文件的絕對路徑來編譯
如:
復(fù)制代碼
代碼如下:
find / -name "cmake"

顯示結(jié)果:
復(fù)制代碼
代碼如下:
/usr/local/bin/cmake

那么,你可以這樣編譯:

復(fù)制代碼
代碼如下:
/usr/local/bin/cmake
  后面加上你要編譯和源代碼路徑和編譯的參數(shù)
第三步:修改配置文件hiawatha.conf


復(fù)制代碼
代碼如下:
#vi /usr/local/etc/hiawatha/hiawatha.conf

我沒多大修改配置:


復(fù)制代碼
代碼如下:
# Hiawatha main configuration file
#</p><p># 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</p><p># 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
#}</p><p># BANNING SETTINGS
# Deny service to clients who misbehave.
#
BanOnGarbage = 300
BanOnMaxPerIP = 60
BanOnMaxReqSize = 300
KickOnBan = yes
RebanDuringBan = yes</p><p># 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</p><p>FastCGIserver {
FastCGIid = PHP5
ConnectTo = /var/lib/hiawatha/php-fcgi.sock //根據(jù)自己所在的位置填寫
Extension = php
}</p><p># URL TOOLKIT
# This URL toolkit rule was made for the Banshee PHP framework, which
# can be downloaded from http://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
#}</p><p># 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</p><p># 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
#}</p><p># DIRECTORY SETTINGS
# You can specify some settings per directory.
#
#Directory {
# Path = /home/baduser
# ExecuteCGI = no
# UploadSpeed = 10,2
#}

啟動命令:


復(fù)制代碼
代碼如下:
#/usr/local/sbin/hiawatha //根據(jù)自己的安裝目錄決定

關(guān)閉停止命令:


復(fù)制代碼
代碼如下:
#pgrep hiawatha //查看hiawatha的pid</p><p>#kill -15 pidnumber //pidnumber就是hiawatha的pid

 

以下是php-fpm.confg


復(fù)制代碼
代碼如下:
[www]</p><p> user = www</p><p> group = www</p><p> listen = /var/lib/hiawatha/php-fcgi.sock</p><p> pm = static</p><p> pm.max_children = 3</p><p> chdir = /

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 石阡县| 大余县| 石家庄市| 福安市| 乡宁县| 青龙| 上饶县| 高台县| 沙坪坝区| 长兴县| 个旧市| 古交市| 涟水县| 漳平市| 河间市| 含山县| 海门市| 高邮市| 宝应县| 长阳| 万州区| 兴宁市| 军事| 化德县| 漳平市| 耒阳市| 宣武区| 黄山市| 鄱阳县| 烟台市| 武冈市| 济阳县| 许昌县| 余庆县| 丁青县| 宜川县| 绥棱县| 琼中| 湟中县| 南召县| 潞城市|