Skip to content

Commit

Permalink
21-july-2020
Browse files Browse the repository at this point in the history
  • Loading branch information
chmvreddy committed Jul 21, 2020
1 parent df4309d commit 1a0d94d
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 21 deletions.
13 changes: 0 additions & 13 deletions A.LIST OF ALL TASKS IN KKE - Copy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,10 @@ List of tasks I faced so far dividing into Sysadmin and Devops sections:
Sysadmin tasks: 45

|Linux Kernel Parameters |100|
|Create a group |200|
|Disable Root Login |200|
|DNS Troubleshooting |200|
|Linux Remote Copy |200|
|Linux User Without Home |200|
|MariaDB Troubleshooting |200|
|Apache Troubleshooting |300|
|Linux Bash Scripts |300|
|Linux Find Command |300|
|Linux Resource Limits |300|
|Setup SSL for Nginx |300|
|Install and Configure HaProxy LBR |400|
|Install and Configure NFS Server |600|
|Install And Configure SFTP |600|
|Install and Configure Tomcat Server |600|
|Linux Network Services |600|
|Linux Process Troubleshooting |600|
|Install and Configure Nginx as an LBR |800|

DevOps tasks: 26
Expand Down
8 changes: 1 addition & 7 deletions Apache Troubleshooting.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ CHECK IN ALL APP SERVERS IN PORT 6100 AND CHECK HOME DIRECTORY WILL BE /VAR/WWW/
6 sudo systemctl restart httpd
7 sudo systemctl status httpd


&&





&&
ERRORS
======

Expand Down
30 changes: 30 additions & 0 deletions Install and Configure HaProxy LBR.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
There is a static website of Nautilus project running in Stratos Datacenter. Based on the infrastructure, they have already configured app servers and code is already deployed there. To make it work properly, they need to configure LBR server. There are number of options for that, but team has decided to go with HAproxy.


a. So install and configure HAproxy on LBR server using yum only and make sure all app servers are added to HAproxy load balancer. HAproxy must serve on default http port (Note: Please do not remove stats socket /var/lib/haproxy/stats entry from haproxy default config.).

b. You can access the website on LBR link�to do so click on the + button on top of your terminal, select option Select port to view on Host 1, and after adding port 80 click on Display Port.



1 yum install haproxy -y
2 systemctl start haproxy
3 systemctl enable haproxy
4 systemctl status haproxy
5 cd /etc/haproxy/
6 ls
6 vi haproxy.cfg

frontend main *:80

server app1 172.16.238.10:5003 check
server app1 172.16.238.11:5003 check
server app1 172.16.238.12:5003 check --CHECK IN APP SERVER WHICH PORT IS RUNNING ON HTTPD(netstat -anp | grep httpd)

7 systemctl restart haproxy
8 curl 172.16.238.14:80
9 vi haproxy.cfg
10 yum -y install net-tools
11 netstat -ntpl
12 ssh tony@stapp01
13 netstat -anp | grep httpd --APPLY THIS COMMAND IN APP SERVER TO KNOW PORT
4 changes: 4 additions & 0 deletions Install and Configure NFS Server.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
incomplete
==========


For our infrastructure in Stratos Datacenter we have a requirement to serve our website code from a common/shared location that can be shared among all app nodes. For this we came up with a solution to use NFS (Network File System) server that can store the data and we can mount the share among our app nodes. The dedicated NFS server going to be our storage server. To accomplish this task do the following given steps:


Expand Down
85 changes: 85 additions & 0 deletions Linux Bash Scripts.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
TASK INCOMPLETED
================
ITS HAVING SOME TYPO ERROR

The production support team of xFusionCorp Industries is working on developing some bash scripts to automate different day to day tasks. One is to create a bash script for taking websites backup. They have a static website running on App Server 3 in Stratos Datacenter, and they need to create a bash script named blog_backup.sh which should accomplish the following tasks. (Also remember to place the script under /scripts directory on App Server 3)


