INTRODUCTION
Creating a local network based Linux installation server can save both time and bandwidth. Further more, adding an update repository on a local installation server could ensure package availability as well as an increase in productivity. This document will describe the set up of a NFS, HTTP and FTP methods of an installation server. In addition to these methods, the media sources will be in a dot iso (Linux-version.iso) format only.
REMOTE INSTALLATION REQUIREMENTS
- Linux distribution (dvd.iso)
- A network boot disk for that particular Linux distribution
INSTALLATION
The server in this example utilizes a 40GB hard drive with 512MB of ram and a cdrom. When installing the SLES 10 Server, 3 partitions were created (swap, root and custom). For example, the swap partition was created with 1024MB space or 1GB, the root partition was created with about a 12GB space and the custom partition, which was named with a /product label and was created with a 25GB space.
The software that was selected was the default selection. In addition to the default selection, include the software packages vsftp and apache2. Proceed with the installation until it is finished and then log into the system, preferably with a regular user name that can perform root functions. For example, the Admin user that was created in the LDAP configuration. Not root.
The software that was selected was the default selection. In addition to the default selection, include the software packages vsftp and apache2. Proceed with the installation until it is finished and then log into the system, preferably with a regular user name that can perform root functions. For example, the Admin user that was created in the LDAP configuration. Not root.
NFS CONFIGURATION
After the server has been secured by locking out root, it is time for the initial configuration of the NFS server. Begin by opening up a terminal and typing sudo or su - for root privileges. Since a 25GB partition called /product had been created, this is the starting point of the NFS configuration. Navigate to that partition or directory by typing 'cd /product'. Create a directory that is relative to the particular distribution. For example, this document will use the Fedora 9 DVD release. Type 'mkdir fedora9'. The directory that has just been created needs to exported for other hosts on the network to be able to have access to that directory for the NFS remote installation method. Using a text editor, for example vi or gedit, in the terminal, type either 'vi /etc/exports' or 'gedit /etc/exports' to open the exports file. In the file, type the following:
/product/fedora9 *(ro,root_squash,sync)
To start the NFS server, type in a terminal as root:
service nfsserver start
To have the NFS server start at run levels 3 and 5 or at boot time, type in a terminal as root:
chkconfig -s nfsserver 35
chkconfig -s nfsserver on
NOTE: the " -s " option in the command "chkconfig -s" means the service that is to be started.
'cp -a * /srv/ftp/fedora9'
'cp -a * /product/fedora9'
After the contents have been copied, which might of taken a while, exit out of the /mnt directory and unmount the directory that the ISO is mount to. To do this, type the following in a terminal as root:
'umount /mnt'
Restart the services in relation to which the contents of the ISO have been copied. For example, If the contents of the ISO had been copied to the HTTP directory (/srv/www/htdocs/fedora9), restart apache2. If the contents were copied to either the FTP (/srv/ftp/fedora9) or the exported NFS directory (/product/fedora9) then restart those services by typing in a terminal as root:
'service apache2 reload' or 'service apache2 restart'
'service nfsserver restart'
'service vsftpd restart'
/product/fedora9 *(ro,root_squash,sync)
- The "/product/fedora9" directory is the directory that needs to be exported.
- * or asterisk symbol means that any and all hosts on the network for purposes of remote installation are allowed to access the "/product/fedora9" directory.
- The "ro" means all files on the share to be read-only. This is the default behavior.
- root_squash maps the root user to the nobody user. This has the effect of not allowing a root user on a client to gain root file access permissions on the server.
- sync ensures data is written to disk before another request is serviced.
To start the NFS server, type in a terminal as root:
service nfsserver start
To have the NFS server start at run levels 3 and 5 or at boot time, type in a terminal as root:
chkconfig -s nfsserver 35
chkconfig -s nfsserver on
NOTE: the " -s " option in the command "chkconfig -s" means the service that is to be started.
FTP CONFIGURATION
'cp -a * /srv/www/htdocs/fedora9'In a terminal as root, type:
mkdir /srv/ftp/fedora9
To start the FTP server, type in a terminal as root:
service vsftpd start
chkconfig -s vsftpd 35
chkconfig -s vsftpd on
NOTE: Remember that the 3 and 5 in the "chkconfig -s service 35" are the particular run levels to have the service start at boot time.
mkdir /srv/ftp/fedora9
To start the FTP server, type in a terminal as root:
service vsftpd start
chkconfig -s vsftpd 35
chkconfig -s vsftpd on
NOTE: Remember that the 3 and 5 in the "chkconfig -s service 35" are the particular run levels to have the service start at boot time.
HTTP CONFIGURATION
A directory needs to be made in the http directory that will contain the installation files. In a terminal as root, type the following:
mkdir /srv/www/htdocs/fedora9
service apache2 start
chkconfig -s apache2 35
chkconfig -s apache2 on
mkdir /srv/www/htdocs/fedora9
service apache2 start
chkconfig -s apache2 35
chkconfig -s apache2 on
FIREWALL CONFIGURATION
To have this installation server be successful with regards to security, the firewall needs to be configured for NFS, HTTP and FTP services.
To do this, open YAST > Security and Users > Firewall. Select "Allowed Services" from the column on the left. In the "Allowed Services for Selected Zone" drop down list, ensure "External Zone" is selected. In the "Service to Allow" drop down list, select and add "NFS", "HTTP" and "FTP". Select the "Next" button and "Accept" to finish the configuration.
To do this, open YAST > Security and Users > Firewall. Select "Allowed Services" from the column on the left. In the "Allowed Services for Selected Zone" drop down list, ensure "External Zone" is selected. In the "Service to Allow" drop down list, select and add "NFS", "HTTP" and "FTP". Select the "Next" button and "Accept" to finish the configuration.
MOUNTING THE ISO
Mounting the ISO by itself as a loop device allows for the copying of the contents to another directory. This is done so that the remote system has access to the installation files and directories during the installation process. The directories called 'fedora9' have already been created in their prospective paths (FTP, HTTP and NFS). To do this, open a terminal and type as root:
'mount /product/fedora9dvd/*.iso /mnt -o loop'
'cd /mnt'
Verify the contents are in the /mnt directory.
'mount /product/fedora9dvd/*.iso /mnt -o loop'
'cd /mnt'
Verify the contents are in the /mnt directory.
'cp -a * /srv/ftp/fedora9'
'cp -a * /product/fedora9'
After the contents have been copied, which might of taken a while, exit out of the /mnt directory and unmount the directory that the ISO is mount to. To do this, type the following in a terminal as root:
'umount /mnt'
Restart the services in relation to which the contents of the ISO have been copied. For example, If the contents of the ISO had been copied to the HTTP directory (/srv/www/htdocs/fedora9), restart apache2. If the contents were copied to either the FTP (/srv/ftp/fedora9) or the exported NFS directory (/product/fedora9) then restart those services by typing in a terminal as root:
'service apache2 reload' or 'service apache2 restart'
'service nfsserver restart'
'service vsftpd restart'
PERFORMING THE INSTALLATION
On the computer that, in this example, Fedora 9, is to be installed, insert the network installation cd.
The network installation cd can either be obtained directly from the Fedora 9 DVD or by downloading it from the index of Fedora releases. The particular network installation cd is called "netins.iso" or from the DVD.iso, copy the "boot.iso" that is located in the images directory, to a computer that can burn images to a cd and burn it.
Boot up the network installation cd. The method of installation depends where the installation files are located. The choices are either NFS or URL in regards to installing via a network.
NFS - refers to a local directory on the local network
URL - refers to a directory that uses a URL, such as "ftp://" or "http://"
If the method of a NFS installation will be used, choose the "NFS directory" option. In the next window labeled "Configure TCP/IP" The example in this document uses the manual IPv4 configuration. Use an ip address that is not in use. Next, use the network subnet that the installation server is on. Finally, use the gateway address.
NOTE: Leave the name server field blank. For the purposes of this document, a name server is not used.
The next window is the NFS setup. This field is the IP address of the installation server. The next field is the particular directory the installation files are located (/product/fedora9). After those fields are configured, proceed with the "OK" button.
The network installation cd can either be obtained directly from the Fedora 9 DVD or by downloading it from the index of Fedora releases. The particular network installation cd is called "netins.iso" or from the DVD.iso, copy the "boot.iso" that is located in the images directory, to a computer that can burn images to a cd and burn it.
Boot up the network installation cd. The method of installation depends where the installation files are located. The choices are either NFS or URL in regards to installing via a network.
NFS - refers to a local directory on the local network
URL - refers to a directory that uses a URL, such as "ftp://" or "http://"
NFS METHOD
If the method of a NFS installation will be used, choose the "NFS directory" option. In the next window labeled "Configure TCP/IP" The example in this document uses the manual IPv4 configuration. Use an ip address that is not in use. Next, use the network subnet that the installation server is on. Finally, use the gateway address.
NOTE: Leave the name server field blank. For the purposes of this document, a name server is not used.
The next window is the NFS setup. This field is the IP address of the installation server. The next field is the particular directory the installation files are located (/product/fedora9). After those fields are configured, proceed with the "OK" button.
FTP AND HTTP METHOD
Select the URL method of installation. Input the manual configuration of IPv4. The next window titled "URL Setup" is the field that requires either a HTTP address or a FTP address. For example, if a http or ftp installation is going to take place, all that needs typed is "http://ip.address/fedora9" or "ftp://ip.address/fedora9"
the actual installation over the network is the same as though installation were done directly from the media itself.
NOTE: Some older computers, no matter what has been done, will not be able to perform a remote Linux installation.
the actual installation over the network is the same as though installation were done directly from the media itself.
NOTE: Some older computers, no matter what has been done, will not be able to perform a remote Linux installation.
UPDATES AND SOFTWARE REPOSITORIES
After the installation has been completed, in this example, Fedora 9, the software and update repositories need to be configured. to do this, the NFS directory which is located on the installation server needs to be mounted. First, as root, created a directory called /f9 on the root partition. Open a terminal and as root type the following:
mkdir /f9
To mount the NFS directory:
mount -t nfs ip.address.of.installation.server:/product/fedora9 /f9
Next, the yum repository configuration files need to be modified. These files tell the system where to look for additional software and updates. The particular files are called "fedora.repo" and "fedora-updates.repo" . They are located in /etc/yum.repos.d directory on Fedora 9. In this example, these files need to be modified to read from the local installation server. After backing up these files, begin by opening a terminal and as root type:
vi /etc/yum.repos.d/fedora.repo
or
gedit /etc/yum.repos.d/fedora.repo
The 5th line down from the top is the line: mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
Comment this line out by adding a pound or # sign in front of "mirrorlist. It should look like:
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
Directly below this line, add the local software repository: baseurl=file:///f9 and save the file.
NOTE: Remember the "/f9" directory is where the remote NFS installation directory is mounted.
Finally, the the fedora-updates.repo file needs to be modified to receive the updates to the software.
Begin by opening a terminal and as root type:
vi /etc/yum.repos.d/fedora-updates.repo
or
gedit /etc/yum.repos.d/fedora-updates.repo
The 5th line down from the top is the line: mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
Again, comment this line out by adding a pound or # sign in front of "mirrorlist. It should look like:
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
Directly below this line, add the local software repository: baseurl=file:///f9/Updates/i386 and save the file.
Now, the Fedora 9 installation that has been performed is able to receive additional software and updates from the Network Installation Server.
mkdir /f9
To mount the NFS directory:
mount -t nfs ip.address.of.installation.server:/product/fedora9 /f9
Next, the yum repository configuration files need to be modified. These files tell the system where to look for additional software and updates. The particular files are called "fedora.repo" and "fedora-updates.repo" . They are located in /etc/yum.repos.d directory on Fedora 9. In this example, these files need to be modified to read from the local installation server. After backing up these files, begin by opening a terminal and as root type:
vi /etc/yum.repos.d/fedora.repo
or
gedit /etc/yum.repos.d/fedora.repo
The 5th line down from the top is the line: mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
Comment this line out by adding a pound or # sign in front of "mirrorlist. It should look like:
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
Directly below this line, add the local software repository: baseurl=file:///f9 and save the file.
NOTE: Remember the "/f9" directory is where the remote NFS installation directory is mounted.
Finally, the the fedora-updates.repo file needs to be modified to receive the updates to the software.
Begin by opening a terminal and as root type:
vi /etc/yum.repos.d/fedora-updates.repo
or
gedit /etc/yum.repos.d/fedora-updates.repo
The 5th line down from the top is the line: mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
Again, comment this line out by adding a pound or # sign in front of "mirrorlist. It should look like:
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
Directly below this line, add the local software repository: baseurl=file:///f9/Updates/i386 and save the file.
Now, the Fedora 9 installation that has been performed is able to receive additional software and updates from the Network Installation Server.
CONCLUSION
With the use of a local network based Linux installation server, organizations can save both time and bandwidth. Further more, adding an update repository on a local installation server could ensure package availability as well as an increase in productivity
In this document, a Network Installation Server had been created using SLES 10. In addition, HTTP, FTP and NFS methods of installation have been configured and tested and repositories have been added.
In this document, a Network Installation Server had been created using SLES 10. In addition, HTTP, FTP and NFS methods of installation have been configured and tested and repositories have been added.
ADDITIONAL INFORMATION
Installation Server Setup
A Tour of NFS
We welcome any and all helpful ideas, questions, comments and suggestions.
--GeS
A Tour of NFS
We welcome any and all helpful ideas, questions, comments and suggestions.
--GeS
0 comments:
Post a Comment