Professional Documents
Culture Documents
Virtualizationandnetwork Installation Ch07
Virtualizationandnetwork Installation Ch07
System i
1.
regestration required
2.
3.
Load the installation DVD, Automatically mounted on /media/"RHEL_6.5 x86
_64 Disc 1"
Unmount the dvd and re-mount it to /mnt
#umount /dev/cdrom
#mount /dev/cdrom /mnt
4.
5.
6.
l6.5
7.
Issue the semanage command and modify the contexts on the directory to e
nsure that the new context survive a SELinux relabeling:
#semanage fcontext -a -s system_u -t public_content_t /var/ftp/pub/rhel6
.5
[root@butxapache /]# semanage fcontext -a -s system_u -t public_content_
t /var/ftp/pub/rhel6.5
-bash: semanage: command not found
[root@butxapache /]# which semanage
/usr/bin/which: no semanage in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/u
sr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
You need to use the yum command to find out which package provides file
called /usr/sbin/semanage. Type the following command:
# yum provides /usr/sbin/semanage
OR
# yum whatprovides /usr/sbin/semanage
[root@butxapache /]# yum provides /usr/sbin/semanage
Type the following command to install the same, enter:
# yum -y install policycoreutils-python
8.
Configure host-based access by allowing vsFTP traffic on port 21 to pass
through the firewall:
# iptables -I INPUT -s 192.168.1.0/24 -p tcp --dport 21 -j ACCEPT
# iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACC
EPT
9.
Save the rule in the /etc/sysconfig/iptables file and restart the firewa
ll to activate the new rule:
# service iptables save; service iptables restart
10.
11.
Set the vsFTP service to autostart at each system reboot and validate
#chkconfig vsftpd on
#chkconfig --list vsftpd
12.
Open up a browser window and type the following command to test access:
# ftp://192.168.1.20/pub/rhel6.5
----------------------------------troubleshooting
delete other iptable entry if there is one for port 21
cp /etc/sysconfig/iptables /etc/sysconfig/iptables.bk
vi /etc/sysconfig/iptables
Now edit the /etc/vsftpd/vsftpd.conf file. Uncomment and edit the lines in the v
sftpd.conf file which are shown in bold.
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO
# ASCII mangling is a horrible feature of the protocol.
ascii_upload_enable=YES
ascii_download_enable=YES
#
# You may fully customise the login banner string:
ftpd_banner=Welcome to OSTECHNIX FTP service.
#listen_ipv6=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
use_localtime=YES
Now let us restart the vsftpd service and try to connect to ftp server.
[root@mainserver ~]# service vsftpd restart
Shutting down vsftpd:
Starting vsftpd for vsftpd:
[ OK ]
[ OK ]
vi /etc/vsftpd/vsftpd.conf
2.
3.
Load the installation DVD, Automatically mounted on /media/"RHEL_6.5 x86
_64 Disc 1"
Unmount the dvd and re-mount it to /mnt
# umount /dev/cdrom
# mount /dev/cdrom /mnt
4.
5.
6.
Copy the SELinux context on the /var/www/html to the /var/www/html/rhel6
.5 directory
#chcon -Rv --reference=/var/www/html /var/www/html/rhel6.5
7.
Issue the semanage command and modify the contexts on the directory to e
nsure that the new context survive a SELinux relabeling:
#semanage fcontext -a -s system_u -t httpd_sys_content_t /var/www/html/r
hel6.5
8.
Configure host-based access by allowing http traffic on port 80 to pass
through the firewall:
# iptables -I INPUT -s 192.168.1.0/24 -p tcp --dport 80 -j ACCEPT
11.
Set the vsFTP service to autostart at each system reboot and validate
#chkconfig httpd on
#chkconfig --list httpd
12.
Open up a browser window and type the following command to test access:
# http://192.168.1.20/rhel6.5
-----------------troubleshooting
4.
vm WILL START
Create VM
http://192.168.1.20/rhel6.5/images/install.img