Monday, September 26, 2022

How to change Folder and File Permission in Linux


sudo find /var/www/html -type d -exec chmod 755 {} \;

sudo find /var/www/html -type f -exec chmod 644 {} \;

sudo chmod 644 /var/www/html/textbook.php

sudo chmod 644 /var/www/html/textbook.php


sudo systemctl restart httpd

Wednesday, September 21, 2022

Debian/Ubuntu Linux Specific Commands to Start/Stop/Restart Apache Engine

Debian Linux version 7.x or Ubuntu Linux version Ubuntu 14.10 or older:
Restart:
/etc/init.d/apache2 restart

sudo /etc/init.d/apache2 restart

sudo service apache2 restart

Stop
/etc/init.d/apache2 stop

sudo /etc/init.d/apache2 stop

sudo service apache2 stop

/etc/init.d/apache2 start

sudo /etc/init.d/apache2 start

sudo service apache2 start

Debian Linux version 8.x+ or Ubuntu Linux version Ubuntu 15.04+ or above:

sudo systemctl start apache2.service

sudo systemctl stop apache2.service

sudo systemctl restart apache2.service

sudo systemctl status apache2.service

CentOS/RHEL (Red Hat) Linux version 4.x/5.x/6.x:

## Start ##
service httpd start
## Stop ##
service httpd stop
## Restart ##
service httpd restart

CentOS/Fedora/RHEL (Red Hat) Linux version 7.x or newer:

## Start command ##
sudo systemctl start httpd.service
## Stop command ##
sudo systemctl stop httpd.service
## Restart command ##
sudo systemctl restart httpd.service

Alpine Linux:

service apache2 start
service apache2 stop
service apache2 status
service apache2 restart


Tuesday, September 20, 2022

Two-Factor Authentication (2FA) for Webmin with Google Authenticator

First install Perl Modules :
https://blog.olineit.com/2022/09/install-perl-cpan-module-in-centos-8.html

Then follow the instructions as given through the URL:
https://devtutorial.io/how-to-install-two-factor-authentication-2fa-for-webmin-p2845.html

Install Perl CPAN Module in CentOS 8

dnf install perl-CPAN

dnf install "@Development Tools"

perl -MCPAN -e 'install Authen::OATH'


cpan -i Geo::IP OR 
cpan Geo::IP


cpan 
cpan[1]> install Log::Log4perl

OR

You need gcc.:
yum install gcc

Get CPAN:
yum install CPAN

Configure CPAN ( just run CPAN ):
CPAN

After CPAN is configured:
install Authen::OATH [module in CPAN shell, which takes a long time to complete.]

When Authen::OATH is successfully installed, configure 2FA in WebMin.

Permission denied (publickey) fix


$ ls -laZ

$ restorecon -r -vv /home/user/.ssh

Monday, September 19, 2022

Friday, September 16, 2022

Installing PHP 7.4 on macOS Sierra without brew?

 sudo port install php74

sudo port install php74-cgi php74-gd php74-curl php74-intl php74-iconv php74-gettext php74-mbstring php74-imap php74-mcrypt php74-xmlrpc php74-mysql php74-openssl php74-sockets php74-zip php74-tidy php74-opcache php74-xsl php74-sqlite
sudo port select php php74

How to get Ranking of the Students in Excel using RANK Function

=RANK(number,ref,[order]) To rank in descending order, we will use the formula =RANK(B2,($C$5:$C$10),0) If we want unique ranks, we can use...