-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
141 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 \; | | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters