Sunday, June 3, 2012

Chapter 1 - Prepare for Red Hat Hands-on Certifications (Installation from iso image) - part 2


My ISO image is mounted now and I can access the files within it :


-------------------------------------------------------------------------------------
My ISO is now mounted , and files are accessible :

[root@rhce01 ~]# ls -lrt /media/RHEL_6.1\ x86_64\ Disc\ 1/repodata/
total 16031
-r--r--r--. 2 root root    2163 Apr 27  2011 productid
-r--r--r--. 2 root root 1578191 May 10  2011 75ae0e2d43ccc206a20b92df165a639adfb6b5ce4732f484c8a3b63a2127b2f7-other.xml.gz
-r--r--r--. 2 root root 3446253 May 10  2011 3d3002a1aaa4158becd663b795dfb643dde639afff562db45cf6db2fa63691ec-filelists.xml.gz
-r--r--r--. 2 root root 1688844 May 10  2011 0b17c19bc39ce40fe661edcaab78f7d225ace938cdf6ca506f9903cdc98c9ede-primary.xml.gz
-r--r--r--. 2 root root 1475141 May 10  2011 039ef4cdbf06ada6e58481ff3b41e962da80f6a570880a0fdb749841214358ed-other.sqlite.bz2
-r--r--r--. 2 root root 3803950 May 10  2011 1ee7ac053d14cae15e92d1dec19fcc688e2403941e9eeb1489ef4f545116587a-filelists.sqlite.bz2
-r--r--r--. 2 root root 3119628 May 10  2011 5f7eebbfebdecbe5a30fdc37bc2bdc61971f6abfc504f4172b56baa747bc4b44-primary.sqlite.bz2
-r--r--r--. 2 root root 1088116 May 10  2011 5819e9580b5a81a9eec9e2c6e91fc9992a7ccadaa3bcd5ecb2e87a8669eefcec-comps-rhel6-Server.xml
-r--r--r--. 2 root root  201211 May 10  2011 00fa55cde0056779ce3cb404c5097825124da4bae5823734c9978798d64428bb-comps-rhel6-Server.xml.gz
-r--r--r--. 2 root root    4068 May 10  2011 repomd.xml
-r--r--r--. 2 root root    1712 May 10  2011 productid.gz
-r--r--r--. 1 root root    3026 May 10  2011 TRANS.TBL

[root@rhce01 ~]# mkdir -p /var/www/html/inst
[root@rhce01 ~]#


[root@rhce01 ~]# find /media/RHEL_6.1\ x86_64\ Disc\ 1/ -name "*.rpm" |wc -l
3544
[root@rhce01 ~]#

[root@rhce01 ~]# cp -ar /media/. /var/www/html/inst/
[root@rhce01 ~]# ls -lrt /var/www/html/inst/
total 4
dr-xr-xr-x. 12 root root 4096 May 10  2011 RHEL_6.1 x86_64 Disc 1
[root@rhce01 ~]#

[root@rhce01 ~]# chcon -R --reference=/var/www/html/ /var/www/html/inst/
[root@rhce01 ~]#


NOTE : Tried to run "system-config-firewall" , but got "command not found", hmmm ...needed to install a few more packages that the book may have left out ? So instead, per book, just turned off all firewalls for simplicity ..:)

[root@rhce01 ~]# iptables -F
[root@rhce01 ~]#

[root@rhce01 ~]# yum install httpd -y
Loaded plugins: product-id, refresh-packagekit, subscription-manager
Updating Red Hat repositories.
Setting up Install Process

The yum repo is not setup ??
[root@rhce01 ~]# yum install httpd -y
Loaded plugins: product-id, refresh-packagekit, subscription-manager
Updating Red Hat repositories.
Setting up Install Process
No package httpd available.
Error: Nothing to do
[root@rhce01 ~]#


Apparently the book totally sorta skipped this step...nice :P

[root@rhce01 ~]# cd /etc/yum.repos.d/
[root@rhce01 yum.repos.d]# ls
packagekit-media.repo  redhat.repo  rhel-source.repo

http://www.confignotes.com/2011/01/how-to-add-a-repository-manually-in-rhel6/
[localRepo]
name=localRepo
baseurl=file:///rhel6/RHEL6-GA-x86_64/
enabled=1
gpgcheck=0

[root@rhce01 yum.repos.d]# yum clean all
Loaded plugins: product-id, refresh-packagekit, subscription-manager
Updating Red Hat repositories.
Cleaning repos: InstallMedia localRepo
Cleaning up Everything
[root@rhce01 yum.repos.d]#


[root@rhce01 yum.repos.d]# yum list
Loaded plugins: product-id, refresh-packagekit, subscription-manager
Updating Red Hat repositories.
file:///var/www/html/inst/repodata/repomd.xml: [Errno 14] Could not open/read file:///var/www/html/inst/repodata/repomd.xml
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: localRepo. Please verify its path and try again
[root@rhce01 yum.repos.d]#

