Make a picture server with LIGHTTPD

Source: Internet
Author: User

Http://www.lsanotes.cn/install_lighttpd

Make a picture server with LIGHTTPD

A Install the required library files for LIGHTTPD
1. Installing Pcre
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.10.tar.gz

TAR-ZXVF pcre-8.10.tar.gzcd Pcre-8.10./configuremakemake Install

2. Installing zlib
wget http://zlib.net/zlib-1.2.5.tar.gz

TAR-ZXVF zlib-1.2.5.tar.gzcd Zlib-1.2.5./configuremakemake Install

3. Installing bzip2
wget http://www.bzip.org/1.0.5/bzip2-1.0.5.tar.gz

CD Bzip2-1.0.5makemake Install

Two. Installing LIGHTTPD
1. Download lighttpd
wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.28.tar.gz
2. Compiling the installation

TAR-ZXVF lighttpd-1.4.28.tar.gzcd lighttpd-1.4.28groupadd lighttpduseradd–g lighttpd lighttpd./configure--prefix=/ Usr/local/lighttpdmakemake Install

Precautions
If make has an error similar to the following

/usr/local/lib/libbz2.a:could not read Symbols:bad value

You need to reinstall BZIP2, modify the bzip2 makefile file
Vim Makefile

Cflags=-wall-winline-o2-g $ (bigfiles) #找到此行添加-fpic, as follows: Cflags=-wall-winline-o2-g $ (bigfiles)-fpic

Then recompile bzip and LIGHTTPD
3. Change the configuration file

Cp-r doc/config/usr/local/lighttpd/mkdir-p/var/log/lighttpdchown-r lighttpd.lighttpd/var/log/lighttpdmkdir–p/usr /www/htdocschown–r Lighttpd.lighttpd/usr/www/htdocs

4. Configuration file contents:
vim/usr/local/lighttpd/config/lighttpd.conf

var.log_root    = "/var/log/lighttpd" var.server_root = "/usr/www" var.state_dir   = "/var/ Run "var.home_dir    ="/usr/local/lighttpd/sbin/lighttpd "var.conf_dir    ="/usr/ Local/lighttpd/config " var.vhosts_dir  = server_root +"/vhosts "var.cache_dir   ="/var/cache/ Lighttpd "var.socket_dir  = Home_dir +"/sockets " include" modules.conf "Server.port = 80  server.username  = "lighttpd" server.groupname = "lighttpd"  server.document-root = server_root + "/htdocs" Server.pid-file = State_dir + "/lighttpd.pid" server.errorlog              = Log_root + "/error.log"  include "conf.d/access_log.conf" include "conf.d/debug.conf"   Server.event-handler = "Linux-sysepoll" server.network-backend = "linux-sendfile" Server.max-fds = 2048server.stat-cache-engine = "simple" server.max-connections = 1024 index-file.names + = ("index.xhtml", "index. html "," index.htm "," default.htm "," index.php ")  url.access-deny              = ("~", ". Inc")   $HTTP ["url"] =~ "\.pdf$" {server.range-requests = "Disable"}  Static-file.exclude-extensions = (". php", ". Pl", ". fcgi", ". scgi")  include "conf.d/mime.conf" include "conf.d/ dirlisting.conf "Server.follow-symlink =" Enable "Server.upload-dirs = ("/var/tmp ")

The pictures are stored under the/usr/www/htdocs, and the resulting images are stored in the form of/year/month/day.

Three. Start lighttpd

/usr/local/lighttpd/sbin/lighttpd-f/usr/local/lighttpd/config/lighttpd
«nginx+keepalived do dual-machine hot standby and Tomcat load BalancingAnalysis of Nginx access log IP address source with shell script »

Make a picture server with LIGHTTPD

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.