How to Install Lighttpd Web-server in OpenSUSE

To Install Lighttpd Web-server in OpenSUSE

In this tutorial we will learn how to install Lighttpd in OpenSuse is explained. Lighttpd is an open-source server, which acts as an alternative to Apache. It is highly secure and especially built for high-performance environments.

Features

  • Load balancing FastCGI, SCGI and HTTP proxy support
  • Supports Chroot.
  • Rule-based downloading with possibility of a script handling only authentication.
  • Web server event mechanism performance &ndash select(), poll(), and epoll()
  • Supports event notification schemes like kqueue and epoll
  • Conditional URL rewriting.
  • TLS/SSL with SNI support, via OpenSSL.
  • Authentication against LDAP server
  • RRDtool statistics
  • Server Side Includes support
  • Flexible virtual hosting
  • HTTP compression using mod_compress and the newer mod_deflate
  • Single-process design with only several threads.
  • No processes or threads started per connection.


To install Lighttpd

Utilize the following command to install Lighttpd web-server.

linuxhelp:/home/user1 # zypper install lighttpd
Retrieving repository ' openSUSE-13.2-Non-Oss'  metadata ......................................[done]
Building repository ' openSUSE-13.2-Non-Oss'  cache ...........................................[done]
Retrieving repository ' openSUSE-13.2-Oss'  metadata ..........................................[done]
Building repository ' openSUSE-13.2-Oss'  cache ...............................................[done]
.
.
.
Checking for file conflicts: ................................................................[done]
(1/2) Installing: spawn-fcgi-1.6.3-12.1.5 ...................................................[done]
(2/2) Installing: lighttpd-1.4.35-2.1.11 ....................................................[done]
Additional rpm output:
Updating /etc/sysconfig/lighttpd...

Start and enable the services.

blinuxhelp:/home/user1 # systemctl start lighttpd
linuxhelp:/home/user1 # systemctl enable lighttpd

After starting the services, verify the status of Lightttpd.

linuxhelp:/home/user1 # systemctl status lighttpd
lighttpd.service - LSB: lighttpd
   Loaded: loaded (/etc/init.d/lighttpd)
   Active: active (running) since Thu 2016-09-15 13:13:59 IST  29s ago
  Process: 34500 ExecStart=/etc/init.d/lighttpd start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/lighttpd.service
           ??34509 /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
Sep 15 13:13:58 linuxhelp lighttpd[34500]: Starting lighttpd 2016-09-15 13:13:58: (network.c....ges
Sep 15 13:13:59 linuxhelp lighttpd[34500]: ..done
Hint: Some lines were ellipsized, use -l to show in full.

Then configure Lighttpd, open the configuration file and add the following lines into it.

linuxhelp:# vim /etc/lighttpd/lighttpd.conf

Create a index.html file in web-root directory and enter the text in that file.

linuxhelp:~ # vim /srv/www/htdocs/index.html


Now its time to access the browser with your system IP.

FAQ
Q
How do I configure Lighttpd for name-based virtual hosting?
A
Let us say your setup is as follows:
Public IP address: 72.12.5.10
Domain names: domain1.com and domain2.net
Default Document Root: /home/lighttpd/default/http
Q
What are the Lighttpd ​Configuration Options?
A
After installing lighttpd, we will begin by creating a file that defines the web server settings. Let’s call this ‘example.conf’ in the home directory. We will simply copy the default config
Q
Does it support .htaccess files?
A
No. Lightys design does not permit implementing this functionality as config files are loaded at startup time and .htaccess would be needed to be parsed at request time.
Also scanning all the
Q
How to make the Source code installation for Lighttpd?
A
Above RPM binary does not carries mod_rewrite and other stuff, so I had decided to rebuild lighttpd from source code (note source code installation is recommended for advanced users only):
$
Q
How do I configure Lighttpd web server as the virtual host for serving multiple websites from a single public IP address (name-based virtual hosting)?
A
There are two basic methods of accomplishing virtual hosting .
(A) name-based virtual hosting : You use multiple host names for the same webserver IP address. For example domain nixcraft.com and theos.in uses same IP address called 65.111.211.111.

(B) ) IIP address / ip-based virtual hosting