[WIP][Pending]Compilation on Linux server administration

I’m creating this compilation on the go, as i find random things i found useful. I hope to make some sense out of it.

Logging Actual Client IP Address on the Apache Server

To extract and log the actual client IP address from the X-Forwarded-For header of a request using an Apache server, make the following changes to the server:

  1. Log into the Apache server.
  2. Go to /etc/httpd/conf or /usr/local/apache2/conf path and open the file httpd.conf.
  3. Search for the string: “LogFormat “%h %l %u %t \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\”” combined
  4. Change the %h to %{X-Forwarded-For}i. The string now appears as “LogFormat “%{X-Forwarded-For}i %l %u %t \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\”combined
  5. Save the file and restart apache or httpd.

How to Use 7Zip in Ubuntu and Other Linux

p7zip packages are in the universe repository in Ubuntu so make sure that you have enabled it using this command:

  • sudo add-apt-repository universe sudo apt update
  • Use the following command to install 7zip support in Ubuntu and Debian based distributions.
  • sudo apt install p7zip-full p7zip-rar
  • That’s good. Now you have 7zip archive support in your system.

Extract 7Zip archive file in Linux

With 7Zip installed, you can either use the GUI or the command line to extract 7zip files in Linux.

In GUI, you can extract a .7z file as you extract any other compressed file. You right click on the file and proceed to extract it.

In terminal, you can extract a .7z archive file using this command:

7z e file.7z

Compress a file in 7zip archive format in Linux

You can compress a file in 7zip archive format graphically. Simply right click on the file/directory, and select Compress. You should see several types of archive format options. Choose .7z for 7zip.

7zip Archive Ubuntu
7zip Archive Ubuntu

Alternatively, you can also use the command line. Here’s the command that you can use for this purpose:

7z a OutputFile files_to_compress

By default, the archived file will have .7z extension. You can compress the file in zip format by specifying the extension (.zip) of the output file.


0 thoughts on “[WIP][Pending]Compilation on Linux server administration

Leave a Reply