Rhce7 3
Rhce7 3
Rhce7 3
5Hrs)
Virtual Machines-
Domain:- station0
system1:-
IP ADDR: 172.25.0.11(server)
HOSTNAME: (system1.network0.example.com)server0.example.com
system2:-
IP ADDR: 172.25.0.10(client)
HOSTNAME: (system2.network0.example.com)desktop0.example.com
Additional Information:
IP ADDR - 172.25.254.250
NETMASK- 255.255.255.0
GATEWAY - 172.25.254.254
DNS - 172.25.254.254
root psswd - <postroll>
YUM Server <URL> (http://content.example.com/rhel7.0/x86_64/dvd/
Deny domain- my133t.org
centralised server- server.network0.example.com(classroom.example.com)
#vim /etc/hosts.deny
insert
sshd: .my133t.org
:wq
#systemctl restart sshd
3. Create a new customized environment for your users on both systems.
a. Create a new custom command called "qstat" whos output should be
similar to "/bin/ps -Ao pid,tty,user,fname,rsz"
b. Make sure "qstat" command should available by-default for all
users on both systems.
#source /etc/bashrc
#qstat [cross verify ur output]
OR
# firewall-cmd --reload
OR
b. The traffic coming from system2 on port 5423/tcp should be
forwarded to port 80/tcp on your system1.
Ans: on system1,
#nmcli con add type team con-name team0 ifname team0 config
'{"runner": {"name": "activebackup"}}'
#nmcli con mod team0 ipv4.addresses '172.25.0.50'
#nmcli con mod team0 ipv4.method manual
#nmcli con add type team-slave con-name team0-port1 ifname eth1
master team0
# nmcli con add type team-slave con-name team0-port2 ifname eth2
master team0
#teamdctl team0 state
on system2,
#nmcli con add type team con-name team0 ifname team0 config
'{"runner": {"name": "activebackup"}}'
#nmcli con mod team0 ipv4.addresses '172.25.0.60'
#nmcli con mod team0 ipv4.method manual
#nmcli con add type team-slave con-name team0-port1 ifname eth1
master team0
# nmcli con add type team-slave con-name team0-port2 ifname eth2
master team0
#teamdctl team0 state
Ans: on system1,
# nmcli con add con-name eth0 type ethernet ifname eth0 ip4
"fddb:fe2a:ab1e::c0a8:1/64"
# nmcli con mod eth0 ipv4.method manual connection.Autoconnect
yes
# nmcli con down eth0
# nmcli con up eth0
on system2,
# nmcli con add con-name eth0 type ethernet ifname eth0 ip4
"fddb:fe2a:ab1e::c0a8:fe/64"
# nmcli con mod eth0 ipv4.method manual connection.Autoconnect
yes
# nmcli con down eth0
# nmcli con up eth0
Listen 5423
<VirtualHost server0.example.com:80>
DocumentRoot "/var/www/html"
ServerName server0.example.com
CustomLog "/var/log/httpd/server0.example.com-access_log"
combined
</VirtualHost>
<Directory "/var/www/html">
Require all granted
</Directory>
8. Extend your web server to include a virtual host for the site
http://wwwX.example.com
then perform the following steps:
- where X would be replaced by domain number.
- Set the DocumentRoot to /var/www/virtual
- Download http://classroom.example.com/pub/www.html
- Rename the downloaded file to index.html
- Copy this index.html to the DocumentRoot of the virtual host
- Do NOT make any modifications to the content of index.html
- Ensure that harry is able to create content in
/var/www/virtual
Ans:
# mkdir -p /var/www/virtual
# cd /var/www/virtual
# wget http://classroom.example.com/pub/www.html
# mv www.html index.html
# cd /etc/httpd/conf.d/
# vim webhost.conf
<VirtualHost www0.example.com:80>
DocumentRoot "/var/www/virtual"
ServerName www0.example.com
CustomLog "/var/log/httpd/www0.example.com-access_log"
combined
</VirtualHost>
<Directory "/var/www/virtual">
Require all granted
</Directory>
# cd /etc/httpd/conf.d
# vim tls.conf
Listen 443 https
<VirtualHost _default_:443>
ServerName www.example.com
SSLEngine on
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
SSLHonorCipherOrder on
SSLCertificateFile /etc/pki/tls/certs/server0.crt
SSLCertificateKeyFile /etc/pki/tls/private/server0.key
SSLCertificateChainFile /etc/pki/tls/certs/example-ca.crt
DocumentRoot /srv/www0/www
</VirtualHost>
<Directory "/srv/www0/www">
Require all granted
</Directory>
OR
b)- Configure your web server to display the dynamic web contents.
- Dynamic content is provided by a virtual host named as
http://dynamic.example.com
- This host should listen on port no 8877
- Download a copy of script from
http://172.25.254.250/pub/webapp.wsgi and place it on appropriate
location for virtual host so that it generates dynamic web contents.
- Do not make any changes in webapp.wsgi file
- Clients connecting to https://dynamic.example.com:8877 should get
the output of dynamic web content
Ans:
# mkdir -p /srv/webapp0/www
# cd /srv/webapp0/www
# wget http://172.25.254.250/pub/webapp.wsgi
# cd /etc/httpd/conf.d
# vim wsgi.conf
Listen 8877 https
<VirtualHost dynamic.example.com:8877>
ServerName dynamic.example.com
SSLEngine on
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
SSLHonorCipherOrder on
SSLCertificateFile /etc/pki/tls/certs/server0.crt
SSLCertificateKeyFile /etc/pki/tls/private/server0.key
SSLCertificateChainFile /etc/pki/tls/certs/example-ca.crt
WSGIScriptAlias / /srv/webapp/www/webapp.wsgi
</VirtualHost>
<Directory "/srv/webapp0/www">
Require all granted
</Directory>
Ans: # cd /var/www/html
# mkdir secret
# cd /var/www/html/secret
# wget http://classroom.example.com/pub/private.html
# mv private.html index.html
# vim /etc/httpd/conf.d/webhost.conf
<Directory "/var/www/html/secret">
order deny,allow
deny from all
allow from server0.example.com
</Directory>
# vim /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.2014-06.com.example:desktop0.Iscsi
# systemctl start iscsi
#systemctl enable iscsi
# iscsiadm -m discovery -t st -p 172.25.0.11 ---after this cmd you
will get iqn
# iscsiadm -m node -T iqn.2014-06.com.example:serverX.Iscsi -l
# lsblk
# tailf /var/log/messges
in above cmd output it will show attached disk,/dev/sda
# fdisk /dev/sda
create normal partition of 200MB size /dev/sda1
# partprobe /dev/sda
# mkfs -t xfs /dev/sda1
# mkdir /mnt/iscsi
# mount /dev/sda1 /mnt/iscsi
# blkid /dev/sda1 -------now u will get UUID of /dev/sda1
# vim /etc/fstab
UUID=xxxxxxxxxxxx /mnt/iscsi xfs defaults,_netdev 0 0
# df -hT
/dev/sda1 200M /mnt/iscsi
# iscsiadm -m session u
http://system2.network0.example.com/receivedmail/1(http://desktop0.exampl
e.com/receivedmail/1)
Ans:
#!/bin/bash
if [ $# == 0 ]; then
echo "Invalid Argument"
elif [ $1 == python ]; then
echo "print"
elif [ $1 == print ]; then
echo "python"
else
echo "python|print"
fi
# mysql -u root -p
# use contact;
# show tables;
# create user john@localhost identified by 'postroll';
# create user steve@'%' identified by 'postroll';
# grant all privileges on contact.* to john@localhost;
# grant insert,update,delete,select on contact.* to steve@'%';
# flush privileges;
#exit;
Now connect with user john and steve for vrify privileges.
20. Use above specified database and fire query for user mobius. Insert
query such that searching all details like username,password,email id
for user "mobius".
Ans:
# mysql -u root -p
# use contact;
# show tables;
# select username,password,email id from <table name> where user
= 'mobius';