Comand line to remove duplicate in sources.list

 


Edit a file using comand line

press Alt+F2 and type gnome-terminal if you’re using GUI

Then type

(To understand better: in the directory /etc you can find (nearly) all configuration files of your computer and in the apt directory you find the souces.list file that contains all the repositories that APT uses to update or install and upgrade software)

Edit the file removing or commenting



Remove all files from a directory?

  • To remove the folder with all its contents(including all interior folders):
  • To remove all the contents of the folder(including all interior folders) but not the folder itself:
  • To remove all the “files” from inside a folder(not removing interior folders):

Where:

  • rm – stands for “remove
  • -f – stands for “force” which is helpful when you don’t want

Zip/unzip all files in a directory

Unix zip directory but excluded specific subdirectories (and everything within them)

or

 


How to make Apache run as current user

or

Edit the following file as root: /etc/apache2/envvars

using the command:

change the user and group to yourself if there is only one user and you will never have permissions problems again.

I.E., if you are only logging in and running the server as user ‘big_dog’:


Heck, for that matter

How To Set Up mod_rewrite for Apache on Ubuntu 18.04

Prerequisites:-

Make user Apache 2 installed on your server – How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 18.04.

Step 1 — Installing Apache

Step 2 — Enabling mod_rewrite

Step 3 — Setting Up .htaccess

In this section, we will setup a .htaccess file for simpler rewrite rule management. A .htaccess


Permissions

The /var/www folder needs to be readable by the www-data system account. Try this :

(1) Allow Apache access to the folders and the files.


This recursively sets the ‘group’ to be www-data for the folders and files. This then gives the web server permission to recurse and get access


INSTALL Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 18.04

sudo apache2ctl configtest
sudo ufw app list
sudo nano /etc/apache2/apache2.conf

Inside, at the bottom of the file, add a ServerName directive, pointing to your primary domain name. If you do not have a domain name associated with your server, you can use your server’s public IP address:


Example:-