[root@rhce01 yum.repos.d]# find /var/www/html -name repomd.xml
/var/www/html/inst/RHEL_6.1 x86_64 Disc 1/ScalableFileSystem/repodata/repomd.xml
/var/www/html/inst/RHEL_6.1 x86_64 Disc 1/LoadBalancer/repodata/repomd.xml
/var/www/html/inst/RHEL_6.1 x86_64 Disc 1/repodata/repomd.xml
/var/www/html/inst/RHEL_6.1 x86_64 Disc 1/ResilientStorage/repodata/repomd.xml
/var/www/html/inst/RHEL_6.1 x86_64 Disc 1/HighAvailability/repodata/repomd.xml
/var/www/html/inst/RHEL_6.1 x86_64 Disc 1/Server/repodata/repomd.xml

[root@rhce01 yum.repos.d]# yum clean all
Loaded plugins: product-id, refresh-packagekit, subscription-manager
Updating Red Hat repositories.
Repository 'localRepo': Error parsing config: Error parsing "baseurl = 'file:///var/www/html/inst/RHEL_6.1 x86_64 Disc 1/'": URL must be http, ftp, file or https not ""
Cleaning repos: InstallMedia

...changed to no spaces in the filename ...
[localRepo]
name=localRepo
baseurl=file:///var/www/html/inst/RHEL_6.1_x86_64_Disc_1/
enabled=1
gpgcheck=0

[root@rhce01 inst]# cd /var/www/html/inst/
[root@rhce01 inst]# ls -lrt
total 4
dr-xr-xr-x. 12 root root 4096 May 10  2011 RHEL_6.1 x86_64 Disc 1
[root@rhce01 inst]# mv "RHEL_6.1 x86_64 Disc 1"/ RHEL_6.1_x86_64_Disc_1
[root@rhce01 inst]# ls -lrt
total 4
dr-xr-xr-x. 12 root root 4096 May 10  2011 RHEL_6.1_x86_64_Disc_1
[root@rhce01 inst]#

[root@rhce01 inst]# yum clean all
Loaded plugins: product-id, refresh-packagekit, subscription-manager
Updating Red Hat repositories.
Cleaning repos: InstallMedia localRepo
Cleaning up Everything
[root@rhce01 inst]#

[root@rhce01 inst]# yum list
<...>
xorg-x11-fonts-Type1.noarch                                  7.2-9.1.el6                                  localRepo
xorg-x11-fonts-cyrillic.noarch                               7.2-9.1.el6                                  localRepo
xorg-x11-fonts-ethiopic.noarch                               7.2-9.1.el6                                  localRepo
xorg-x11-fonts-misc.noarch                                   7.2-9.1.el6                                  localRepo
xorg-x11-proto-devel.noarch                                  7.4-35.el6                                   localRepo
xorg-x11-server-Xephyr.x86_64                                1.7.7-29.el6                                 localRepo
xorg-x11-twm.x86_64                                          1:1.0.3-5.1.el6                              localRepo
xorg-x11-xdm.x86_64                                          1:1.1.6-14.1.el6                             localRepo
xrestop.x86_64                                               0.4-7.1.el6                                  localRepo
xsane.x86_64                                                 0.997-8.el6                                  localRepo
xsane-common.x86_64                                          0.997-8.el6                                  localRepo
xsane-gimp.x86_64                                            0.997-8.el6                                  localRepo
xsettings-kde.x86_64                                         0.11-1.el6                                   localRepo
xterm.x86_64                                                 253-1.el6                                    localRepo
xulrunner.i686                                               1.9.2.17-4.el6_0                             localRepo
xz-devel.i686                                                4.999.9-0.3.beta.20091007git.el6             localRepo
xz-devel.x86_64                                              4.999.9-0.3.beta.20091007git.el6             localRepo
xz-libs.i686                                                 4.999.9-0.3.beta.20091007git.el6             localRepo
yajl.i686                                                    1.0.7-3.el6                                  localRepo
ypserv.x86_64                                                2.19-18.el6                                  localRepo
yum-plugin-aliases.noarch                                    1.1.30-6.el6                                 localRepo
yum-plugin-changelog.noarch                                  1.1.30-6.el6                                 localRepo
yum-plugin-downloadonly.noarch                               1.1.30-6.el6                                 localRepo
yum-plugin-security.noarch                                   1.1.30-6.el6                                 localRepo
yum-plugin-tmprepo.noarch                                    1.1.30-6.el6                                 localRepo
yum-plugin-verify.noarch                                     1.1.30-6.el6                                 localRepo
yum-plugin-versionlock.noarch                                1.1.30-6.el6                                 localRepo
yum-presto.noarch                                            0.6.2-1.el6                                  localRepo
zlib.i686                                                    1.2.3-25.el6                                 localRepo
zlib-devel.i686                                              1.2.3-25.el6                                 localRepo
zlib-devel.x86_64                                            1.2.3-25.el6                                 localRepo
zsh.x86_64                                                   4.3.10-4.1.el6                               localRepo

