<?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>Plesk Archives - CNERIS</title>
	<atom:link href="https://cneris.com/en/category/system-administration/plesk-en/feed/" rel="self" type="application/rss+xml" />
	<link>https://cneris.com/en/category/system-administration/plesk-en/</link>
	<description></description>
	<lastBuildDate>Tue, 29 Oct 2024 09:09:24 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>
	<item>
		<title>A PHP session was created by a session_start() function call. This interferes with REST API and loopback requests. The session should be closed by session_write_close() before making any HTTP requests.</title>
		<link>https://cneris.com/en/a-php-session-was-created-by-a-session_start-function-call-this-interferes-with-rest-api-and-loopback-requests-the-session-should-be-closed-by-session_write_close-before-making-any-http-requests-2/</link>
					<comments>https://cneris.com/en/a-php-session-was-created-by-a-session_start-function-call-this-interferes-with-rest-api-and-loopback-requests-the-session-should-be-closed-by-session_write_close-before-making-any-http-requests-2/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 29 Oct 2024 09:09:24 +0000</pubDate>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[Dedicated servers]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[session_close]]></category>
		<category><![CDATA[session_start]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://cneris.com/?p=2680</guid>

					<description><![CDATA[<p>This error occurs because the session_start() function is creating a PHP session, which interferes with REST API and loopback requests in WordPress. To resolve this: Locate the session_start() code Search your theme or active plugins for the session_start() function. It may be in the theme’s functions.php file or in a custom plugin. Add session_write_close() after [...]</p>
<p>The post <a href="https://cneris.com/en/a-php-session-was-created-by-a-session_start-function-call-this-interferes-with-rest-api-and-loopback-requests-the-session-should-be-closed-by-session_write_close-before-making-any-http-requests-2/">A PHP session was created by a session_start() function call. This interferes with REST API and loopback requests. The session should be closed by session_write_close() before making any HTTP requests.</a> appeared first on <a href="https://cneris.com/en">CNERIS</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This error occurs because the <code>session_start()</code> function is creating a PHP session, which interferes with REST API and loopback requests in WordPress. To resolve this:</p>
<ol>
<li><strong>Locate the <code>session_start()</code> code</strong><br />
Search your theme or active plugins for the <code>session_start()</code> function. It may be in the theme’s <code>functions.php</code> file or in a custom plugin.</li>
<li><strong>Add <code>session_write_close()</code> after <code>session_start()</code></strong><br />
Ensure <code>session_write_close()</code> is called after each <code>session_start()</code> call, before making any HTTP requests. This will close the session and allow the REST API to work correctly. For example:</p>
<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-php"><span class="hljs-title function_ invoke__">session_start</span>();<br />
<span class="hljs-comment">// Your code here</span><br />
<span class="hljs-title function_ invoke__">session_write_close</span>();<br />
</code></div>
</div>
</li>
<li><strong>Use the <code>init</code> hook in WordPress</strong><br />
If <code>session_start()</code> needs to be in <code>functions.php</code>, make sure to wrap it in the <code>init</code> hook and use <code>session_write_close()</code> like this:</p>
<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-php"><span class="hljs-title function_ invoke__">add_action</span>(<span class="hljs-string">'init'</span>, function() {<br />
    <span class="hljs-keyword">if</span> (!<span class="hljs-title function_ invoke__">session_id</span>()) {<br />
        <span class="hljs-title function_ invoke__">session_start</span>();<br />
        <span class="hljs-title function_ invoke__">session_write_close</span>();<br />
    }<br />
});</code></div>
</div>
</li>
</ol>
<p>The post <a href="https://cneris.com/en/a-php-session-was-created-by-a-session_start-function-call-this-interferes-with-rest-api-and-loopback-requests-the-session-should-be-closed-by-session_write_close-before-making-any-http-requests-2/">A PHP session was created by a session_start() function call. This interferes with REST API and loopback requests. The session should be closed by session_write_close() before making any HTTP requests.</a> appeared first on <a href="https://cneris.com/en">CNERIS</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cneris.com/en/a-php-session-was-created-by-a-session_start-function-call-this-interferes-with-rest-api-and-loopback-requests-the-session-should-be-closed-by-session_write_close-before-making-any-http-requests-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How you can set a default featured image for each post category</title>
		<link>https://cneris.com/en/how-you-can-set-a-default-featured-image-for-each-post-category/</link>
					<comments>https://cneris.com/en/how-you-can-set-a-default-featured-image-for-each-post-category/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 29 Oct 2024 08:59:48 +0000</pubDate>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[Dedicated servers]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[featured image]]></category>
		<category><![CDATA[post category]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://cneris.com/?p=2671</guid>

					<description><![CDATA[<p>In WordPress, you can set a default featured image for each post category by using a snippet of code in your theme's functions.php file. This code checks if a post has a featured image assigned; if not, it sets a default image based on the post's category. Code to Assign Default Featured Image by Category [...]</p>
<p>The post <a href="https://cneris.com/en/how-you-can-set-a-default-featured-image-for-each-post-category/">How you can set a default featured image for each post category</a> appeared first on <a href="https://cneris.com/en">CNERIS</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In WordPress, you can set a default featured image for each post category by using a snippet of code in your theme&#8217;s <code>functions.php</code> file. This code checks if a post has a featured image assigned; if not, it sets a default image based on the post&#8217;s category.</p>
<h4>Code to Assign Default Featured Image by Category</h4>
<ol>
<li>Open your theme&#8217;s <code>functions.php</code> file (preferably a child theme to avoid losing changes with updates).</li>
<li>Add the following code, replacing the URLs with your default images for each category:</li>
</ol>
<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-php"><br />
</code></div>
</div>
<p>function set_default_thumbnail($post_id) {<br />
if (has_post_thumbnail($post_id)) {<br />
return;<br />
}</p>
<p>// Define default images for each category<br />
$default_images = [<br />
&#8216;category-1&#8217; =&gt; &#8216;https://your-site.com/wp-content/uploads/category-image1.jpg&#8217;,<br />
&#8216;category-2&#8217; =&gt; &#8216;https://your-site.com/wp-content/uploads/category-image2.jpg&#8217;,<br />
&#8216;category-3&#8217; =&gt; &#8216;https://your-site.com/wp-content/uploads/category-image3.jpg&#8217;,<br />
];</p>
<p>// Get post categories<br />
$categories = get_the_category($post_id);</p>
<p>// Check if categories are assigned and find a matching default image<br />
foreach ($categories as $category) {<br />
if (array_key_exists($category-&gt;slug, $default_images)) {<br />
$image_url = $default_images[$category-&gt;slug];</p>
<p>// Download image and set as featured image<br />
$image_id = attach_image_from_url($image_url, $post_id);<br />
if ($image_id) {<br />
set_post_thumbnail($post_id, $image_id);<br />
}<br />
break;<br />
}<br />
}<br />
}<br />
add_action(&#8216;save_post&#8217;, &#8216;set_default_thumbnail&#8217;);</p>
<p>// Function to download and attach the image to the post<br />
function attach_image_from_url($image_url, $post_id) {<br />
$upload_dir = wp_upload_dir();<br />
$image_data = file_get_contents($image_url);<br />
$filename = basename($image_url);</p>
<p>if (wp_mkdir_p($upload_dir[&#8216;path&#8217;])) {<br />
$file = $upload_dir[&#8216;path&#8217;] . &#8216;/&#8217; . $filename;<br />
} else {<br />
$file = $upload_dir[&#8216;basedir&#8217;] . &#8216;/&#8217; . $filename;<br />
}</p>
<p>file_put_contents($file, $image_data);</p>
<p>$wp_filetype = wp_check_filetype($filename, null);<br />
$attachment = [<br />
&#8216;post_mime_type&#8217; =&gt; $wp_filetype[&#8216;type&#8217;],<br />
&#8216;post_title&#8217; =&gt; sanitize_file_name($filename),<br />
&#8216;post_content&#8217; =&gt; &#8221;,<br />
&#8216;post_status&#8217; =&gt; &#8216;inherit&#8217;<br />
];</p>
<p>$attach_id = wp_insert_attachment($attachment, $file, $post_id);<br />
require_once(ABSPATH . &#8216;wp-admin/includes/image.php&#8217;);<br />
$attach_data = wp_generate_attachment_metadata($attach_id, $file);<br />
wp_update_attachment_metadata($attach_id, $attach_data);</p>
<p>return $attach_id;<br />
}</p>
<h4>Code Explanation</h4>
<ul>
<li><strong><code>$default_images</code></strong>: Defines default images for each category using the category slug as the key and the image URL as the value.</li>
<li><strong><code>set_default_thumbnail</code></strong>: This function runs when a post is saved. If the post has no featured image, it finds the first category with a default image in <code>$default_images</code> and sets it as the featured image.</li>
<li><strong><code>attach_image_from_url</code></strong>: This function downloads the image from the URL and attaches it to the post as a media file, making it the featured image.</li>
</ul>
<p>This code will automatically assign a default featured image for new or edited posts based on their category.</p>
<p><strong>Note</strong>: Make sure to test this code in a development environment before implementing it on your live site, and replace the example URLs with your actual default image URLs.</p>
<p>The post <a href="https://cneris.com/en/how-you-can-set-a-default-featured-image-for-each-post-category/">How you can set a default featured image for each post category</a> appeared first on <a href="https://cneris.com/en">CNERIS</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cneris.com/en/how-you-can-set-a-default-featured-image-for-each-post-category/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>JPG Image Viewers in Linux Terminal</title>
		<link>https://cneris.com/en/jpg-image-viewers-in-linux-terminal/</link>
					<comments>https://cneris.com/en/jpg-image-viewers-in-linux-terminal/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Fri, 25 Oct 2024 19:32:35 +0000</pubDate>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[Dedicated servers]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[install catimg]]></category>
		<category><![CDATA[install fim]]></category>
		<category><![CDATA[install viu]]></category>
		<category><![CDATA[sudo apt install]]></category>
		<guid isPermaLink="false">https://cneris.com/?p=2546</guid>

					<description><![CDATA[<p>To view JPG files directly from the terminal in Linux, there are several tools available. Here are some popular viewers and how to use them: 1. FIM (Framebuffer Image Viewer) FIM is a command-line image viewer that utilizes the framebuffer to display images directly in the terminal. Installation: sudo apt install fim Usage: fim image.jpg [...]</p>
<p>The post <a href="https://cneris.com/en/jpg-image-viewers-in-linux-terminal/">JPG Image Viewers in Linux Terminal</a> appeared first on <a href="https://cneris.com/en">CNERIS</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>To view JPG files directly from the terminal in Linux, there are several tools available. Here are some popular viewers and how to use them:</p>
<h4>1. <strong>FIM (Framebuffer Image Viewer)</strong></h4>
<ul>
<li>FIM is a command-line image viewer that utilizes the framebuffer to display images directly in the terminal.</li>
<li><strong>Installation</strong>:
<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">sudo apt install fim<br />
</code></div>
</div>
</li>
<li><strong>Usage</strong>:
<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">fim image.jpg<br />
</code></div>
</div>
</li>
<li><strong>Example</strong>: Run <code>fim /path/to/image.jpg</code> to open an image in the terminal. FIM allows navigation through multiple images in a folder with arrow keys.</li>
</ul>
<h4>2. <strong>VIU</strong></h4>
<ul>
<li>Viu is another lightweight image viewer for the terminal, compatible with color images in most terminals.</li>
<li><strong>Installation</strong> (requires <code>cargo</code> from Rust):
<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">cargo install viu<br />
</code></div>
</div>
</li>
<li><strong>Usage</strong>:
<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">viu image.jpg<br />
</code></div>
</div>
</li>
<li><strong>Example</strong>: Run <code>viu /path/to/image.jpg</code> for a quick view. Viu is great for 24-bit color terminals.</li>
</ul>
<h4>3. <strong>Catimg</strong></h4>
<ul>
<li>Catimg converts images into ASCII format to display in the terminal.</li>
<li><strong>Installation</strong>:
<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">sudo apt install catimg<br />
</code></div>
</div>
</li>
<li><strong>Usage</strong>:
<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">catimg image.jpg<br />
</code></div>
</div>
</li>
<li><strong>Example</strong>: Run <code>catimg /path/to/image.jpg</code> to view an ASCII representation of the image.</li>
</ul>
<p>The post <a href="https://cneris.com/en/jpg-image-viewers-in-linux-terminal/">JPG Image Viewers in Linux Terminal</a> appeared first on <a href="https://cneris.com/en">CNERIS</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cneris.com/en/jpg-image-viewers-in-linux-terminal/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to increase the memory limit in WordPress (wp_max_memory_limit)?</title>
		<link>https://cneris.com/en/how-to-increase-the-memory-limit-in-wordpress-wp_max_memory_limit/</link>
					<comments>https://cneris.com/en/how-to-increase-the-memory-limit-in-wordpress-wp_max_memory_limit/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 20 Oct 2024 16:30:39 +0000</pubDate>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[Dedicated servers]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[restart the server]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp-config]]></category>
		<category><![CDATA[wp_memory_limit]]></category>
		<guid isPermaLink="false">https://cneris.com/?p=2496</guid>

					<description><![CDATA[<p>To increase the memory limit in WordPress (wp_max_memory_limit), you need to edit the wp-config.php file or your server's configuration file. Here are the steps: Edit the wp-config.php file: Access the wp-config.php file in your WordPress installation. Add the following line of code before the line that says "/* That's all, stop editing! */": define('WP_MEMORY_LIMIT', '256M'); [...]</p>
<p>The post <a href="https://cneris.com/en/how-to-increase-the-memory-limit-in-wordpress-wp_max_memory_limit/">How to increase the memory limit in WordPress (wp_max_memory_limit)?</a> appeared first on <a href="https://cneris.com/en">CNERIS</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>To increase the memory limit in WordPress (<strong>wp_max_memory_limit</strong>), you need to edit the <strong>wp-config.php</strong> file or your server&#8217;s configuration file. Here are the steps:</p>
<ol>
<li><strong>Edit the wp-config.php file</strong>:
<ul>
<li>Access the <strong>wp-config.php</strong> file in your WordPress installation.</li>
<li>Add the following line of code before the line that says &#8220;/* That&#8217;s all, stop editing! */&#8221;:
<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-php"><span class="hljs-title function_ invoke__">define</span>(<span class="hljs-string">'WP_MEMORY_LIMIT'</span>, <span class="hljs-string">'256M'</span>);<br />
</code></div>
</div>
</li>
</ul>
<p>This sets the memory limit to 256 MB. You can adjust the value depending on your needs, such as <strong>128M</strong> or <strong>512M</strong>.</li>
<li><strong>Edit php.ini</strong> (optional):
<ul>
<li>If you have access to the <strong>php.ini</strong> file on your server, find the line:
<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-ini"><span class="hljs-attr">memory_limit</span> = <span class="hljs-number">128</span>M<br />
</code></div>
</div>
</li>
<li>Change the value to a higher one, like <strong>256M</strong> or more, according to your requirements.</li>
</ul>
</li>
<li><strong>Restart the server</strong>:
<ul>
<li>After making the changes, if you modified the <strong>php.ini</strong> file, you need to restart the server for the changes to take effect.</li>
</ul>
</li>
</ol>
<p>The post <a href="https://cneris.com/en/how-to-increase-the-memory-limit-in-wordpress-wp_max_memory_limit/">How to increase the memory limit in WordPress (wp_max_memory_limit)?</a> appeared first on <a href="https://cneris.com/en">CNERIS</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cneris.com/en/how-to-increase-the-memory-limit-in-wordpress-wp_max_memory_limit/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Where can I configure the number of connections on the hosting?</title>
		<link>https://cneris.com/en/where-can-i-configure-the-number-of-connections-on-the-hosting/</link>
					<comments>https://cneris.com/en/where-can-i-configure-the-number-of-connections-on-the-hosting/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 13 Oct 2024 10:19:38 +0000</pubDate>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[Dedicated servers]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[connections]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php-fpm]]></category>
		<category><![CDATA[plesk]]></category>
		<category><![CDATA[system administration]]></category>
		<guid isPermaLink="false">https://cneris.com/?p=2457</guid>

					<description><![CDATA[<p>On a hosting server, the number of simultaneous connections that a server can handle can be configured at different levels, depending on the type of web server and the environment it's set up in. Below is a detailed guide on how to configure it for the most common web servers, like Apache, Nginx, and PHP-FPM: [...]</p>
<p>The post <a href="https://cneris.com/en/where-can-i-configure-the-number-of-connections-on-the-hosting/">Where can I configure the number of connections on the hosting?</a> appeared first on <a href="https://cneris.com/en">CNERIS</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>On a hosting server, the number of simultaneous connections that a server can handle can be configured at different levels, depending on the type of web server and the environment it&#8217;s set up in. Below is a detailed guide on how to configure it for the most common web servers, like <strong>Apache</strong>, <strong>Nginx</strong>, and <strong>PHP-FPM</strong>:</p>
<h4>1. <strong>Apache</strong></h4>
<p>Apache allows configuring the number of concurrent connections through its modules and directives in the main configuration file, usually located at <code>/etc/apache2/apache2.conf</code> or <code>/etc/httpd/httpd.conf</code>, depending on the operating system.</p>
<h5>Key parameters:</h5>
<ul>
<li><strong>MaxRequestWorkers</strong>: Defines the maximum number of simultaneous requests that Apache can handle.
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-apache">&lt;IfModule mpm_prefork_module&gt;<br />
MaxRequestWorkers 150<br />
&lt;/IfModule&gt;<br />
</code></div>
</div>
</li>
<li><strong>ServerLimit</strong>: Defines the maximum number of processes Apache can spawn.
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-apache">&lt;IfModule mpm_worker_module&gt;<br />
ServerLimit 256<br />
&lt;/IfModule&gt;<br />
</code></div>
</div>
</li>
<li><strong>MaxConnectionsPerChild</strong>: Defines the maximum number of connections each child process handles before being recycled.
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-apache">MaxConnectionsPerChild 1000<br />
</code></div>
</div>
</li>
</ul>
<p>After making these changes, restart Apache with:</p>
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">sudo systemctl restart apache2<br />
</code></div>
</div>
<h4>2. <strong>Nginx</strong></h4>
<p>In Nginx, the configuration of simultaneous connections is mainly controlled through the following parameters in the configuration file located at <code>/etc/nginx/nginx.conf</code>:</p>
<h5>Key parameters:</h5>
<ul>
<li><strong>worker_processes</strong>: Defines the number of worker processes Nginx will run. This should align with the number of CPU cores on the server.
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-nginx">worker_processes auto;<br />
</code></div>
</div>
</li>
<li><strong>worker_connections</strong>: Defines the maximum number of simultaneous connections that a single worker process can handle.
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-nginx">worker_connections 1024;<br />
</code></div>
</div>
</li>
<li><strong>events</strong>: This section allows configuring event handling parameters, such as the I/O method used.
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-nginx">events {<br />
worker_connections 1024;<br />
}<br />
</code></div>
</div>
</li>
</ul>
<p>The total number of simultaneous connections Nginx can handle is the product of <code>worker_processes</code> and <code>worker_connections</code>.</p>
<p>Once the changes are made, restart Nginx with:</p>
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">sudo systemctl restart nginx<br />
</code></div>
</div>
<h4>3. <strong>PHP-FPM</strong></h4>
<p>If your web application uses PHP-FPM to handle PHP requests, you should configure the number of concurrent connections in the <code>php-fpm.conf</code> file or in the pool files, located in <code>/etc/php/7.4/fpm/pool.d/www.conf</code> (the path may vary depending on the PHP version).</p>
<h5>Key parameters:</h5>
<ul>
<li><strong>pm.max_children</strong>: Sets the maximum number of PHP-FPM processes that can run simultaneously.
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-ini"><span class="hljs-attr">pm.max_children</span> = <span class="hljs-number">50</span><br />
</code></div>
</div>
</li>
<li><strong>pm.start_servers</strong>: The number of processes that start when the service begins.
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-ini"><span class="hljs-attr">pm.start_servers</span> = <span class="hljs-number">5</span><br />
</code></div>
</div>
</li>
<li><strong>pm.max_spare_servers</strong>: The maximum number of spare (idle) processes.
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-ini"><span class="hljs-attr">pm.max_spare_servers</span> = <span class="hljs-number">10</span><br />
</code></div>
</div>
</li>
</ul>
<p>After making changes, restart PHP-FPM:</p>
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">sudo systemctl restart php7.4-fpm</code></div>
</div>
<p>The post <a href="https://cneris.com/en/where-can-i-configure-the-number-of-connections-on-the-hosting/">Where can I configure the number of connections on the hosting?</a> appeared first on <a href="https://cneris.com/en">CNERIS</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cneris.com/en/where-can-i-configure-the-number-of-connections-on-the-hosting/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>how many maximum connections your MySQL server allows</title>
		<link>https://cneris.com/en/how-many-maximum-connections-your-mysql-server-allows/</link>
					<comments>https://cneris.com/en/how-many-maximum-connections-your-mysql-server-allows/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 13 Oct 2024 09:16:15 +0000</pubDate>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[Dedicated servers]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[maximum connections]]></category>
		<category><![CDATA[mysql server]]></category>
		<guid isPermaLink="false">https://cneris.com/?p=2449</guid>

					<description><![CDATA[<p>To check how many maximum connections your MySQL server allows, follow these steps: Open the MySQL command line: mysql -u root -p Once inside MySQL, run the following command to see the maximum allowed connections: SHOW VARIABLES LIKE 'max_connections'; This will display the current value of max_connections, which is the maximum number of simultaneous connections [...]</p>
<p>The post <a href="https://cneris.com/en/how-many-maximum-connections-your-mysql-server-allows/">how many maximum connections your MySQL server allows</a> appeared first on <a href="https://cneris.com/en">CNERIS</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>To check how many maximum connections your MySQL server allows, follow these steps:</p>
<ol>
<li>Open the MySQL command line:
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">mysql -u root -p<br />
</code></div>
</div>
</li>
<li>Once inside MySQL, run the following command to see the maximum allowed connections:
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-sql"><span class="hljs-keyword">SHOW</span> VARIABLES <span class="hljs-keyword">LIKE</span> <span class="hljs-string">'max_connections'</span>;<br />
</code></div>
</div>
<p>This will display the current value of <code>max_connections</code>, which is the maximum number of simultaneous connections MySQL can handle.</li>
</ol>
<p>The post <a href="https://cneris.com/en/how-many-maximum-connections-your-mysql-server-allows/">how many maximum connections your MySQL server allows</a> appeared first on <a href="https://cneris.com/en">CNERIS</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cneris.com/en/how-many-maximum-connections-your-mysql-server-allows/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Complete Manual for Lsyncd Usage and Configuration</title>
		<link>https://cneris.com/en/complete-manual-for-lsyncd-usage-and-configuration/</link>
					<comments>https://cneris.com/en/complete-manual-for-lsyncd-usage-and-configuration/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 25 Aug 2024 14:24:25 +0000</pubDate>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[Dedicated servers]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Live Syncing Daemon]]></category>
		<category><![CDATA[lsyncd]]></category>
		<guid isPermaLink="false">https://cneris.com/?p=2142</guid>

					<description><![CDATA[<p>1. Introduction to Lsyncd Lsyncd (Live Syncing Daemon) is a tool that combines file system monitoring using inotify with the file synchronization capabilities of rsync. It's ideal for near real-time synchronization between servers, especially when a simple and efficient solution is needed. 2. Installing Lsyncd To install Lsyncd on a Debian/Ubuntu-based system, use the following [...]</p>
<p>The post <a href="https://cneris.com/en/complete-manual-for-lsyncd-usage-and-configuration/">Complete Manual for Lsyncd Usage and Configuration</a> appeared first on <a href="https://cneris.com/en">CNERIS</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong>1. Introduction to Lsyncd</strong></p>
<p>Lsyncd (Live Syncing Daemon) is a tool that combines file system monitoring using inotify with the file synchronization capabilities of rsync. It&#8217;s ideal for near real-time synchronization between servers, especially when a simple and efficient solution is needed.</p>
<p><strong>2. Installing Lsyncd</strong></p>
<p>To install Lsyncd on a Debian/Ubuntu-based system, use the following commands:</p>
<div class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium">
<div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">sudo apt-get update<br />
sudo apt-get install lsyncd<br />
</code></div>
</div>
<p>On Red Hat/CentOS-based systems, use:</p>
<div class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium">
<div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">sudo yum install epel-release<br />
sudo yum install lsyncd<br />
</code></div>
</div>
<p><strong>3. Basic Configuration of Lsyncd</strong></p>
<p>Lsyncd is configured using a Lua configuration file. The most common configuration file is located at <code>/etc/lsyncd/lsyncd.conf.lua</code>.</p>
<p>Basic configuration example:</p>
<div class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium">
<div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-lua">settings {<br />
   logfile    = <span class="hljs-string">"/var/log/lsyncd/lsyncd.log"</span>,<br />
   statusFile = <span class="hljs-string">"/var/log/lsyncd/lsyncd-status.log"</span>,<br />
   nodaemon   = <span class="hljs-literal">false</span>,<br />
}</p>
<p>sync {<br />
   default.rsyncssh,<br />
   source    = <span class="hljs-string">"/local/path/to/sync"</span>,<br />
   host      = <span class="hljs-string">"user@remote_server"</span>,<br />
   targetdir = <span class="hljs-string">"/remote/destination/path"</span>,<br />
   rsyncOpts = {<span class="hljs-string">"-avz"</span>},<br />
   ssh = {<br />
      port = <span class="hljs-number">22</span>,<br />
      password = <span class="hljs-string">"user_password"</span><br />
   }<br />
}<br />
</code></div>
</div>
<p><strong>4. Explanation of Key Parameters</strong></p>
<ul>
<li><code>logfile</code>: File where Lsyncd logs are stored.</li>
<li><code>statusFile</code>: File where synchronization status is saved.</li>
<li><code>nodaemon</code>: If set to <code>false</code>, Lsyncd runs in the background.</li>
<li><code>source</code>: Local folder to be synchronized.</li>
<li><code>host</code>: User and address of the remote server.</li>
<li><code>targetdir</code>: Destination directory on the remote server.</li>
<li><code>rsyncOpts</code>: Options passed to rsync for synchronization.</li>
<li><code>ssh</code>: SSH settings, such as port and password.</li>
</ul>
<p><strong>5. Running and Monitoring Lsyncd</strong></p>
<p>To start Lsyncd, simply run:</p>
<div class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium">
<div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">sudo lsyncd /etc/lsyncd/lsyncd.conf.lua<br />
</code></div>
</div>
<p>You can verify that it&#8217;s working by checking the log file specified in the configuration (<code>/var/log/lsyncd/lsyncd.log</code>).</p>
<p><strong>6. Advanced Usage</strong></p>
<p>If you need more advanced configurations, you can add exclusions, perform custom actions before or after synchronization, or handle multiple synchronizations simultaneously in the configuration file.</p>
<p><strong>7. Security Considerations</strong></p>
<p>It&#8217;s important to consider the security of password authentication. For a more secure environment, it&#8217;s recommended to use SSH key-based authentication instead of passwords.</p>
<p><strong>8. Conclusion</strong></p>
<p>Lsyncd is a powerful and flexible tool for real-time file synchronization between servers. With proper configuration, you can keep your servers efficiently synchronized.</p>
<p>The post <a href="https://cneris.com/en/complete-manual-for-lsyncd-usage-and-configuration/">Complete Manual for Lsyncd Usage and Configuration</a> appeared first on <a href="https://cneris.com/en">CNERIS</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cneris.com/en/complete-manual-for-lsyncd-usage-and-configuration/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Plesk update fails after converting the server from Centos 8 to AlmaLinux 8: Failed to download metadata for repo &#8216;PLESK_18_0_41-extras&#8217;</title>
		<link>https://cneris.com/en/plesk-update-fails-after-converting-the-server-from-centos-8-to-almalinux-8-failed-to-download-metadata-for-repo-plesk_18_0_41-extras-2/</link>
					<comments>https://cneris.com/en/plesk-update-fails-after-converting-the-server-from-centos-8-to-almalinux-8-failed-to-download-metadata-for-repo-plesk_18_0_41-extras-2/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 25 Aug 2024 12:08:27 +0000</pubDate>
				<category><![CDATA[Plesk]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[plesk issue]]></category>
		<category><![CDATA[plesk repo]]></category>
		<category><![CDATA[rename plesk repo]]></category>
		<guid isPermaLink="false">https://cneris.com/?p=2134</guid>

					<description><![CDATA[<p>The error you're encountering when trying to update Plesk after converting your server from CentOS 8 to AlmaLinux 8, specifically the "Failed to download metadata for repo 'PLESK_18_0_41-extras'" message, occurs because the Plesk repositories are not properly configured for the new distribution. Solution: Clear YUM/DNF cache: First, clean the package manager cache to ensure it [...]</p>
<p>The post <a href="https://cneris.com/en/plesk-update-fails-after-converting-the-server-from-centos-8-to-almalinux-8-failed-to-download-metadata-for-repo-plesk_18_0_41-extras-2/">Plesk update fails after converting the server from Centos 8 to AlmaLinux 8: Failed to download metadata for repo &#8216;PLESK_18_0_41-extras&#8217;</a> appeared first on <a href="https://cneris.com/en">CNERIS</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The error you&#8217;re encountering when trying to update Plesk after converting your server from CentOS 8 to AlmaLinux 8, specifically the &#8220;Failed to download metadata for repo &#8216;PLESK_18_0_41-extras'&#8221; message, occurs because the Plesk repositories are not properly configured for the new distribution.</p>
<h4>Solution:</h4>
<ol>
<li><strong>Clear YUM/DNF cache:</strong> First, clean the package manager cache to ensure it is not using outdated information:
<div class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium">
<div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">sudo dnf clean all<br />
sudo <span class="hljs-built_in">rm</span> -rf /var/cache/dnf<br />
</code></div>
</div>
</li>
<li><strong>Reconfigure Plesk repositories:</strong> Download and reconfigure the Plesk repositories specifically for AlmaLinux 8. Use the following command to reconfigure them:
<div class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium">
<div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">sudo plesk installer --select-release-current --reinstall-patch --upgrade-installed-components<br />
</code></div>
</div>
</li>
<li><strong>Update the system:</strong> After reconfiguring the repositories, attempt to update Plesk again:
<div class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium">
<div class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">sudo dnf update<br />
</code></div>
</div>
</li>
<li><strong>Verify the repositories:</strong> Ensure that the Plesk repository is pointing to the correct version for AlmaLinux 8. You can edit the repository files in <code>/etc/yum.repos.d/</code> if needed.</li>
<li><strong>Contact Plesk support:</strong> If the above steps do not resolve the issue, it may be necessary to contact Plesk support for further assistance.</li>
<li><strong>Rename plesk repo:</strong> mv /etc/yum.repos.d/plesk.repo /etc/yum.repos.d/plesk.repo.bk</li>
</ol>
<p>The post <a href="https://cneris.com/en/plesk-update-fails-after-converting-the-server-from-centos-8-to-almalinux-8-failed-to-download-metadata-for-repo-plesk_18_0_41-extras-2/">Plesk update fails after converting the server from Centos 8 to AlmaLinux 8: Failed to download metadata for repo &#8216;PLESK_18_0_41-extras&#8217;</a> appeared first on <a href="https://cneris.com/en">CNERIS</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cneris.com/en/plesk-update-fails-after-converting-the-server-from-centos-8-to-almalinux-8-failed-to-download-metadata-for-repo-plesk_18_0_41-extras-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
