<?xml version="1.0"?>
<rss version="2.0"><channel><title>Ubuntu/Debian Latest Topics</title><link>https://www.alphagnu.com/forum/12-ubuntudebian/</link><description>Ubuntu/Debian Latest Topics</description><language>en</language><item><title>How to fix GPG key error occurred during the signature verification DEB.SURY.ORG in Ubuntu/Debian</title><link>https://www.alphagnu.com/topic/283-how-to-fix-gpg-key-error-occurred-during-the-signature-verification-debsuryorg-in-ubuntudebian/</link><description><![CDATA[<p>
	Fix the GPG key error EXPKEYSIG B188E2B695BD4743 DEB.SURY.ORG Automatic Signing Key &lt;deb@sury.org&gt;
</p>

<p>
	The DEB.SURY.ORG Debian/ubuntu package repository has changed its package signing key. By running the below commands will fix the issue <span>:</span>
</p>

<pre class="ipsCode">rm -rf /etc/apt/sources.list.d/php.list
apt-get update
apt-get -y install lsb-release ca-certificates curl
rm -rf /tmp/debsuryorg-archive-keyring.deb
curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
dpkg -i /tmp/debsuryorg-archive-keyring.deb
sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" &gt; /etc/apt/sources.list.d/php.list'
apt-get update
</pre>

<p>
	then again run apt update command and upgrade command <span><span>:</span></span>
</p>

<pre class="ipsCode prettyprint lang-html prettyprinted"><span class="pln">apt-get update
apt-get upgrade</span></pre>

<p>
	 
</p>
]]></description><guid isPermaLink="false">283</guid><pubDate>Wed, 28 Feb 2024 00:57:57 +0000</pubDate></item><item><title>Securing Memcached from UDP attack in Debian and Ubuntu server</title><link>https://www.alphagnu.com/topic/40-securing-memcached-from-udp-attack-in-debian-and-ubuntu-server/</link><description><![CDATA[<p>
	<span> </span> 
</p>

<p>
	In this tutorial we’ll secure Memcached server from UDP attacks in Dwbian and ubuntu servers which are common now a days, if you’re not using firewall and the memcached port is closed for the world you’re safe from this attacks.
</p>

<p>
	If your Memcached server is only used by your local server then add the below line which will disable UDP  and only listen to localhost IP, which will prevent your server from being exposed on the internet by disabling the UDP protocol. UDP Protocol is now old technology which is not required anymore. TCP is more secure and today all are using it with Memcached.
</p>

<p>
	Edit memcached config file :
</p>

<pre class="ipsCode">nano /etc/memcached.conf</pre>

<p>
	<br />
	Add this line -l 127.0.0.1 -U 0 at the end of the file :
</p>

<pre class="ipsCode">-l 127.0.0.1 -U 0</pre>

<p>
	<br />
	If your Memcached server is binding with ip, add the following OPTIONS line, which will only disable the UDP protocol:
</p>

<pre class="ipsCode">-l -U 0</pre>

<p>
	<br />
	After that you need to restart the memcached server  and done.
</p>

<pre class="ipsCode">systemctl restart memcached</pre>
]]></description><guid isPermaLink="false">40</guid><pubDate>Wed, 07 Jun 2023 14:51:40 +0000</pubDate></item><item><title>Cloudflare Restoring original visitor IPs with mod_remoteip in Ubuntu Apache</title><link>https://www.alphagnu.com/topic/31-cloudflare-restoring-original-visitor-ips-with-mod_remoteip-in-ubuntu-apache/</link><description><![CDATA[<p>
	In this tutorial I’ll guide you how to install mod_remoteip an Apache module to restore original visitor’s ip When using cloudflare service. You may have encountered issue with cloudflare proxy ip when you checked the log and found all the ips are from cloudflare to cope with this situation we need to configure mod_remoteip with cloudflare’s trusted address. Lets get started :
</p>

<p>
	Ensure you logged in as root user, ssh.
</p>