// Set up a default aqpache web server
[root@rhce01 inst]# yum install httpd -y
Loaded plugins: product-id, refresh-packagekit, subscription-manager
Updating Red Hat repositories.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.2.15-9.el6 will be installed
--> Processing Dependency: httpd-tools = 2.2.15-9.el6 for package: httpd-2.2.15-9.el6.x86_64
--> Processing Dependency: apr-util-ldap for package: httpd-2.2.15-9.el6.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.2.15-9.el6.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.2.15-9.el6.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.3.9-3.el6 will be installed
---> Package apr-util.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package httpd-tools.x86_64 0:2.2.15-9.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved
=================================================================================================================================================================
 Package                                 Arch                             Version                                      Repository                           Size
=================================================================================================================================================================
Installing:
 httpd                                   x86_64                           2.2.15-9.el6                                 localRepo                           812 k
Installing for dependencies:
 apr                                     x86_64                           1.3.9-3.el6                                  localRepo                           123 k
 apr-util                                x86_64                           1.3.9-3.el6_0.1                              localRepo                            87 k
 apr-util-ldap                           x86_64                           1.3.9-3.el6_0.1                              localRepo                            15 k
 httpd-tools                             x86_64                           2.2.15-9.el6                                 localRepo                            69 k

Transaction Summary
=================================================================================================================================================================
Install       5 Package(s)

Total download size: 1.1 M
Installed size: 3.5 M
Downloading Packages:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                             12 MB/s | 1.1 MB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : apr-1.3.9-3.el6.x86_64                                                                                                                        1/5
  Installing : apr-util-1.3.9-3.el6_0.1.x86_64                                                                                                               2/5
  Installing : httpd-tools-2.2.15-9.el6.x86_64                                                                                                               3/5
  Installing : apr-util-ldap-1.3.9-3.el6_0.1.x86_64                                                                                                          4/5
  Installing : httpd-2.2.15-9.el6.x86_64                                                                                                                     5/5
localRepo/productid                                                                                                                       | 1.7 kB     00:00 ...
duration: 142(ms)
Installed products updated.

Installed:
  httpd.x86_64 0:2.2.15-9.el6

Dependency Installed:
  apr.x86_64 0:1.3.9-3.el6        apr-util.x86_64 0:1.3.9-3.el6_0.1        apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1        httpd-tools.x86_64 0:2.2.15-9.el6

Complete!
[root@rhce01 inst]#

[root@rhce01 inst]# chkconfig httpd on
[root@rhce01 inst]# chkconfig --list httpd
httpd           0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@rhce01 inst]#

[root@rhce01 inst]# service httpd start
Starting httpd: httpd: apr_sockaddr_info_get() failed for rhce01
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
                                                           [  OK  ]
[root@rhce01 inst]#

[root@rhce01 inst]# vi /etc/hosts
[root@rhce01 inst]#

[root@rhce01 inst]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.10    rhce01

[root@rhce01 inst]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.0.10 for ServerName
                                                           [  OK  ]
[root@rhce01 inst]#

[root@rhce01 inst]# telnet 0 80
-bash: telnet: command not found

[root@rhce01 inst]# yum install telnet -y
Loaded plugins: product-id, refresh-packagekit, subscription-manager
Updating Red Hat repositories.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package telnet.x86_64 1:0.17-46.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved
=================================================================================================================================================================
 Package                             Arch                                Version                                    Repository                              Size
=================================================================================================================================================================
Installing:
 telnet                              x86_64                              1:0.17-46.el6                              localRepo                               58 k

Transaction Summary
=================================================================================================================================================================
Install       1 Package(s)

Total download size: 58 k
Installed size: 109 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 1:telnet-0.17-46.el6.x86_64                                                                                                                   1/1
duration: 110(ms)
Installed products updated.

Installed:
  telnet.x86_64 1:0.17-46.el6

Complete!

[root@rhce01 inst]# telnet 0 80
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.


Yaay !!! We have setup the apache web server successfully !



And we can easily browse the file repo we set up


[root@rhce01 inst]# yum install vsftpd -y
Loaded plugins: product-id, refresh-packagekit, subscription-manager
Updating Red Hat repositories.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.x86_64 0:2.2.2-6.el6_0.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved
=================================================================================================================================================================
 Package                            Arch                               Version                                       Repository                             Size
=================================================================================================================================================================
Installing:
 vsftpd                             x86_64                             2.2.2-6.el6_0.1                               localRepo                             150 k

Transaction Summary
=================================================================================================================================================================
Install       1 Package(s)

Total download size: 150 k
Installed size: 331 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : vsftpd-2.2.2-6.el6_0.1.x86_64                                                                                                                 1/1
duration: 113(ms)
Installed products updated.

Installed:
  vsftpd.x86_64 0:2.2.2-6.el6_0.1

Complete!
[root@rhce01 inst]#

Turn on the vsftpd daemon for reboots, and start the service ...

[root@rhce01 inst]# chkconfig vsftpd on
[root@rhce01 inst]# chkconfig --list vsftpd
vsftpd          0:off   1:off   2:on    3:on    4:on    5:on    6:off


[root@rhce01 inst]# service vsftpd start
Starting vsftpd for vsftpd:                                [  OK  ]
[root@rhce01 inst]#

Can check now (only from the local VM I am on at this point) ...





No comments:

Post a Comment