<?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>lighhtpd Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/lighhtpd/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Wed, 14 Apr 2021 22:20:59 +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 CentOS 8 / AlmaLinux?</title>
		<link>https://www.osradar.com/how-to-install-lighttpd-almalinux-centos/</link>
					<comments>https://www.osradar.com/how-to-install-lighttpd-almalinux-centos/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Sat, 17 Apr 2021 03:11:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[almalinux]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[lighhtpd]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=29549</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 AlmaLinux / CentOS 8 Lighttpd is a “secure, fast, compatible, and very flexible” web server optimized for high-performance environments. It consumes very few resources [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-lighttpd-almalinux-centos/">How to install lighttpd on CentOS 8 / AlmaLinux?</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 how to install Lighttpd on AlmaLinux / CentOS 8</p>



<p><a href="https://www.lighttpd.net/" target="_blank" rel="noreferrer noopener">Lighttpd</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>A server with AlmaLinux as an operating system together with Lighttpd is a guarantee for an efficient and resource-efficient web server.</p>



<h2 id="install-lighttpd-on-almalinux-/-centos-8"><a href="#install-lighttpd-on-almalinux-/-centos-8" name="install-lighttpd-on-almalinux-/-centos-8"></a>Install Lighttpd on AlmaLinux / CentOS 8</h2>



<p>Installing Lighttpd is very easy to do but there are a few extra configurations to do.</p>



<p>Let’s start by adding the <a href="https://www.osradar.com/nable-the-epel-repository-centos-rhel-oracle-linux-8/" target="_blank" rel="noreferrer noopener"><code>EPEL</code> repository</a> to the system because that is where the lighttpd package is hosted.</p>



<pre class="wp-block-preformatted">sudo dnf install epel-release</pre>



<p>Then, you can install the program by running the following command:</p>



<pre class="wp-block-preformatted">sudo dnf install lighttpd</pre>



<p>This will install the package immediately.</p>



<p>By default, AlmaLinux does not start the service when a program is installed. Therefore we have to do it.</p>



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



<p>And now make the service start with the system.</p>



<pre class="wp-block-preformatted">sudo systemctl enable lighttpd</pre>



<p>Then, you can test the operation of the service with the command</p>



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



<p>Output</p>



<pre class="wp-block-preformatted">● lighttpd.service - Lightning Fast Webserver With Light System Requirements
   Loaded: loaded (/usr/lib/systemd/system/lighttpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2021-04-14 16:54:29 CEST; 11s ago
 Main PID: 1247 (lighttpd)
    Tasks: 1 (limit: 12142)
   Memory: 1.1M
   CGroup: /system.slice/lighttpd.service
           └─1247 /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf

Apr 14 16:54:29 osradar systemd[1]: Started Lightning Fast Webserver With Light System Requirements.
Apr 14 16:54:29 osradar lighttpd[1247]: 2021-04-14 16:54:29: (server.c.1404) can't have more connections than fds/2:  1024 1024
</pre>



<p>Also, you can check the installed version with the command:</p>



<pre class="wp-block-preformatted">lighttpd -v
lighttpd/1.4.55 (ssl) - a light and fast webserver</pre>



<h2 id="install-php-on-almalinux-/-centos-8"><a href="#install-php-on-almalinux-/-centos-8" name="install-php-on-almalinux-/-centos-8"></a>Install PHP on AlmaLinux / CentOS 8</h2>



<p>One way to test the performance of the webserver, you have to <a href="https://www.osradar.com/configuring-php-opcache-apache-nginx/" target="_blank" rel="noreferrer noopener">install PHP</a> and make it work with Lighttpd</p>



<pre class="wp-block-preformatted">sudo dnf install php php-mysqlnd php-pdo php-gd php-mbstring php-fpm php-fpm lighttpd-fastcgi</pre>



<p>Now we need to make it work with Lighttpd by editing some configuration files.</p>



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



<p>And modify the <code>group</code> and <code>user</code> values to be <code>lighttpd</code> values.</p>



<pre class="wp-block-preformatted">user = lighttpd
group = lighttpd</pre>



<p>In this same file, modify the value of <code>listen</code> to this one</p>



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



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



<p>Now edit the <code>/etc/php.ini</code> file, which also needs to be modified by one value</p>



<pre class="wp-block-preformatted">sudo nano /etc/php.ini</pre>



<p>And edit the <code>cgi.fix_pathinfo</code> value to <code>1</code>.</p>



<pre class="wp-block-preformatted">cgi.fix_pathinfo=1</pre>



<p>Now, make another change to the <code>/etc/lighttpd/modules.conf</code> file and uncomment the following line:</p>



<pre class="wp-block-preformatted">include "conf.d/fastcgi.conf"</pre>



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



<p>Finally, we have to edit another configuration file called <code>fastcgi.conf</code> where we have to add the server that will listen for PHP requests.</p>



<pre class="wp-block-preformatted">sudo nano /etc/lighttpd/conf.d/fastcgi.conf</pre>



<p>And add this to the end of the file</p>



<pre class="wp-block-preformatted">fastcgi.server += ( ".php" =>
         ((
                 "host" => "127.0.0.1",
                 "port" => "9000",
                 "broken-scriptfilename" => "enable"
         ))
 )</pre>



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



<p>Then, restart the <code>lighttpd</code> service and start and enable <code>php-fpm</code>.</p>



<pre class="wp-block-preformatted">sudo systemctl restart lighttpd
sudo systemctl start php-fpm.service
sudo systemctl enable php-fpm.service</pre>



<h3 id="test-lighttpd-and-php-on-almalinux-/-centos-8"><a href="#test-lighttpd-and-php-on-almalinux-/-centos-8" name="test-lighttpd-and-php-on-almalinux-/-centos-8"></a>Test Lighttpd and PHP on AlmaLinux / CentOS 8</h3>



<p>The best way to know if everything is OK is to create a PHP file and check if it is interpreted.</p>



<p>So, create a PHP file with any valid code such as the <code>phpinfo</code> method in the default root directory.</p>



<pre class="wp-block-preformatted">sudo nano /var/www/lighttpd/info.php

<code data-origin="<pre&gt;<code&gt;sudo nano /var/www/lighttpd/info.php

<?php
phpinfo();
?&gt;
</code&gt;</pre&gt;
<p&gt;">&lt;?php
phpinfo();
?>
</code></pre>



<p>Save the changes and access it from a web browser, for example <code>http://your-domain/info.php</code> or <code>http://ip-server/info.php</code>.</p>



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



<p>This checks that everything is working properly.</p>



<h2 id="conclusion"><a href="#conclusion" name="conclusion"></a>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 our Telegram channel.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-lighttpd-almalinux-centos/">How to install lighttpd on CentOS 8 / AlmaLinux?</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-almalinux-centos/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