<p>
	<strong>Step 1 :</strong>
</p>

<p>
	Enable mod_remoteip :
</p>

<pre class="ipsCode">a2enmod remoteip</pre>

<p>
	<br />
	<strong>Step 2 :</strong>
</p>

<p>
	Now we need to modify and add some configs to apache2.conf
</p>

<p>
	apt install nano<br />
	nano /etc/apache2/apache2.conf<br />
	Now add this line at the last of the config file :
</p>

<p>
	RemoteIPHeader X-Forwarded-For<br />
	Now you need to replace the line for log format :
</p>

<p>
	Find :
</p>

<pre class="ipsCode">LogFormat "%h %l %u %t \"%r\" %&gt;s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined </pre>

<p>
	<br />
	and replace that line with :
</p>

<pre class="ipsCode">LogFormat "%a %h  %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined </pre>

<p>
	<br />
	i.e. I’ve added only “%a”
</p>

<p>
	<strong>Step 3 :</strong>
</p>

<p>
	Then we need to create Apache Cloudflare trusted proxies conf file :
</p>

<p>
	**create “<strong>remoteip.conf</strong>” file in location <strong>“/etc/apache2/conf-available/”</strong>
</p>

<pre class="ipsCode">nano /etc/apache2/conf-available/remoteip.conf</pre>

<p>
	<br />
	Now paste this config and save it :
</p>

<pre class="ipsCode">RemoteIPHeader CF-Connecting-IP
RemoteIPTrustedProxy 173.245.48.0/20
RemoteIPTrustedProxy 103.21.244.0/22
RemoteIPTrustedProxy 103.22.200.0/22
RemoteIPTrustedProxy 103.31.4.0/22
RemoteIPTrustedProxy 141.101.64.0/18
RemoteIPTrustedProxy 108.162.192.0/18
RemoteIPTrustedProxy 190.93.240.0/20
RemoteIPTrustedProxy 188.114.96.0/20
RemoteIPTrustedProxy 197.234.240.0/22
RemoteIPTrustedProxy 198.41.128.0/17
RemoteIPTrustedProxy 162.158.0.0/15
RemoteIPTrustedProxy 104.16.0.0/12
RemoteIPTrustedProxy 172.64.0.0/13
RemoteIPTrustedProxy 131.0.72.0/22
RemoteIPTrustedProxy 2400:cb00::/32
RemoteIPTrustedProxy 2606:4700::/32
RemoteIPTrustedProxy 2803:f800::/32
RemoteIPTrustedProxy 2405:b500::/32
RemoteIPTrustedProxy 2405:8100::/32
RemoteIPTrustedProxy 2a06:98c0::/29
RemoteIPTrustedProxy 2c0f:f248::/32</pre>

<p>
	<br />
	Next restart Apache service and check the log and check the real ips are now logging :
</p>

<pre class="ipsCode">systemctl restart apache2</pre>

<p>
	 
</p>
]]></description><guid isPermaLink="false">31</guid><pubDate>Sat, 03 Jun 2023 17:26:51 +0000</pubDate></item><item><title>Install Latest curl version 8.3.0 on Ubuntu 22.04/20.04/Debian 12/HestiaCP</title><link>https://www.alphagnu.com/topic/7-install-latest-curl-version-830-on-ubuntu-22042004debian-12hestiacp/</link><description><![CDATA[<p>
	install Latest version of curl on Ubuntu OS/server. By default Ubuntu curl version is old and doesn’t have any updated package available. You can follow this tutorial to install latest version of curl on Ubuntu server.
</p>

<p>
	Short Description on curl :
</p>

<p>
	curl is a command line tool and library for transferring data with URL syntax, supporting HTTP, HTTPS, FTP, FTPS, GOPHER, TFTP, SCP, SFTP, SMB, TELNET, DICT, LDAP, LDAPS, FILE, IMAP, SMTP, POP3, RTSP and RTMP. libcurl offers a myriad of powerful features. curl is used in command lines or scripts to transfer data. It is also used in cars, television sets, routers, printers, audio equipment, mobile phones, tablets, settop boxes, media players and is the internet transfer backbone for thousands of software applications affecting billions of humans daily.