a. Create a zip archive named xfusioncorp_blog.zip of /var/www/html/blog directory.

b. Save the archive in /backup/ on App Server 3. This is a temporary storage, as backups from this location will be clean on weekly basis. Therefore, we also need to save this backup archive on Nautilus Backup Server.

c. Copy the created archive to Nautilus Backup Server server in /backup/ location.

d. Please make sure script won't ask for password while copying the archive file. Additionally, the respective server user (for example, tony in case of App Server 1) must be able to run it.

LOGIN TO APPSERVER 3
====================
1 ssh-keygen
2 ssh-copy-id clint@stbkp01
PASSWORD OF BACKUPSERVER ASKS HERE
3 ssh clint@stbkp01
4 cd /var/www/html/blog
5 ls -la
6 cd ..
7 ls -la
8 tar -czvf xfusioncorp_blog.zip /var/www/html/blog
9 sudo tar -czvf xfusioncorp_blog.zip /var/www/html/blog
10 ls
11 scp xfusioncorp_blog.zip clint@stbkp01:/backup/
12 ls -la
13 cd /scripts/
14 ls
15 vi blog_backup.sh
#!/bin/bash
tar czvf xfusioncorp_blog.zip /var/www/html/blog
mv xfusioncorp_blog.zip /backup/
scp /backup/xfusioncorp_blog.zip clint@stbkp01:/backup/
16 cat blog_backup.sh
17 ls -la
18 chmod +x blog_backup.sh
19 ls -la
20 sh blog_backup.sh
(or)
./blog_backup.sh










backup server
==============

1 cd /b
2 cd /backup/
3 ls
4 cd /backup/
5 ls
6 history




app server
===========

1 ssh-keygen
2 ssh-copy-id clint@stbkp01
3 ls
4 cd /
5 ls
6 cd scripts/
7 ls
8 vi official_backup.sh
9 ls -la
10 chmod +x official_backup.sh
11 ls -la
12 ssh clint@stbkp01
13 sh official_backup.sh
14 ssh clint@stbkp01
15 history
20 changes: 20 additions & 0 deletions Linux Find Command.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
During a routine security audit, the team identified an issue on the Nautilus App Server. Some malicious content was identified within the website code. After digging into the issue they found that there might be more infected files. Before doing a cleanup they would like to find all similar files and copy them to a safe location for further investigation. Accomplish the task as per the following requirements:


a. On App Server 1 at location /var/www/html/beta find out all files (not directories) having .php extension.

b. Copy all those files along with their parent directory structure to location /beta on same server.

c. Please make sure not to copy the entire /var/www/html/beta directory content.


1 ls
2 cd /var/www/html/
3 ls
4 cd beta/
5 ls
6 find /var/www/html/beta -name '*.php' -exec cp --parents {} /beta \; |
|I APPLIED THESE TWO COMMANDS WHICH ONE IS CORRECT I DON'T KNOW
6 find /var/www/html/beta -name '*.php' -exec cp --parents \{\} /beta \; |


2 changes: 1 addition & 1 deletion Linux Firewalld Setup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ DO THESE STEPS IN ALL APP SERVERS
12 sudo firewall-cmd --zone=public --list-all
13 sudo firewall-cmd --reload -- RELOAD TO ACTIVATE CHANGES
14 cat /etc/httpd/conf/httpd.conf | grep Listen
15 firewall-cmd --permanent --zone=public --add-rich-rule='rule family=ipv4 source address=172.16.238.14 port port=8088 protocol=tcp accept'
15 firewall-cmd --permanent --zone=public --add-rich-rule='rule family=ipv4 source address=172.16.238.14 port port=8088 protocol=tcp accept' --8080 IS APACHE PORT
16 sudo firewall-cmd --reload
17 sudo firewall-cmd --zone=public --list-all
18 systemctl status httpd
Expand Down

0 comments on commit 1a0d94d

Please sign in to comment.