<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lighttpd Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/lighttpd/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Tue, 01 Dec 2020 18:49:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>How to install Lighttpd on Ubuntu 20.04?</title>
		<link>https://www.osradar.com/install-lighttpd-ubuntu-20-04/</link>
					<comments>https://www.osradar.com/install-lighttpd-ubuntu-20-04/#comments</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Thu, 28 May 2020 22:30:07 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Focal Fossa]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=20585</guid>

					<description><![CDATA[<p>There are many web services in Unix but we always look for the one that best suits our needs. In this case, we will show you how to install Lighttpd on Ubuntu 20.04. Lighttpd is a “secure, fast, compatible, and very flexible” web server optimized for high-performance environments. It consumes very few resources compared to [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-lighttpd-ubuntu-20-04/">How to install Lighttpd on Ubuntu 20.04?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>There are many web services in Unix but we always look for the one that best suits our needs. In this case, we will show you <strong>how to install Lighttpd on Ubuntu 20.04.</strong></p>



<p><strong>Lighttpd</strong> is a “secure, fast, compatible, and very flexible” web server optimized for high-performance environments. It consumes very few resources compared to other web servers and especially fast for running AJAX applications. It is also open source and uses a BSD license and works on UNIX-like systems, such as Linux or <a href="https://www.osradar.com/tag/freebsd" target="_blank" rel="noreferrer noopener">BSD</a>.</p>



<p>Combining <a href="https://www.osradar.com/tag/focal" target="_blank" rel="noreferrer noopener">Ubuntu 20.04</a> with Lighttpd is a safe bet if you want a fast, efficient and secure web server. Go for it.</p>



<h2>Install Lighttpd on Ubuntu 20.04</h2>



<p>As Lighttpd is a very popular alternative to web servers on Unix family operating systems, it is available through the Ubuntu 20.04 main repositories</p>



<p>Therefore, to install Lighttpd on Ubuntu 20.04, just open a new terminal and run it:</p>



<pre class="wp-block-preformatted">:~$ sudo apt install lighttpd
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
gamin libgamin0 spawn-fcgi
Suggested packages:
rrdtool php-cgi apache2-utils lighttpd-doc lighttpd-mod-authn-gssapi lighttpd-mod-authn-pam lighttpd-mod-authn-sasl lighttpd-mod-cml lighttpd-mod-geoip
lighttpd-mod-magnet lighttpd-mod-maxminddb lighttpd-mod-trigger-b4-dl lighttpd-mod-vhostdb-dbi lighttpd-mod-vhostdb-pgsql lighttpd-mod-webdav lighttpd-modules-ldap
lighttpd-modules-mysql
The following NEW packages will be installed:
gamin libgamin0 lighttpd spawn-fcgi
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 398 kB of archives.
After this operation, 1538 kB of additional disk space will be used.
Do you want to continue? [Y/n]</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="251" src="https://www.osradar.com/wp-content/uploads/2020/05/1-20-1024x251.png" alt="1.- Installing Lighttpd on Ubuntu 20.04" class="wp-image-20587" srcset="https://www.osradar.com/wp-content/uploads/2020/05/1-20-1024x251.png 1024w, https://www.osradar.com/wp-content/uploads/2020/05/1-20-300x74.png 300w, https://www.osradar.com/wp-content/uploads/2020/05/1-20-768x188.png 768w, https://www.osradar.com/wp-content/uploads/2020/05/1-20-696x171.png 696w, https://www.osradar.com/wp-content/uploads/2020/05/1-20-1068x262.png 1068w, https://www.osradar.com/wp-content/uploads/2020/05/1-20.png 1338w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>1.- Installing Lighttpd on Ubuntu 20.04</figcaption></figure>



<p>This way it will be installed and ready to use on our server.</p>



<p>On the other hand, Lighttpd is managed as a system service and therefore you can start it with this command:</p>



<pre class="wp-block-preformatted">:~$ sudo systemctl start lighttpd</pre>



<p>Or stop it:</p>



<pre class="wp-block-preformatted">:~$ sudo systemctl stop lighttpd</pre>



<p>Or know the status of the service:</p>



<pre class="wp-block-preformatted">:~$ sudo systemctl status lighttpd</pre>



<p>Then open a web browser and go to <code>http://localhost</code> if you installed locally or <code>http://server-ip</code> if you installed remotely.</p>



<p>If everything went well, you will see the following screen.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="506" src="https://www.osradar.com/wp-content/uploads/2020/05/2-24-1024x506.png" alt="2.- Lighttpd default page" class="wp-image-20586" srcset="https://www.osradar.com/wp-content/uploads/2020/05/2-24-1024x506.png 1024w, https://www.osradar.com/wp-content/uploads/2020/05/2-24-300x148.png 300w, https://www.osradar.com/wp-content/uploads/2020/05/2-24-768x379.png 768w, https://www.osradar.com/wp-content/uploads/2020/05/2-24-696x344.png 696w, https://www.osradar.com/wp-content/uploads/2020/05/2-24-1068x528.png 1068w, https://www.osradar.com/wp-content/uploads/2020/05/2-24.png 1354w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>2.- Lighttpd default page</figcaption></figure>



<p>However, PHP has to be installed so that dynamic websites can be interpreted.</p>



<h2>Adding PHP support to Lighttpd on Ubuntu 20.04</h2>



<p>The next step is to install PHP which is one of the most popular web programming languages available. With this we guarantee that a good part of the applications created with this language can be used in our server.</p>



<p>So, you can install PHP with the following command:</p>



<pre class="wp-block-preformatted">:~$ sudo apt install php7.4 php7.4-fpm php7.4-mysql php7.4-cli php7.4-curl php7.4-xml
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
php-common php7.4-common php7.4-json php7.4-opcache php7.4-readline
Suggested packages:
php-pear
The following NEW packages will be installed:
php-common php7.4 php7.4-cli php7.4-common php7.4-curl php7.4-fpm php7.4-json php7.4-mysql php7.4-opcache php7.4-readline php7.4-xml
0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
Need to get 4334 kB of archives.
After this operation, 19.2 MB of additional disk space will be used.
Do you want to continue? [Y/n]</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="240" src="https://www.osradar.com/wp-content/uploads/2020/05/3-20-1024x240.png" alt="3.- Installing PHP on Ubuntu 20.04" class="wp-image-20588" srcset="https://www.osradar.com/wp-content/uploads/2020/05/3-20-1024x240.png 1024w, https://www.osradar.com/wp-content/uploads/2020/05/3-20-300x70.png 300w, https://www.osradar.com/wp-content/uploads/2020/05/3-20-768x180.png 768w, https://www.osradar.com/wp-content/uploads/2020/05/3-20-696x163.png 696w, https://www.osradar.com/wp-content/uploads/2020/05/3-20-1068x251.png 1068w, https://www.osradar.com/wp-content/uploads/2020/05/3-20.png 1197w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>3.- Installing PHP on Ubuntu 20.04</figcaption></figure>



<p>Now some changes have to be made so that Lighttpd can work with PHP and interpret the websites.</p>



<p>First, open the Lighttpd configuration file which is <code>/etc/php/7.4/fpm/pool.d/www.conf</code></p>



<pre class="wp-block-preformatted">:~$ sudo nano /etc/php/7.4/fpm/pool.d/www.conf</pre>



<p>And change the list value to this:</p>



<pre class="wp-block-preformatted">listen = 127.0.0.1:9000</pre>



<p>If you want you can simply comment on the line and add this one.</p>



<p>Save the changes and close the file.</p>



<p>Then you have to make other changes in another configuration file. So, open the file <code>/etc/lighttpd/conf-available/15-fastcgi-php.conf</code></p>



<pre class="wp-block-preformatted">:~$ sudo nano /etc/lighttpd/conf-available/15-fastcgi-php.conf</pre>



<p>And change the following lines:</p>



<pre class="wp-block-preformatted">"bin-path" =&gt; "/usr/bin/php-cgi",<br>"socket" =&gt; "/var/run/lighttpd/php.socket",</pre>



<p>To:</p>



<pre class="wp-block-preformatted">"host" =&gt; "127.0.0.1",<br>"port" =&gt; "9000",</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="816" height="291" src="https://www.osradar.com/wp-content/uploads/2020/05/4-16.png" alt="4.- Configuring Lighttpd on Ubuntu 20.04" class="wp-image-20589" srcset="https://www.osradar.com/wp-content/uploads/2020/05/4-16.png 816w, https://www.osradar.com/wp-content/uploads/2020/05/4-16-300x107.png 300w, https://www.osradar.com/wp-content/uploads/2020/05/4-16-768x274.png 768w, https://www.osradar.com/wp-content/uploads/2020/05/4-16-696x248.png 696w" sizes="(max-width: 816px) 100vw, 816px" /><figcaption>4.- Configuring Lighttpd on Ubuntu 20.04</figcaption></figure>



<p>Then save the changes and close the file.</p>



<p>Then execute the following commands to enable the modules that will make Lighttpd work with PHP.</p>



<pre class="wp-block-preformatted">:~$ sudo lighty-enable-mod fastcgi
Enabling fastcgi: ok
Run "service lighttpd force-reload" to enable changes

:~$ sudo lighty-enable-mod fastcgi-php
Enabling fastcgi-php: ok
Run "service lighttpd force-reload" to enable changes</pre>



<p>Finally restart Lighttpd and php-fpm services</p>



<pre class="wp-block-preformatted">:~$ sudo systemctl restart lighttpd php7.4-fpm</pre>



<p>To test if everything we have done works, just write a PHP file in the Lighttpd root directory and open it with the browser.</p>



<p>So, create the file and add the following content:</p>



<pre class="wp-block-preformatted">:~$ sudo nano /var/www/html/test.php
&lt;?php
phpinfo();
?&gt;</pre>



<p>Again, save the changes and close the file.</p>



<p>Also, you should change the permissions of the directory and make Lighttpd the owner of it:</p>



<pre class="wp-block-preformatted">:~$ sudo chown -R www-data:www-data /var/www/html/
:~$ sudo chown -R 755 /var/www/html/</pre>



<p>And now yes, open your browser and open the file http://your-server/test.php and you will see the following:</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="506" src="https://www.osradar.com/wp-content/uploads/2020/05/5-11-1024x506.png" alt="5.- PHP working with Lighttpd" class="wp-image-20590" srcset="https://www.osradar.com/wp-content/uploads/2020/05/5-11-1024x506.png 1024w, https://www.osradar.com/wp-content/uploads/2020/05/5-11-300x148.png 300w, https://www.osradar.com/wp-content/uploads/2020/05/5-11-768x379.png 768w, https://www.osradar.com/wp-content/uploads/2020/05/5-11-696x344.png 696w, https://www.osradar.com/wp-content/uploads/2020/05/5-11-1068x528.png 1068w, https://www.osradar.com/wp-content/uploads/2020/05/5-11.png 1354w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>5.- PHP working with Lighttpd</figcaption></figure>



<p>So, that is it. Enjoy Lighttpd.</p>



<h2>Conclusion</h2>



<p>Lighttpd stands out for being very light in the execution of web applications. So it can serve us for many interesting things in our daily work on a server. Today we have learned to install it on a server with Ubuntu 20.04 and we have also added support for PHP.</p>



<p>Please share this post and join <a href="https://t.me/osradar" target="_blank" rel="noreferrer noopener">our Telegram channel</a>.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-lighttpd-ubuntu-20-04/">How to install Lighttpd on Ubuntu 20.04?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/install-lighttpd-ubuntu-20-04/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>How to install lighttpd on FreeBSD 12?</title>
		<link>https://www.osradar.com/how-to-install-lighttpd-freebsd-12/</link>
					<comments>https://www.osradar.com/how-to-install-lighttpd-freebsd-12/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Tue, 25 Feb 2020 00:11:00 +0000</pubDate>
				<category><![CDATA[Servers]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[freebsd 12]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[web server]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=18365</guid>

					<description><![CDATA[<p>Hi, folks. Thanks for staying another day. In this post, you will learn how to install Lighttpd on FreeBSD 12. Of course, we will include PHP support. So let&#8217;s go for it. Lighttpd is a “secure, fast, compatible and very flexible” web server optimized for high-performance environments. It consumes very few resources compared to other [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-lighttpd-freebsd-12/">How to install lighttpd on FreeBSD 12?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi, folks. Thanks for staying another day. In this post, you will learn <strong>how to install Lighttpd on FreeBSD 12</strong>. Of course, we will include PHP support. So let&#8217;s go for it.</p>
<p><a href="https://www.lighttpd.net/" target="_blank" rel="noopener noreferrer"><strong>Lighttpd</strong></a> is a “secure, fast, compatible and very flexible” web server optimized for high-performance environments. It consumes very few resources compared to other web servers and especially fast for running AJAX applications. It is also open source and uses a BSD license and works on UNIX-like systems, such as Linux or BSD.</p>
<p>Generally, Lighttpd is used in servers where maximum performance is needed even at the sacrifice of some features. Despite this, Lighttpd is always a good alternative to the popular Apache and Nginx.</p>
<h2>Install Lighttpd on FreeBSD 12</h2>
<p>For this tutorial, you need to have sudo enabled. For this, I recommend you to read our post about it:</p>
<p><a href="https://www.osradar.com/enable-sudo-on-freebsd-12/" target="_blank" rel="noopener noreferrer">How to enable sudo on FreeBSD 12?</a></p>
<p>Before starting with the tutorial, it is recommended to update the system completely, to do it, open a terminal emulator or connect to your server using SSH and write:</p>
<pre>:~$ sudo pkg update</pre>
<p>Now we can really get started with the tutorial.</p>
<h3>1.- Install Lighttpd</h3>
<p>Lighttpd is available from the official FreeBSD repositories. Therefore, the installation will not result in problems. So to install it, use the following command:</p>
<pre>:~$ sudo pkg install lighttpd
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%    944 B   0.9kB/s    00:01    
Fetching packagesite.txz: 100%    6 MiB  53.0kB/s    02:02    
Processing entries: 100%
FreeBSD repository update completed. 31558 packages processed.
All repositories are up to date.
The following 4 package(s) will be affected (of 0 checked):</pre>
<p>New packages to be INSTALLED:<br />
lighttpd: 1.4.54<br />
lua52: 5.2.4<br />
libedit: 3.1.20191211,1<br />
pcre: 8.43_2</p>
<p>Number of packages to be installed: 4</p>
<p>The process will require 10 MiB more space.<br />
2 MiB to be downloaded.</p>
<p>Proceed with this action? [y/N]:</p>
<p><figure id="attachment_18442" aria-describedby="caption-attachment-18442" style="width: 708px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-18442" src="https://www.osradar.com/wp-content/uploads/2020/02/1-14.png" alt="1.-  Install Lighttpd on FreeBSD 12" width="708" height="422" srcset="https://www.osradar.com/wp-content/uploads/2020/02/1-14.png 708w, https://www.osradar.com/wp-content/uploads/2020/02/1-14-300x179.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/1-14-696x415.png 696w, https://www.osradar.com/wp-content/uploads/2020/02/1-14-705x420.png 705w" sizes="(max-width: 708px) 100vw, 708px" /><figcaption id="caption-attachment-18442" class="wp-caption-text">1.- Install Lighttpd on FreeBSD 12</figcaption></figure></p>
<p>After entering the password, the download will start.</p>
<p>For now, we won&#8217;t start the Lighttpd service because there are some settings we have to make first.</p>
<h3>2.- Install PHP on FreeBSD 12</h3>
<p>Of course, if we install only Lighttpd we won&#8217;t be able to run any web application made with PHP. This brings a consequence that the functionality would decay. So let&#8217;s install it:</p>
<pre>:~$ sudo pkg install php74 mod_php74 php74-mbstring php74-zlib php74-curl php74-gd php74-json</pre>
<p><figure id="attachment_18445" aria-describedby="caption-attachment-18445" style="width: 894px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-18445" src="https://www.osradar.com/wp-content/uploads/2020/02/2-13.png" alt="2.- Install PHP on FreeBSD 12" width="894" height="714" srcset="https://www.osradar.com/wp-content/uploads/2020/02/2-13.png 894w, https://www.osradar.com/wp-content/uploads/2020/02/2-13-300x240.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/2-13-768x613.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/2-13-696x556.png 696w, https://www.osradar.com/wp-content/uploads/2020/02/2-13-526x420.png 526w" sizes="(max-width: 894px) 100vw, 894px" /><figcaption id="caption-attachment-18445" class="wp-caption-text">2.- Install PHP on FreeBSD 12</figcaption></figure></p>
<p>I took the opportunity to install some extra modules.</p>
<p>Now we have to make some modifications to PHP so that it can work without problems with Lighttpd.</p>
<p>First open the file <strong>/usr/local/etc/php-fpm.d/www.conf</strong> and make these changes.</p>
<p>Find the line:</p>
<pre>listen = 127.0.0.1:9000</pre>
<p>And exchange it for this one:</p>
<pre>listen = /var/run/php-fpm.sock</pre>
<p>Then, locate the following lines and decomment them:</p>
<pre>;listen.owner = www
;listen.group = www
;listen.mode = 0660</pre>
<p>Looking like this in the picture:</p>
<p><figure id="attachment_18446" aria-describedby="caption-attachment-18446" style="width: 857px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-18446" src="https://www.osradar.com/wp-content/uploads/2020/02/3-11.png" alt="3.- Configuring PHP to support Lighttpd" width="857" height="504" srcset="https://www.osradar.com/wp-content/uploads/2020/02/3-11.png 857w, https://www.osradar.com/wp-content/uploads/2020/02/3-11-300x176.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/3-11-768x452.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/3-11-696x409.png 696w, https://www.osradar.com/wp-content/uploads/2020/02/3-11-714x420.png 714w" sizes="(max-width: 857px) 100vw, 857px" /><figcaption id="caption-attachment-18446" class="wp-caption-text">3.- Configuring PHP to support Lighttpd</figcaption></figure></p>
<p>So, save the changes and close the file.</p>
<p>Now it is necessary to create a new php.ini file. During the installation, two example files are created that we have to use depending on the function of our computer. These files are <strong>php.ini-production</strong> and<strong> php.ini-development.</strong></p>
<p>So we have to choose one, in my case, I will assume that FreeBSD 12 is for production, so that will be my choice.</p>
<p><strong><em>Note: it is likely that if you choose the other one this tutorial will work as well.</em></strong></p>
<p>So, we copy the example file as php.ini:</p>
<pre>:~$ sudo cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini</pre>
<p>And we edited the file in question:</p>
<pre>:~$ sudo nano /usr/local/etc/php.ini</pre>
<p>And locate the line:</p>
<pre>;cgi.fix_pathinfo=1</pre>
<p>And exchange it for this one:</p>
<pre>cgi.fix_pathinfo=0</pre>
<p><figure id="attachment_18448" aria-describedby="caption-attachment-18448" style="width: 903px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-18448" src="https://www.osradar.com/wp-content/uploads/2020/02/4-10.png" alt="4.- Editing the PHP configuration file" width="903" height="229" srcset="https://www.osradar.com/wp-content/uploads/2020/02/4-10.png 903w, https://www.osradar.com/wp-content/uploads/2020/02/4-10-300x76.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/4-10-768x195.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/4-10-696x177.png 696w" sizes="(max-width: 903px) 100vw, 903px" /><figcaption id="caption-attachment-18448" class="wp-caption-text">4.- Editing the PHP configuration file</figcaption></figure></p>
<p>Again, save the changes and close the file.</p>
<p>Now we can start and enable the PHP-fpm service.</p>
<pre>:~$ sudo sysrc php_fpm_enable=yes
php_fpm_enable: -&gt; yes
:~$ sudo service php-fpm start
Performing sanity check on php-fpm configuration:
[20-Feb-2020 14:50:21] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful
Starting php_fpm.</pre>
<h3>3.- Configuring Lighttpd on FreeBSD 12</h3>
<p>In this section of the tutorial, we have to make some configurations to Lighttpd so that it can work with PHP.</p>
<p>So, open the file <strong>/usr/local/etc/lighttpd/modules.conf</strong></p>
<pre>:~$ sudo nano /usr/local/etc/lighttpd/modules.conf</pre>
<p>And uncomment the line:</p>
<pre>include "conf.d/fastcgi.conf"</pre>
<p><figure id="attachment_18451" aria-describedby="caption-attachment-18451" style="width: 666px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-18451" src="https://www.osradar.com/wp-content/uploads/2020/02/5-10.png" alt="5.- Configuring Lighttpd to work with PHP" width="666" height="258" srcset="https://www.osradar.com/wp-content/uploads/2020/02/5-10.png 666w, https://www.osradar.com/wp-content/uploads/2020/02/5-10-300x116.png 300w" sizes="(max-width: 666px) 100vw, 666px" /><figcaption id="caption-attachment-18451" class="wp-caption-text">5.- Configuring Lighttpd to work with PHP</figcaption></figure></p>
<p>What this does is to include the fastcgi module which is the one we will use for Lighttpd to process PHP.</p>
<p>At the end of that same file, add the following:</p>
<pre>fastcgi.server += ( ".php" =&gt;
        ((
                "socket" =&gt; "/var/run/php-fpm.sock",
                "broken-scriptfilename" =&gt; "enable"
        ))
)</pre>
<p><figure id="attachment_18452" aria-describedby="caption-attachment-18452" style="width: 811px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-18452" src="https://www.osradar.com/wp-content/uploads/2020/02/6-8.png" alt="6.- Editing the Lighttpd configuration file" width="811" height="169" srcset="https://www.osradar.com/wp-content/uploads/2020/02/6-8.png 811w, https://www.osradar.com/wp-content/uploads/2020/02/6-8-300x63.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/6-8-768x160.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/6-8-696x145.png 696w" sizes="(max-width: 811px) 100vw, 811px" /><figcaption id="caption-attachment-18452" class="wp-caption-text">6.- Editing the Lighttpd configuration file</figcaption></figure></p>
<p>Save the changes and close the editor.</p>
<p>Before starting the service, edit the main Lighttpd configuration file and uncomment the line:</p>
<pre>:~$ sudo nano /usr/local/etc/lighttpd/lighttpd.conf</pre>
<pre>server.bind = "localhost"</pre>
<p>So, you can save the changes and close the file.</p>
<p>If your server uses IPv6, you have to locate this line as well and leave it as it is:</p>
<pre>server.use-ipv6 = "enable"</pre>
<p>And at the end of the file comment on this line:</p>
<pre>$SERVER["socket"] == "0.0.0.0:80" { }</pre>
<p><strong>Remember, this is only if your server uses IPv6, if not omit this.</strong></p>
<p>Now, enable and start the Lighttpd service:</p>
<pre>:~$ sudo sysrc lighttpd_enable=yes
lighttpd_enable: -&gt; yes</pre>
<pre>:~$ sudo service lighttpd start</pre>
<p>So, we are going to test it.</p>
<h3>4.- Testing Lighttpd and PHP on FreeBSD 12</h3>
<p>Now we&#8217;re going to try everything we&#8217;ve done. The best way is to create a PHP file for the server to run.</p>
<p>First, create the folder where Lighttpd will look for the web files. In other words, the root directory.</p>
<pre>:~$ sudo mkdir -p /usr/local/www/data</pre>
<p>And now create a PHP file called test.php and add the following:</p>
<pre>:~$ sudo nano /usr/local/www/data/test.php
&lt;?php
phpinfo();
?&gt;</pre>
<p>Save the changes and close the file.</p>
<p>Now open your favorite web browser and go to <strong>http://server-ip/test.php</strong> and you will see the following:</p>
<p><figure id="attachment_18454" aria-describedby="caption-attachment-18454" style="width: 1354px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-18454" src="https://www.osradar.com/wp-content/uploads/2020/02/7-3.png" alt="7.- Lighttpd and PHP working on FreeBSD 12" width="1354" height="669" srcset="https://www.osradar.com/wp-content/uploads/2020/02/7-3.png 1354w, https://www.osradar.com/wp-content/uploads/2020/02/7-3-300x148.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/7-3-1024x506.png 1024w, https://www.osradar.com/wp-content/uploads/2020/02/7-3-768x379.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/7-3-324x160.png 324w, https://www.osradar.com/wp-content/uploads/2020/02/7-3-696x344.png 696w, https://www.osradar.com/wp-content/uploads/2020/02/7-3-1068x528.png 1068w, https://www.osradar.com/wp-content/uploads/2020/02/7-3-850x420.png 850w" sizes="(max-width: 1354px) 100vw, 1354px" /><figcaption id="caption-attachment-18454" class="wp-caption-text">7.- Lighttpd and PHP working on FreeBSD 12</figcaption></figure></p>
<p>So, that is it. If you want to use a database management program in FreeBSD 12, you can check these posts:</p>
<p><a href="https://www.osradar.com/install-postgresql-freebsd-12/" target="_blank" rel="noopener noreferrer">How to install PostgreSQL on FreeBSD 12?</a></p>
<p><a href="https://www.osradar.com/how-to-install-sqlite-on-freebsd-12/" target="_blank" rel="noopener noreferrer">How to install SQLite on FreeBSD 12?</a></p>
<p>So, enjoy it.</p>
<h2>Conclusion</h2>
<p>Lighttpd is less popular than Apache and Nginx, that&#8217;s for sure, but it&#8217;s quite useful on small servers or when we want maximum performance in a web application. Today thanks to this post, you have learned how to install it on FreeBSD 12.</p>
<p>Please share this post and join our <a href="https://t.me/osradar" target="_blank" rel="noopener noreferrer">Telegram channel</a>.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-lighttpd-freebsd-12/">How to install lighttpd on FreeBSD 12?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-install-lighttpd-freebsd-12/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to configure virtual hosts on Lighttpd?</title>
		<link>https://www.osradar.com/configure-virtual-hosts-lighttpd/</link>
					<comments>https://www.osradar.com/configure-virtual-hosts-lighttpd/#comments</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Fri, 10 Jan 2020 00:31:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Buster]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[web server]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=17520</guid>

					<description><![CDATA[<p>Recently I have taught you how to install Lighttpd on Debian 10. Well, we will take advantage of that installation to also teach you how to create virtual hosts on Lighttpd. Why create a Virtualhost on Lighttpd? One of the great advantages of creating a Virtualhost is that we can have in a single server, [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/configure-virtual-hosts-lighttpd/">How to configure virtual hosts on Lighttpd?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Recently I have taught you how to install Lighttpd on Debian 10. Well, we will take advantage of that installation to also teach you how to create virtual hosts on Lighttpd.</p>



<h2>Why create a Virtualhost on Lighttpd?</h2>



<p>One of the great advantages of creating a Virtualhost is that we can have in a single server, different sites or web applications. </p>



<p>Then, using our computer we will be able to access several applications with even different names. This is especially useful in servers that have to serve many web applications in a single computer. It is also useful if you are a web developer and need to deploy several applications locally for testing.</p>



<p>So let&#8217;s do it.</p>



<h2>Install Lighttpd on Debian</h2>



<p>The first step is to install and configure Lighttpd on Debian 10.</p>



<p><a href="https://www.osradar.com/install-lighttpd-debian-10/" target="_blank" rel="noreferrer noopener" aria-label="How to install Lighttpd on Debian 10? (opens in a new tab)">How to install Lighttpd on Debian 10?</a></p>



<p>Once you have completed the installation we can continue.</p>



<h2>Creating virtual hosts on Lighttpd (I)</h2>



<p>The first thing we must do is create a folder for each Virtualhost we want to create. This is basic to have every website or web application apart. </p>



<p>Also, we must take into account that it is recommended that the name of the folder is the same as the name of the virtual host. In my case, I have chosen &#8220;<strong>www.test.osradar.lan</strong>&#8221; and &#8220;<strong>www.test2.osradar.lan</strong>&#8220;. You can choose whatever you want.</p>



<pre class="wp-block-preformatted">:~$ sudo mkdir -p /var/www/html/www.test.osradar.lan
:~$ sudo mkdir -p /var/www/html/www.test2.osradar.lan</pre>



<p>Then, for all applications and websites to run properly, you need to change the permissions to the virtual host folders.</p>



<pre class="wp-block-preformatted">:~$ sudo chmod -R 755 /var/www/html/www.test.osradar.lan
:~$ sudo chmod -R 755 /var/www/html/www.test2.osradar.lan</pre>



<p>Also, you have to change the owner of the folders. In the case of Debian, ownership must be given to the user and group <code>www-data</code>.</p>



<pre class="wp-block-preformatted">:~$ sudo chown -R www-data:www-data /var/www/html/www.test.osradar.lan
:~$ sudo chown -R www-data:www-data /var/www/html/www.test2.osradar.lan</pre>



<p>To demonstrate the proper functioning of the virtual hosts, create an index.html file in each folder and add the following for the first host:</p>



<pre class="wp-block-preformatted">:~$ sudo nano /var/www/html/www.test.osradar.lan/index.html</pre>



<pre class="wp-block-preformatted">&lt;html>
&lt;body>
welcome to www.test.osradar.lan
&lt;/body>
&lt;/html>
</pre>



<p>And</p>



<pre class="wp-block-preformatted">:~$ sudo nano /var/www/html/www.test2.osradar.lan/index.html</pre>



<pre class="wp-block-preformatted">&lt;html>
&lt;body>
welcome to www.test2.osradar.lan 
&lt;/body>
&lt;/html></pre>



<p>For the second one.</p>



<p>So, save the changes and close the file.</p>



<h2>Creating virtual hosts on Lighttpd (II)</h2>



<p>The folders and files are ready, now we have to make some changes for Lighttpd to interpret them.</p>



<p>It&#8217;s a good idea to create a folder called <code>vhosts.d</code> in <code>/etc/lighttpd/</code> and place all the virtual host configuration files there. As with the folders, it&#8217;s a good idea to have one file for each virtual host.</p>



<pre class="wp-block-preformatted">:~$ sudo mkdir -p /etc/lighttpd/vhosts.d/</pre>



<p>However, for all these changes to be made, the Lighttpd configuration file must be modified. So let&#8217;s do it.</p>



<pre class="wp-block-preformatted">:~$ sudo nano /etc/lighttpd/lighttpd.conf</pre>



<p>And at the end of the file add the following:</p>



<pre class="wp-block-preformatted">include_shell "cat /etc/lighttpd/vhosts.d/*.conf"</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="547" height="110" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2020/01/1-3.png" alt="1.- Adding the virtual host configuration directory" class="wp-image-17521" srcset="https://www.osradar.com/wp-content/uploads/2020/01/1-3.png 547w, https://www.osradar.com/wp-content/uploads/2020/01/1-3-300x60.png 300w" sizes="(max-width: 547px) 100vw, 547px" /><figcaption>1.- Adding the virtual host configuration directory</figcaption></figure>



<p>Save the changes and close the file.</p>



<p>Now we will create a configuration file for each virtual host. And in the first one we will add the following.</p>



<pre class="wp-block-preformatted">:~$ sudo nano /etc/lighttpd/vhosts.d/www.test.osradar.lan.conf</pre>



<pre class="wp-block-preformatted">$HTTP["host"] =~ "(^|.)test.osradar.lan$" {
    server.document-root = "/var/www/html/www.test.osradar.lan"
    server.errorlog = "/var/log/lighttpd/www.test.osradar.lan-error.log"
    accesslog.filename = "/var/log/lighttpd/www.test.osradar.lan-access.log"
}</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="960" height="203" src="https://www.osradar.com/wp-content/uploads/2020/01/2-3.png" alt="2.- Creating a new virtual host on Lighttpd" class="wp-image-17522" srcset="https://www.osradar.com/wp-content/uploads/2020/01/2-3.png 960w, https://www.osradar.com/wp-content/uploads/2020/01/2-3-300x63.png 300w, https://www.osradar.com/wp-content/uploads/2020/01/2-3-768x162.png 768w, https://www.osradar.com/wp-content/uploads/2020/01/2-3-696x147.png 696w" sizes="(max-width: 960px) 100vw, 960px" /><figcaption>2.- Creating a new virtual host on Lighttpd</figcaption></figure>



<p>And for the second:</p>



<pre class="wp-block-preformatted">:~$ sudo nano /etc/lighttpd/vhosts.d/www.test2.osradar.lan.conf</pre>



<pre class="wp-block-preformatted">$HTTP["host"] =~ "(^|.)test2.osradar.lan$" {
    server.document-root = "/var/www/html/www.test2.osradar.lan"
    server.errorlog = "/var/log/lighttpd/www.test2.osradar.lan-error.log"
    accesslog.filename = "/var/log/lighttpd/www.test2.osradar.lan-access.log"
}</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="943" height="191" src="https://www.osradar.com/wp-content/uploads/2020/01/3-3.png" alt="3.- Creating the second virtual host on Lighttpd" class="wp-image-17523" srcset="https://www.osradar.com/wp-content/uploads/2020/01/3-3.png 943w, https://www.osradar.com/wp-content/uploads/2020/01/3-3-300x61.png 300w, https://www.osradar.com/wp-content/uploads/2020/01/3-3-768x156.png 768w, https://www.osradar.com/wp-content/uploads/2020/01/3-3-696x141.png 696w" sizes="(max-width: 943px) 100vw, 943px" /><figcaption>3.- Creating the second virtual host on Lighttpd</figcaption></figure>



<p>Save the changes and close the editor.</p>



<p>You can also use the following command to check the syntax of the configuration files:</p>



<pre class="wp-block-preformatted">:~$ sudo lighttpd -t -f /etc/lighttpd/lighttpd.conf</pre>



<p>The result should be something like:</p>



<pre class="wp-block-preformatted">Syntax OK.</pre>



<p>Then, restart lighttpd.</p>



<pre class="wp-block-preformatted">:~$ sudo systemctl restart lighttpd</pre>



<p>And that&#8217;s it.</p>



<p>To test it, you need to modify some parameters in the client computer.</p>



<pre class="wp-block-preformatted">:~$ sudo nano /etc/hosts</pre>



<p>And add the following</p>



<pre class="wp-block-preformatted">[Server_IP] www.test.osradar.lan<br>[Server_IP] www.test2.osradar.lan</pre>



<p>Save the changes and close the editor.</p>



<p>Now open your favorite web browser and go to <code>www.test.osradar.lan</code> and you will see the following:</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="840" height="114" src="https://www.osradar.com/wp-content/uploads/2020/01/4-3.png" alt="4.- Testing the first Virtual host" class="wp-image-17524" srcset="https://www.osradar.com/wp-content/uploads/2020/01/4-3.png 840w, https://www.osradar.com/wp-content/uploads/2020/01/4-3-300x41.png 300w, https://www.osradar.com/wp-content/uploads/2020/01/4-3-768x104.png 768w, https://www.osradar.com/wp-content/uploads/2020/01/4-3-696x94.png 696w" sizes="(max-width: 840px) 100vw, 840px" /><figcaption>4.- Testing the first Virtual host</figcaption></figure>



<p>Now, go to <code>www.test2.osradar.lan</code>:</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="843" height="113" src="https://www.osradar.com/wp-content/uploads/2020/01/5-3.png" alt="5.- The second virtual host" class="wp-image-17525" srcset="https://www.osradar.com/wp-content/uploads/2020/01/5-3.png 843w, https://www.osradar.com/wp-content/uploads/2020/01/5-3-300x40.png 300w, https://www.osradar.com/wp-content/uploads/2020/01/5-3-768x103.png 768w, https://www.osradar.com/wp-content/uploads/2020/01/5-3-696x93.png 696w" sizes="(max-width: 843px) 100vw, 843px" /><figcaption>5.- The second virtual host</figcaption></figure>



<p>So, everything is OK. And that is it.</p>



<h2>Conclusion</h2>



<p>In conclusion, in this post, you have learned how to create virtual hosts using Lighttpd as a web server. This not so well known server is useful to serve heavy applications without problems.</p>



<p>Please share this post and join <a href="https://t.me/osradar" target="_blank" rel="noreferrer noopener" aria-label="our Telegram channel. (opens in a new tab)">our Telegram channel.</a></p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/configure-virtual-hosts-lighttpd/">How to configure virtual hosts on Lighttpd?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/configure-virtual-hosts-lighttpd/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>How to install lighttpd on Debian 10?</title>
		<link>https://www.osradar.com/install-lighttpd-debian-10/</link>
					<comments>https://www.osradar.com/install-lighttpd-debian-10/#comments</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Thu, 09 Jan 2020 00:29:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Buster]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=17505</guid>

					<description><![CDATA[<p>So, today I will show you how to install Lighttpd in Debian 10. Lighttpd is a “secure, fast, compatible and very flexible” web server optimized for high-performance environments. It consumes very few resources compared to other web servers and especially fast for running AJAX applications. It is also open source and uses a BSD license [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-lighttpd-debian-10/">How to install lighttpd on Debian 10?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>So, today I will show you how to install <a href="https://www.lighttpd.net/">Lighttpd</a> in Debian 10.</p>



<p><strong>Lighttpd</strong> is a “secure, fast, compatible and very flexible” web server optimized for high-performance environments. It consumes very few resources compared to other web servers and especially fast for running AJAX applications. It is also open source and uses a  BSD license and works on UNIX-like systems, such as Linux or BSD.</p>



<p>Combining Debian 10 with Lighttpd is a safe bet if you want a fast, efficient and secure web server. Go for it.</p>



<h2>Install Lighttpd on Debian 10</h2>



<p>Fortunately, Lighttpd is available from the official Debian repositories. So, the installation only comes down to one command.</p>



<p>So, open a terminal session or connect to your server remotely and run the following command:</p>



<pre class="wp-block-preformatted">:~$ sudo apt install lighttpd</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="951" height="320" src="https://www.osradar.com/wp-content/uploads/2020/01/1-2.png" alt="1.- Install Lighttpd on Debian 10" class="wp-image-17507" srcset="https://www.osradar.com/wp-content/uploads/2020/01/1-2.png 951w, https://www.osradar.com/wp-content/uploads/2020/01/1-2-300x101.png 300w, https://www.osradar.com/wp-content/uploads/2020/01/1-2-768x258.png 768w, https://www.osradar.com/wp-content/uploads/2020/01/1-2-696x234.png 696w" sizes="(max-width: 951px) 100vw, 951px" /><figcaption>1.- Install Lighttpd on Debian 10</figcaption></figure>



<p>In case you do not have <strong>sudo</strong> enabled, you can log in as root, or learn how to enable it with our post manager:</p>



<p><a href="https://www.osradar.com/how-to-enable-sudo-on-debian-10/" target="_blank" rel="noreferrer noopener" aria-label="How to enable sudo on Debian 10? (opens in a new tab)">How to enable sudo on Debian 10?</a></p>



<p>Once it has been installed, we will be able to check the operation of it, opening a web browser and going to <code>http://SERVER_IP</code> or <code>http://localhost</code> if we are in a local machine. Remember that this works through port 80 and it has to be available. </p>



<p>If we manage to see this image, it means that everything is in order.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="506" src="https://www.osradar.com/wp-content/uploads/2020/01/2-2-1024x506.png" alt="2.- Lighttpd working on Debian 10" class="wp-image-17508" srcset="https://www.osradar.com/wp-content/uploads/2020/01/2-2-1024x506.png 1024w, https://www.osradar.com/wp-content/uploads/2020/01/2-2-300x148.png 300w, https://www.osradar.com/wp-content/uploads/2020/01/2-2-768x379.png 768w, https://www.osradar.com/wp-content/uploads/2020/01/2-2-324x160.png 324w, https://www.osradar.com/wp-content/uploads/2020/01/2-2-696x344.png 696w, https://www.osradar.com/wp-content/uploads/2020/01/2-2-1068x528.png 1068w, https://www.osradar.com/wp-content/uploads/2020/01/2-2-850x420.png 850w, https://www.osradar.com/wp-content/uploads/2020/01/2-2.png 1354w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>2.- Lighttpd working on Debian 10</figcaption></figure>



<p>Now, let&#8217;s install PHP.</p>



<h2>Enabling the PHP support to Lighttpd</h2>



<p>Lighttpd is up and running, but let&#8217;s be honest, a web server that doesn&#8217;t have at least PHP is not much use to us. So we&#8217;ll install and configure PHP and Lighttpd.</p>



<p>The first step is to install PHP and some of its modules, to do this, use the following command:</p>



<pre class="wp-block-preformatted">:~$ sudo apt install php7.3 php7.3-fpm php7.3-mysql php7.3-cli php7.3-curl php7.3-xml</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="221" src="https://www.osradar.com/wp-content/uploads/2020/01/3-2-1024x221.png" alt="3.- Install PHP on Debian 10" class="wp-image-17509" srcset="https://www.osradar.com/wp-content/uploads/2020/01/3-2-1024x221.png 1024w, https://www.osradar.com/wp-content/uploads/2020/01/3-2-300x65.png 300w, https://www.osradar.com/wp-content/uploads/2020/01/3-2-768x166.png 768w, https://www.osradar.com/wp-content/uploads/2020/01/3-2-696x150.png 696w, https://www.osradar.com/wp-content/uploads/2020/01/3-2-1068x230.png 1068w, https://www.osradar.com/wp-content/uploads/2020/01/3-2.png 1354w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>3.- Install PHP on Debian 10</figcaption></figure>



<p>And then we will do the settings.</p>



<p>To start with, you have to modify the <code>listen</code> parameter in the PHP-fpm configuration file.</p>



<pre class="wp-block-preformatted">:~$ sudo nano /etc/php/7.3/fpm/pool.d/www.conf</pre>



<pre class="wp-block-preformatted">listen = 127.0.0.1:9000</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="924" height="352" src="https://www.osradar.com/wp-content/uploads/2020/01/4-2.png" alt="4.- Configuring PHP to work with Lighttpd" class="wp-image-17510" srcset="https://www.osradar.com/wp-content/uploads/2020/01/4-2.png 924w, https://www.osradar.com/wp-content/uploads/2020/01/4-2-300x114.png 300w, https://www.osradar.com/wp-content/uploads/2020/01/4-2-768x293.png 768w, https://www.osradar.com/wp-content/uploads/2020/01/4-2-696x265.png 696w" sizes="(max-width: 924px) 100vw, 924px" /><figcaption>4.- Configuring PHP to work with Lighttpd</figcaption></figure>



<p>Save the changes and close the file.</p>



<p>Now, another configuration file needs to be modified. In this case, it is <code>/etc/lighttpd/conf-available/15-fastcgi-php.conf</code> and in it, you have to change the following:</p>



<pre class="wp-block-preformatted">:~$ sudo nano /etc/lighttpd/conf-available/15-fastcgi-php.conf</pre>



<pre class="wp-block-preformatted">"bin-path" => "/usr/bin/php-cgi",
"socket" => "/var/run/lighttpd/php.socket",</pre>



<p>To</p>



<pre class="wp-block-preformatted">"host" => "127.0.0.1",<br>"port" => "9000",</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="932" height="391" src="https://www.osradar.com/wp-content/uploads/2020/01/5-2.png" alt="5.- Adding PHP support to Lighttpd" class="wp-image-17511" srcset="https://www.osradar.com/wp-content/uploads/2020/01/5-2.png 932w, https://www.osradar.com/wp-content/uploads/2020/01/5-2-300x126.png 300w, https://www.osradar.com/wp-content/uploads/2020/01/5-2-768x322.png 768w, https://www.osradar.com/wp-content/uploads/2020/01/5-2-696x292.png 696w" sizes="(max-width: 932px) 100vw, 932px" /><figcaption>5.- Adding PHP support to Lighttpd</figcaption></figure>



<p>After saving the changes and closing the file, PHP-fpm must be enabled in Lighttpd.</p>



<pre class="wp-block-preformatted">:~$ sudo lighty-enable-mod fastcgi
 Enabling fastcgi: ok
:~$ sudo lighty-enable-mod fastcgi-php
 Enabling fastcgi-php: ok</pre>



<p>Then, restart lighttpd and php-fpm.</p>



<pre class="wp-block-preformatted">:~$ sudo systemctl restart lighttpd
:~$ sudo systemctl restart php7.3-fpm</pre>



<p>Now, we are going to test PHP.</p>



<h2>Test PHP and Lighttpd on Debian 10</h2>



<p>The best way to test the installation is to create a PHP file and open it from the web browser and check that it runs.</p>



<p>So, let&#8217;s create one.</p>



<pre class="wp-block-preformatted">:~$ sudo nano /var/www/html/test.php</pre>



<p>And add the following:</p>



<pre class="wp-block-preformatted">&lt;?php
phpinfo();
?></pre>



<p>Save the changes and close the file.</p>



<p>Also, it&#8217;s a good idea to change the permissions of the Lighttpd root folder so that all files run correctly:</p>



<pre class="wp-block-preformatted">:~$ sudo chown -R www-data:www-data /var/www/html/
:~$ sudo chown -R 755 /var/www/html/</pre>



<p>Now, open your web browser and go to <code>http://your-server/test.php</code> or if the installation is local <code>http://localhost/test.php</code> and you should see this image.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="506" src="https://www.osradar.com/wp-content/uploads/2020/01/6-2-1024x506.png" alt="6.- PHP and Lighttpd working" class="wp-image-17512" srcset="https://www.osradar.com/wp-content/uploads/2020/01/6-2-1024x506.png 1024w, https://www.osradar.com/wp-content/uploads/2020/01/6-2-300x148.png 300w, https://www.osradar.com/wp-content/uploads/2020/01/6-2-768x379.png 768w, https://www.osradar.com/wp-content/uploads/2020/01/6-2-324x160.png 324w, https://www.osradar.com/wp-content/uploads/2020/01/6-2-696x344.png 696w, https://www.osradar.com/wp-content/uploads/2020/01/6-2-1068x528.png 1068w, https://www.osradar.com/wp-content/uploads/2020/01/6-2-850x420.png 850w, https://www.osradar.com/wp-content/uploads/2020/01/6-2.png 1354w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>6.- PHP and Lighttpd working</figcaption></figure>



<p>So, enjoy it.</p>



<h2>Conclusion</h2>



<p>Lighttpd stands out for being very light in the execution of web applications. So it can serve us for many interesting things in our daily work on a server. Today we have learned to install it on a server with Debian 10 and we have also added support for PHP.</p>



<p>Please share this post and join <a href="https://t.me/osradar" target="_blank" rel="noreferrer noopener" aria-label="our Telegram channel (opens in a new tab)">our Telegram channel</a>.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-lighttpd-debian-10/">How to install lighttpd on Debian 10?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/install-lighttpd-debian-10/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>How to install lighttpd web server on Ubuntu 18.04?</title>
		<link>https://www.osradar.com/how-to-install-lighttpd-web-server-on-ubuntu-18-04/</link>
					<comments>https://www.osradar.com/how-to-install-lighttpd-web-server-on-ubuntu-18-04/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Wed, 10 Oct 2018 01:00:27 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[bionic]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[how to install]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web server]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=6238</guid>

					<description><![CDATA[<p>On this site, we have talked a lot about web servers as it is a very popular topic in the development of current applications. In addition, configuring them is a delicate and vital task for an organization. On the other hand, you have to be efficient in the management of computer resources, so today I [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-lighttpd-web-server-on-ubuntu-18-04/">How to install lighttpd web server on Ubuntu 18.04?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>On this site, we have talked a lot about <a href="https://www.osradar.com/how-to-install-apache-mariadb-php7-lamp-on-opensuse-leap-15/" rel="noopener">web servers</a> as it is a very popular topic in the development of current applications. In addition, configuring them is a delicate and vital task for an organization. On the other hand, you have to be efficient in the management of computer resources, so today I will show you how to install <a href="https://www.lighttpd.net/" rel="noopener">Lighttpd</a> in Ubuntu 18.04.</p>
<p><strong>Lighttpd</strong> is a &#8220;secure, fast, compatible and very flexible&#8221; web server optimized for high-performance environments. It consumes very few resources compared to other web servers and especially fast for running AJAX applications. It is also open source and uses a BSD license and works on UNIX-like systems, such as Linux or BSD.</p>
<p>Combining Ubuntu 18.04 with Lighttpd is a safe bet if you want a fast, efficient and secure web server. Go for it.</p>
<h2>0. Prerequisites</h2>
<p>The idea is to install a complete web server using Lighttpd, PHP, and MariaDB in Ubuntu 18.04. It&#8217;s not complicated but you should keep in mind the following:</p>
<ul>
<li>It is advisable to have some knowledge about the use of the terminal.</li>
<li>Have root access to perform the commands.</li>
<li>Have a computer with Ubuntu 18.04.</li>
</ul>
<h2>1.- Upgrade the system</h2>
<p>It&#8217;s a good idea to start these tutorials by updating the system, making sure you have the latest security patches for your system. Open a terminal and run:</p>
<pre class="">:~$ sudo -i</pre>
<p>After entering the password you will be the root user. Next:</p>
<pre class="">:~# apt update &amp;&amp; apt upgrade</pre>
<p><figure id="attachment_6297" aria-describedby="caption-attachment-6297" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6297" src="https://www.osradar.com/wp-content/uploads/2018/10/1-6.png" alt="1.- Upgrading the system" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/1-6.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/1-6-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/1-6-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/1-6-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/1-6-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/1-6-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/1-6-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6297" class="wp-caption-text">1.- Upgrading the system</figcaption></figure></p>
<p>With this, you will have updated your system.</p>
<h2>2.- Install MariaDB</h2>
<p>MariaDB is a <a href="https://www.infoworld.com/article/3307112/mysql/mariadb-tutorial-get-started-with-mariadb.html" rel="noopener">fork</a> of Mysql. It is fully compatible with the former and is the most recommended for its experience of use. However, despite this, it is very powerful and reliable.</p>
<p>To install it, run:</p>
<pre class="">:~# apt install mariadb-server</pre>
<p><figure id="attachment_6298" aria-describedby="caption-attachment-6298" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6298" src="https://www.osradar.com/wp-content/uploads/2018/10/2-6.png" alt="2.- Installing MariaDB from the terminal" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/2-6.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/2-6-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/2-6-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/2-6-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/2-6-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/2-6-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/2-6-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6298" class="wp-caption-text">2.- Installing MariaDB from the terminal</figcaption></figure></p>
<p>Now you have to perform a configuration process. This is best done with <code>mysql_secure_installation</code> script.</p>
<pre class="">:~# mysql_secure_installation</pre>
<p><figure id="attachment_6299" aria-describedby="caption-attachment-6299" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6299" src="https://www.osradar.com/wp-content/uploads/2018/10/3-6.png" alt="3.- Configuring MariaDB" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/3-6.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/3-6-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/3-6-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/3-6-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/3-6-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/3-6-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/3-6-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6299" class="wp-caption-text">3.- Configuring MariaDB</figcaption></figure></p>
<p>After setting the root password, you will be asked some configuration questions. I will answer Y, N, Y, Y.</p>
<h2>3.- Install Lighttpd</h2>
<p>The easiest and most direct way to install Lighttpd on Ubuntu 18.04 is to do it from the official repositories.</p>
<pre class="">:~# apt install lighttpd</pre>
<p><figure id="attachment_6303" aria-describedby="caption-attachment-6303" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="wp-image-6303 size-full" src="https://www.osradar.com/wp-content/uploads/2018/10/4-44.png" alt="4.- This is the easiest way to install lighttpd" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/4-44.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/4-44-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/4-44-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/4-44-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/4-44-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/4-44-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/4-44-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6303" class="wp-caption-text">4.- This is the easiest way to install Lighttpd</figcaption></figure></p>
<p>And then you enable the service to start with the system.</p>
<pre class="">:~# systemctl enable lighttpd
:~# systemctl start lighttpd</pre>
<p><figure id="attachment_6304" aria-describedby="caption-attachment-6304" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6304" src="https://www.osradar.com/wp-content/uploads/2018/10/5-555.png" alt="5.- Enabling lighttpd service" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/5-555.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/5-555-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/5-555-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/5-555-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/5-555-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/5-555-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/5-555-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6304" class="wp-caption-text">5.- Enabling lighttpd service</figcaption></figure></p>
<p>In order to avoid problems between Lightppd and the firewall, run:</p>
<pre class="">:~# ufw allow 80/tcp
:~# ufw reload
:~# ufw enable</pre>
<p><figure id="attachment_6305" aria-describedby="caption-attachment-6305" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6305" src="https://www.osradar.com/wp-content/uploads/2018/10/6-6666.png" alt="6.- Setting some firewall rules" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/6-6666.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/6-6666-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/6-6666-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/6-6666-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/6-6666-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/6-6666-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/6-6666-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6305" class="wp-caption-text">6.- Setting some firewall rules</figcaption></figure></p>
<p>To check the installation, go to your web browser and try to access to <code>http://IP_SERVER</code>. If you see this then everything is OK.</p>
<p><figure id="attachment_6306" aria-describedby="caption-attachment-6306" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6306" src="https://www.osradar.com/wp-content/uploads/2018/10/7-77.png" alt="7.- lighttpd default page" width="1366" height="665" srcset="https://www.osradar.com/wp-content/uploads/2018/10/7-77.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/7-77-300x146.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/7-77-768x374.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/7-77-1024x499.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/7-77-696x339.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/7-77-1068x520.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/7-77-863x420.png 863w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6306" class="wp-caption-text">7.- lighttpd default page</figcaption></figure></p>
<h2>4.- Install PHP</h2>
<p>A web server needs a programming language to interpret and execute the applications built, so install PHP.</p>
<pre class="">:~# apt install php7.2 php7.2-fpm php7.2-mysql php7.2-cli php7.2-curl php7.2-xml</pre>
<p><figure id="attachment_6307" aria-describedby="caption-attachment-6307" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6307" src="https://www.osradar.com/wp-content/uploads/2018/10/8-88.png" alt="8.- Installing PHP" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/8-88.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/8-88-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/8-88-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/8-88-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/8-88-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/8-88-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/8-88-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6307" class="wp-caption-text">8.- Installing PHP</figcaption></figure></p>
<p>Next, edit the file <code>/etc/php/7.2/fpm/pool.d/www.conf</code></p>
<pre class="">:~# nano /etc/php/7.2/pool.d/www.conf</pre>
<p>Change the line&#8221;listen&#8221; to 127.0.0.1:9000.</p>
<p><figure id="attachment_6308" aria-describedby="caption-attachment-6308" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6308" src="https://www.osradar.com/wp-content/uploads/2018/10/9-99.png" alt="9.- Editing the PHP file configuration" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/9-99.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/9-99-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/9-99-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/9-99-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/9-99-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/9-99-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/9-99-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6308" class="wp-caption-text">9.- Editing the PHP file configuration</figcaption></figure></p>
<p>Next, edit the file<code> /etc/lighttpd/conf-available/15-fastcgi-php.conf</code> too.</p>
<pre class="">:~# nano /etc/lighttpd/conf-available/15-fastcgi-php.conf</pre>
<p>And change:</p>
<pre class="">"bin-path" =&gt; "/usr/bin/php-cgi",
"socket" =&gt; "/var/run/lighttpd/php.socket",</pre>
<p>To:</p>
<pre class="">"host" =&gt; "127.0.0.1",
"port" =&gt; "9000",</pre>
<p><figure id="attachment_6309" aria-describedby="caption-attachment-6309" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6309" src="https://www.osradar.com/wp-content/uploads/2018/10/10-10.png" alt="10.- Editing the PHP configuration file for PHPCGI" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/10-10.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/10-10-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/10-10-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/10-10-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/10-10-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/10-10-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/10-10-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6309" class="wp-caption-text">10.- Editing the PHP configuration file for PHP CGI</figcaption></figure></p>
<p>Finally, enable the FastCGI and FastCGI-PHP modules:</p>
<pre class="">:~# lighty-enable-mod fastcgi
:~# lighty-enable-mod fastcgi-php</pre>
<p><figure id="attachment_6310" aria-describedby="caption-attachment-6310" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6310" src="https://www.osradar.com/wp-content/uploads/2018/10/11-11.png" alt="11.- Enabling the PHP modules" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/11-11.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/11-11-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/11-11-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/11-11-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/11-11-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/11-11-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/11-11-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6310" class="wp-caption-text">11.- Enabling the PHP modules</figcaption></figure></p>
<p>Restart Lighttpd:</p>
<pre class="">:~# systemctl restart lighttpd</pre>
<h2>5. Testing the installation</h2>
<p>To verify that everything is working, make a .php file in the root directory of the server, i.e. in <code>/var/www/html</code>. I&#8217;ll call it <code>t.php</code>. Put on it this:</p>
<pre class="">&lt;?php
phpinfo();
?&gt;</pre>
<p><figure id="attachment_6311" aria-describedby="caption-attachment-6311" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6311" src="https://www.osradar.com/wp-content/uploads/2018/10/12-12.png" alt="12.- Creating a php file for test" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/12-12.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/12-12-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/12-12-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/12-12-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/12-12-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/12-12-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/12-12-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6311" class="wp-caption-text">12.- Creating a PHP file for test</figcaption></figure></p>
<p>Change the permissions:</p>
<pre class="">:~# chown -R www-data:www-data /var/www/html/
:~# chown -R 755 /var/www/html/</pre>
<p><figure id="attachment_6312" aria-describedby="caption-attachment-6312" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6312" src="https://www.osradar.com/wp-content/uploads/2018/10/13-13.png" alt="13.- Changing the permissions to folder" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/13-13.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/13-13-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/13-13-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/13-13-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/13-13-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/13-13-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/13-13-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6312" class="wp-caption-text">13.- Changing the permissions to the folder</figcaption></figure></p>
<p>Finally, open your web browser and go to <code>http://IP_SERVER/t.php</code>. If you see this, everything is working.</p>
<p><figure id="attachment_6313" aria-describedby="caption-attachment-6313" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6313" src="https://www.osradar.com/wp-content/uploads/2018/10/14-14.png" alt="14.- PHP info" width="1366" height="665" srcset="https://www.osradar.com/wp-content/uploads/2018/10/14-14.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/14-14-300x146.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/14-14-768x374.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/14-14-1024x499.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/14-14-696x339.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/14-14-1068x520.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/14-14-863x420.png 863w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6313" class="wp-caption-text">14.- PHP info</figcaption></figure></p>
<h2>Conclusion</h2>
<p>To install Lighttpd only basic knowledge about the use of the terminal and configuration files is required because it is really simple. Being this a web server oriented to simplicity and speed we find simple files to configure.</p>
<p>We want to know about you, have you used this program before? you have been using the tutorial? what about your experience with PHP and Lighttpd? Let us know in the comments.</p>
<p>Please share this article on your social networks.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-lighttpd-web-server-on-ubuntu-18-04/">How to install lighttpd web server on Ubuntu 18.04?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-install-lighttpd-web-server-on-ubuntu-18-04/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
