Question

Hello! I need help setting my program up to initiate certain tasks! We are using a...

Hello! I need help setting my program up to initiate certain tasks! We are using a Centos Server as a root user!

Use the CentOS Server and as root user perform the following:
Setup two ext4 partitions on /dev/sdc at 1 GB each
Mount sdc1 to /var/www (create any directories as needed)
Mount sdc2 to /var/data (create any directories as needed)
Install the httpd package
Create a file called final.txt in /var/www/html (in that put your name/date on the first line)
Cat the contents of the /etc/centos-release appending it to the file created in step 5 (final.txt from the previous step)
Redirect and append the output of df (in human-readable format) to the final.txt (file created in step 5)
Start the httpd service
Redirect the output of the process list (ps) only for httpd process appending it to final.txt (file created in step 5)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

First we need to setup two ext4 partition on /dev/sdc, To do so run the following commands:-

parted /dev/sdc

Now use mkpart command to create partition, you need to give extra parameters depening on partition type an file system. For file system we will select ext4. command looks like this :-
(parted) mkpart
Partition type? primary/extended? primary
File system type? [ext2]? ext4
Start? 1
End? 1025

Similarly we need to create the second partition of 1GB

(parted) mkpart
Partition type? primary/extended? primary
File system type? [ext2]? ext4
Start? 1
End? 1025

Now we need to properly format the two partitions.
mkfs.ext4 /dev/sdc1
mkfs.ext4 /dev/sdc2

Then we will label the partition:
e4label /dev/sdc1 part1
e4label /dev/sdc2 part2

Now that we have successfully created and formated the partitions, we need to mount them:-
mount /dev/sdc1 /var/www
mount /dev/sdc2 /var/data

Now to install httpd package we need to run :-
sudo yum install httpd

Now we will navigate to /var/www/html :-
cd /var/www/html

And create a file named final.txt :-
cat > final.txt
this will promt a text box which should be filled by your name and date as given in the question

">>" is called an append symbol, we can append content of file or command to content of another file.

appending contents of the /etc/centos-release:-
cat /etc/centos-release >> final.txt

appending the output of df :-
ds >> final.txt

To start httpd service :-
service httpd start

Redirecting the output of the process list (ps) only for httpd process appending it to final.txt:-
ps -fL -C httpd >> final.txt

Add a comment
Know the answer?
Add Answer to:
Hello! I need help setting my program up to initiate certain tasks! We are using a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • i need help with this scripting assignment in power shell thanks Lab 7: PowerShell Search and...

    i need help with this scripting assignment in power shell thanks Lab 7: PowerShell Search and Report Search Report host path date Execution time nnn Directories n, nnn, nnn Files nnnnnnn Sym links nnnnnnn Old files nnnnnnn Large files nnnn, nnn Graphics files nnnnnnn Executable files nnnnnnn Temporary files n, nnn, nnn TotalFileSize nnnn, nnn Introduction Lab 7 is nearly identical to Lab 2, except it is written in PowerShell, uses no UNIX/Linux tools to do its work, creates no...

  • Help Please on JAVA Project: Validating the input is where I need help. Thank you Requirements...

    Help Please on JAVA Project: Validating the input is where I need help. Thank you Requirements description: Assume you work part-time at a sandwich store. As the only employee who knows java programming, you help to write a sandwich ordering application for the store. The following is a brief requirement description with some sample output. 1. Selecting bread When the program starts, it first shows a list/menu of sandwich breads and their prices, then asks a user to select a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT