How to Enable Two Factor Authentication & Clone a new domain?

From PheonixSolutions
Jump to navigation Jump to search

Here we are going to clone a new domain on cable management from gitlab.

Step 1:- Login Gitlab with your credentials

https://git.pheonixsolutions.com/users/sign_in

Step 2:- Navigate Account > Two factor authentication > manage two factor authentication > enable two factor authentication.

Step3:- Install duo mobile app on your mobile and scan the QR code displayed by GitLab with your device’s camera to add the entry automatically.

Note: Explore if you need other third party app’s

Step 4:- Enter the details provided to add the entry manually.

Step 5:- Enter the six-digit pin number generated on your mobile in the Pin code section.

Step 6:- Enter your current password and click on submit. Now the recovery code will be generated & save it somewhere safe.

Note: If you have already enabled two factor authentication, skip step 2 to step 6

Step 7:- Select Avatar > Edit profile > Access Tokens.

Step8:- Enter a name and optional expiry date for the token, from the available option select anyone which is appropriate to the task.

Step 9:- Select Create personal access token & save it somewhere safe.

Step 10:- Login to the Cable management server

Step 11:- Inside the home directory we have to clone a new domain

cd /home
apt-get install git
git clone https://git.pheonixsolutions.com/sainithin/rks-techno

Step 12:- Enter the username and password

Note: Username: gitlab username

Password: access token which we have created on step 9

Step 13:-Create a new conf. File for the respective domain

cd /etc/apache2/sites-available
cp fitness.pheonixsolutions.com.conf rks-techno.conf
vi rks-techno

Step 14:- Edit the rks-techno.conf file as mentioned and save the file

vi rks-techno.conf file
 Server name rkstechno.pheonixsolutions.com
 DocumentRoot /home/rks-techno
 *Remove all rewrite engine lines*
a2ensite rks-techno.conf

Step 15:- Login to hosting1 - WHM

Step 16:- Navigate DNS Manage records > pheonixsolutions > manage > add A record. Enter the following details and click on save record

  1. IP - Cable management server ip

  2. Domain name rkstechno.pheonixsolutions.com.

Step 17:- To check the error on .conf file and restart the service to update the changes.Run the below command on cable management server

apachectl -t

(if no error proceed further else need to check accordingly)

systemctl restart apache2

Step 18:- Install SSL and check the functionality of site

Load alert- nagios

[edit]

Generally, we need to do below things when we receive alert on load

  1. Check the /var/log/messages for any errors

  2. Check the top consuming resources and identify the user which consumes more resource

  3. If we identify the domain name then we can use pwdx, fuser, ps aux command to know the path

  4. We need to check the domain log for suspicious activity. Generally the location will be /usr/local/apache/domlogs/user/domain

  5. Check /var/log/mysqld.log to findout the corrupt of tables or database

  6. Check dmesg to find out the log

  7. If we continuously receives alert at particular time then we need to check the crons whether any cron running at that time. The location will be /var/spool/cron/

https://blog.cpanel.com/troubleshooting-high-server-loads/