# yum groupinstall "Network file system client"
# yum install nfs-utils nfs4-acl-tools
# chkconfig rpcbind on # chkconfig rpcidmapd on # chkconfig nfslock on
# vi /etc/idmapd.conf
Domain = cyberciti.biz [Mapping] Nobody-User = nobody Nobody-Group = nobody
# /sbin/service rpcbind start # /sbin/service rpcidmapd start # /sbin/service nfslock start
# /usr/sbin/groupadd -g 48 apache # /usr/sbin/useradd -s /sbin/nologin -g 48 -u 48 -M -d /var/www apache # /usr/bin/passwd -l apache
# showmout -e vm05
Export list for v.txvip1: /exports/html 192.168.1.10,192.168.1.11 /exports/static 192.168.1.10,192.168.1.11
# mkdir /var/www/static # /bin/mount -t nfs4 -orsize=32768,wsize=32768,intr,hard,proto=tcp,sync vm05:/exports/static /var/www/static/
# vi /etc/fstab
# vi /etc/fstab
vm05:/exports/static /var/www/static nfs4 orsize=32768,wsize=32768,intr,hard,proto=tcp,sync
# chkconfig netfs on
# su - apache $ ls /var/www/static/ $ exit #
# yum install lighttpd
Loaded plugins: rhnplugin Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package lighttpd.x86_64 0:1.4.28-3.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ========================================================================== Package Arch Version Repository Size ========================================================================== Installing: lighttpd x86_64 1.4.28-3.el6 epel 328 k Transaction Summary ========================================================================== Install 1 Package(s) Total download size: 328 k Installed size: 878 k Is this ok [y/N]: y Downloading Packages: lighttpd-1.4.28-3.el6.x86_64.rpm | 328 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : lighttpd-1.4.28-3.el6.x86_64 1/1 Installed: lighttpd.x86_64 0:1.4.28-3.el6 Complete!
# mv /etc/lighttpd/lighttpd.{conf,default.bak}<br /> # vi /etc/lighttpd/lighttpd.conf
## http://static.cyberciti.biz server.modules = ( "mod_expire", "mod_access", "mod_accesslog", "mod_setenv", "mod_extforward" ) server.errorlog = "/var/log/lighttpd/error.log" accesslog.filename = "/var/log/lighttpd/access.log" index-file.names = ( "index.html", "index.htm", "default.htm" ) server.tag = "lighttpd" server.network-backend = "linux-sendfile" ## lan- ## server.port = "80" server.bind = "192.168.1.10" server.document-root = "/var/www/static" server.pid-file = "/var/run/lighttpd.pid" server.username = "apache" server.groupname = "apache" ## 30 ## $HTTP["url"] =~ "^/" { expire.url = ( "" => "access 30 days" ) } ### ip- ### ### 192.168.1.{1,2} == nginx resverse proxy server ## extforward.headers = ("X-Forwarded-For") extforward.forwarder = ( "192.168.1.1" => "trust", "192.168.1.2" => "trust" ) ## ## mimetype mapping ## include "conf.d/mime.conf"
## ## -A INPUT -m state --state NEW -p tcp -s 192.168.1.0/24 --dport 80 -j ACCEPT
# /sbin/service iptables restart # /sbin/iptables -L -v -n
# chkconfig lighttpd on # service lighttpd start
http://192.168.1.10/
Source: https://habr.com/ru/post/148490/
All Articles