You can view iptables entries by line with command:
iptables -L INPUT -n --line-numbers
Example:

[email protected]:~# iptables -L INPUT -n –line-numbers
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination
1    ACCEPT     tcp  –  0.0.0.0/0            192.168.1.100       tcp dpt:22
2   ACCEPT     tcp  –  0.0.0.0/0            192.168.1.100       tcp dpt:80
3    ACCEPT     tcp  –  0.0.0.0/0            192.168.1.100       tcp dpt:443
4    ACCEPT     tcp  –  0.0.0.0/0            192.168.1.100       tcp dpt:21
5   ACCEPT     all  –  127.0.0.1            0.0.0.0/0
6   ACCEPT     all  –  192.168.1.100        0.0.0.0/0
7   ACCEPT     icmp –  0.0.0.0/0            0.0.0.0/0
8   ACCEPT     all  –  192.168.4.0/24       0.0.0.0/0
9   DROP       all  –  0.0.0.0/0            0.0.0.0/0           state NE

You’ll get the list of all INPUT entries.  Look at the number on the left  then use the following command to delete :

iptables -D INPUT <<number here>>

Enjoy.

This is my favorite and I think the more simple  if you want permanent redirect  from NON WWW to WWW insert the following code in the nginx configuration file nginx.conf :

server {
  listen 80;
  server_name www.debian-tutorials.com;
  rewrite ^/(.*)$ http://debian-tutorials.com/$1 permanent;
}
Permanent redirect from WWW to NON WWW in nginx, use this code in your nginx.conf :
server {
  listen 80;
  server_name debian-tutorials.com;
  rewrite ^/(.*)$ http://www.debian-tutorials.com/$1 permanent;
}

Enjoy!

To reset the MySQL root password, login to the mysql shell and run the following commands:

SET PASSWORD FOR [email protected]=PASSWORD('RootPasswordHere');
FLUSH PRIVILEGES;

Apache2 is one of the most widely used HTTP server has a lot of features and can be customized in many ways.

In fact, to this web server, there are basically two ways you can do this, using .htaccess directives or using a file httpd.conf. .

Some people prefer to use. htaccess files, since they reside in the website and can be modified by the site owner, which is not the case for the daemon configuration file:

 

Permanent redirect  NON WWW to WWW using apache2 server configuration:
ServerName debian-tutorials.com
RedirectMatch permanent ^/(.*) http://www.debian-tutorials.com/$1
DocumentRoot /path/to/your/site/files/
ServerName www.debian-tutorials.com

You can run this command to strip the comments (line that begins with a #) and remove blank lines from a file in Linux :

cat /path/to/file  | grep -v ^# | grep -v ^$

Example:

To remove comment lines from squid.conf you can run the following command:

cat /etc/squid/squid.conf | grep -v ^# | grep -v ^$ > squid_stripped.conf

Page 3 of 41234