</p>

<p>
	<strong>Step 1 :</strong><br />
	Remove current installed curl if installed :
</p>

<pre class="ipsCode">apt remove curl
apt purge curl</pre>

<p>
	<br />
	<strong>Step 2 :</strong><br />
	Install Curl dependencies :
</p>

<pre class="ipsCode">apt install -y build-essential libcurl4 openssl libssl-dev libssh-dev zlib1g-dev zlib libbrotli-dev brotli libkrb5-dev libldap2-dev librtmp-dev libpsl-dev libnghttp2-dev</pre>

<p>
	<br />
	<strong>Step 3 :</strong><br />
	Download and Install curl :
</p>

<p>
	run this commands one by one in ssh terminal :
</p>

<pre class="ipsCode">cd /usr/local/src
rm -rf curl*
wget https://curl.se/download/curl-8.3.0.zip
unzip curl-8.3.0.zip
cd curl-8.*/
./configure --with-ssl --with-zlib --with-gssapi --enable-ldap --enable-ldaps --with-libssh --with-nghttp2
make
make install</pre>

<p>
	<br />
	<strong>Step 4:</strong><br />
	Checking curl version :
</p>

<pre class="ipsCode prettyprint lang-html prettyprinted"><span class="pln">curl -V</span></pre>

<p>
	<br />
	example output :
</p>

<pre class="ipsCode">root@mysterydata:# curl -V
curl 8.3.0 (x86_64-pc-linux-gnu) libcurl/8.3.0 OpenSSL/1.1.1 zlib/1.2.11 brotli/1.0.4 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) libssh/0.7.0/openssl/zlib nghttp2/1.30.0 librtmp/2.3
Release-Date: 2023-09-13
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets</pre>

<p>
	<br />
	Thats it you’ve installed latest curl version on Ubuntu server
</p>

<p>
	<strong>Troubleshoot :</strong><br />
	if you get this errors :
</p>

<p>
	curl: symbol lookup error: curl: undefined symbol: curl_url_cleanup<br />
	curl: symbol lookup error: curl: undefined symbol: curl_mime_free<br />
	Run the below Steps ensure you’re using root (sudo):
</p>

<p>
	apt build-dep curl<br />
	Then run Step 3 commands
</p>

<p>
	Now Run this command to build shared lib cache and links :
</p>

<pre class="ipsCode">ldconfig</pre>

<p>
	<br />
	ZLIB not found or not installing
</p>

<p>
	*** Unable to locate package zlib
</p>

<p>
	you can install ZLib from repository :
</p>

<pre class="ipsCode">apt install zlib1g-dev zlib1g</pre>

<p>
	<br />
	Zlib Install from DEB :
</p>

<p>
	For Ubuntu :
</p>

<pre class="ipsCode">cd /usr/local/src
wget http://security.ubuntu.com/ubuntu/pool/main/z/zlib/zlib1g_1.2.11.dfsg-2ubuntu5_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/main/z/zlib/zlib1g-dev_1.2.11.dfsg-2ubuntu5_amd64.deb
dpkg -i zlib1g_1.2.11.dfsg-2ubuntu5_amd64.deb
dpkg -i zlib1g-dev_1.2.11.dfsg-2ubuntu5_amd64.deb</pre>

<p>
	<br />
	Zlib Install from Source :
</p>

<pre class="ipsCode">cd /usr/local/src
wget http://www.zlib.net/zlib1211.zip
unzip zlib1211.zip
cd zlib-1.2.11
./configure --prefix=/usr/local/zlib
make &amp;&amp; make install</pre>

<p>
	 
</p>
]]></description><guid isPermaLink="false">7</guid><pubDate>Thu, 01 Jun 2023 04:31:39 +0000</pubDate></item></channel></rss>
