linux

What is a LAMP Stack? A LAMP (Linux, Apache, MySQL, PHP) stack is a common, free, and open-source web stack used for hosting web content in a Linux environment. Many consider it the platform of choice on which to develop and deploy high-performance web apps. Before You Begin Update your system: sudo apt update && sudo apt upgrade Install Using Tasksel Instead of installing Apache, MySQL, and PHP separately, Tasksel...

Read More
cli

Let’s take an plain text file, input.txt, that looks like this PATTERN-1 First line of unimportant text Second line of unimportant text PATTERN-2 Some more texts (may/ mayn't be important!) We want to delete some of the lines from the file using the command line stream editor, sed. 1. Use the following command to delete the lines lying between PATTERN-1 and PATTERN-2 , excluding the lines containing these patterns: sed '/PATTERN-1/,/PATTERN-2/{//!d}' input.txt If you...

Read More
cli

Here are two ways to delete the blank lines in a text file opened with vim: 1. Delete all the blank lines with NO white spaces other than new lines: :g/^$/d 2. Delete the blank lines containing any type of white spaces: :g/^\s*$/d BONUS: Remove only multi blank lines (reduce them to a single blank line) and leaving single blank lines intact: :g/^\_$\n\_^$/d Reference: Stack Overflow....

Read More
apache2

Server version: Apache/2.4.6 As per the documentation at [1], "In 2.4.5 and later, SSLProxyCheckPeerCN has been superseded by SSLProxyCheckPeerName, and its setting is only taken into account when SSLProxyCheckPeerName off is specified at the same time." So adding following entry did the trick: SSLProxyCheckPeerName off So my working config looks like...

Read More
linux

Source: https://www.marksei.com/linux-users-groups-tutorial/ User basics Linux Users are users of the system, they can be either used by a human or they can be used by a software such as a web server or a database. The latter are also known as system users. There is no clear way to tell the difference between a system user and a human user, the former tend to have names associated...

Read More
nextcloud

Source: https://www.marksei.com/how-to-install-nextcloud-18-on-ubuntu/ NextCloud is a Dropbox-like solution for self-hosted file sharing and syncing. Installing NextCloud 18 on Ubuntu is trivial. Step 1: Install software Important I take NO responsibility of what you do with your machine; use this tutorial as a guide and remember you can possibly cause data loss if you touch things carelessly. The first step in order to install NextCloud 18 is to install a web server...

Read More
apache2

Disable directory listing on Apache; but access to individual files should be allowed. If you are using Debian/Ubuntu, just go to terminal and type sudo a2dismod autoindex sudo service apache2 restart If you are using Centos/Fedora, just do: mv /etc/httpd/conf.d/autoindex.conf /etc/httpd/conf.d/autoindex.bkp /etc/init.d/httpd restart # sudo a2dismod autoindex WARNING: The following essential module will be disabled. This might result in unexpected behavior and should NOT be done unless you know exactly what you are doing! autoindex To continue...

Read More
linux

Step 1: Ensure Passwords Expire In most cases, passwords are configured to expire every 60 to 90 days. If you want to configure Ubuntu to force users to change password regularly, you can run the commands below to open the login.defs file. sudo vi /etc/login.defs For example, if you want account password to be changed every 60 days, and the number of days before it changes again, edit the...

Read More
letsencrypt

Here are instructions for obtaining a Let's Encrypt certificate using the same webserver you are using as a proxy. Requesting your initial certificate from Let's Encrypt Modify your server clause to allow the subdirectory .well-known to be served from a local directory, eg: server { listen 80; server_name sub.domain.com www.sub.domain.com; […] location /.well-known { ...

Read More