Category Archives: SME Server

Howto setup mrepo in SME 7.3

0
Filed under SME Server

I often need to test different Linux distributions, or the distributions on different machine types / architectures. And quite often, I need to either update the installed software, or install extra software, which needs to be downloaded from the Internet. SO, I need a way to preserve / save my bandwidth for all those duplicate downloads. One way, is to download what I need to an FTP server on the LAN, and then install it via rpm from the FTP server. This is a lot of work, and when done repeatedly become tedious.

So, instead I’m going to install mrepo, which replicates repos from upstream providers. This will also setup your FTP / HTTP / NFS server with all the repo files to act as a repo on the local LAN. The upside to this?

  • Your Internet bandwidth consumption will be less
  • You’ll have the full repository of any Linux that you install on your local LAN
  • It’s easy to point any PC / server to this repository for updates

<-- more -->

So, let’s get started. First, we need to enable the Dag Wiers repository, as follows:

[php]wget http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt

rpm –import RPM-GPG-KEY.dag.txt /sbin/e-smith/db yum_repositories set dag repository \
Name ‘Dag – EL4′ \
BaseURL ‘http://apt.sw.be/redhat/el4/en/$basearch/dag’ \
EnableGroups no \
GPGCheck yes \
GPGKey http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt \
Visible no \
Exclude freetype,htop,iptraf,rsync,syslinux \
status disabled

expand-template /etc/yum.conf[/php]

I’m not going to go into too much detail on the commands above, but it basically imports the RPM-GPG-KEY from the Dag Wiers website, adds the repository to your list of installable repositories, and then expands / rebuild the yum.conf file to make it active, without having to reboot.

Next we need to configure mrepo for SME purposes to make it easy to use. The config file is in /etc/mrepo.conf

[php]
### Configuration file for mrepo

### The [main] section allows to override mrepo’s default settings
### The mrepo-example.conf gives an overview of all the possible settings
[main]
# This is where the repositories will be stored
srcdir = /home/e-smith/files/ibays/linux/files/repo
# This is where the http repository links will be created
wwwdir = /home/e-smith/files/ibays/linux/html/repo
# Add the config dir to the iBays, which makes it easier to add new distro’s from Windows
confdir = /etc/mrepo.conf.d
# We can want setup a repo for the standard i386 as well as x64 PC’s
arch = x86_64 i386

mailto = root@localhost
smtp-server = localhost

### Any other section is considered a definition for a distribution
### You can put distribution sections in /etc/mrepo.conf.d/
### Examples can be found in the documentation at:
### /usr/share/doc/mrepo-0.8.4/dists/.
[/php]

The full list of options can be found here: http://svn.rpmforge.net/svn/trunk/tools/mrepo/config/mrepo-example.conf

Lastly, we add the Linux distro’s that we want to put in our local repository.
Create a file, /home/e-smith/files/ibays/linux/files/mrepo.conf.d/centos5.conf, which contains the following:

[php]
### Name: The Community Enterprise Operating System v5
### URL: http://www.centos.org/

[centos5]
name = CentOS $release ($arch)
release = 5
#arch = i386 x86_64 ia64 ppc s390 s390x alpha
arch = x86_64 i386
metadata = repomd repoview

### ISO images
iso = http://mirror.centos.org/pub/centos/$release/isos/$arch/CentOS-$release-$arch-bin?of4.iso
#os = http://mirror.centos.org/centos/$release/os/$arch/CentOS/RPMS/

### Additional repositories
updates = http://mirror.centos.org/centos/$release/updates/$arch/RPMS/
fasttrack = http://mirror.centos.org/centos/$release/fasttrack/$arch/RPMS/
centosplus = http://mirror.centos.org/centos/$release/centosplus/$arch/RPMS/
extras = http://mirror.centos.org/centos/$release/extras/$arch/RPMS/
addons = http://mirror.centos.org/centos/$release/addons/$arch/RPMS/

### RPMforge repository
rpmforge = rsync://apt.sw.be/pub/freshrpms/pub/dag/redhat/el5/en/$arch/RPMS.dag/
#rpmforge = ftp://apt.sw.be/pub/dag/pub/redhat/el5/en/$arch/RPMS.dag/
#rpmforge = http://apt.sw.be/redhat/el5/en/$arch/RPMS.dag/

### ATrpms repository
#atrpms-stable = rsync://dl.atrpms.net/dl.atrpms.net/el$release-$arch/atrpms/stable/

### OpenVZ repositories
#ovzkernel = http://download.openvz.org/kernel/rhel5/
#ovztemplate = http://download.openvz.org/template/
#ovzutils = http://download.openvz.org/utils/

### PostgreSQL repository
#postgresql = ftp://ftp.fr.postgresql.org/binary/v8.1.4/linux/rpms/redhat/rhel-as-$release-$arch/

### Custom repository for your own RPM packages
custom =
[/php]

A list of distro’s can be found here: http://svn.rpmforge.net/svn/trunk/tools/mrepo/config/dists/
One last thing I like to change, is in the /usr/bin/mrepo file. I know this isn’t totally recommended, but it’s my preference. mrepo saves the repos as follows: /distro{ver}-{arch} and I prefer to have it /distro{ver}/{arch} – which is a bit neater in my opinion, so we edit /usr/bin/mrepo and change line 319 as follows:

[php]
318> self.dist = dist
319> self.nick = dist + ‘/’ + arch
[/php]
to
[php]
318> self.dist = dist
319> self.nick = dist + ‘/’ + arch
[/php]

Now, you just run mrepo -v -gn centos5 to download the CentOS5 repositories.

More info on mrepo can be found on:
http://dag.wieers.com/home-made/mrepo/
http://svn.rpmforge.net/svn/trunk/tools/mrepo/config/
http://www.brandonhutchinson.com/mrepo_configuration.html

P.S. If you do get an error about lftp not being installed, as follows:
[php]
mrepo: lftp was not found. fish, ftp, http and sftp support (using lftp) is therefor disabled.
[/php]
then simply install it with yum, as such
[php]
yum -y install lftp
[/php]

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis

Howto write an ISO image to a CD-RW from the Linux console

0
Filed under HOWTO\'s, SME Server

I need to / want to write ISO’s to CD’s from my Linux server, but since I don’t have an X-Manager like Gnome or KDE running, I need to find a way to write the CD’s from the command line with SSH. Luckely the server is right next to me, and it’s got a CDRW drive. It’s an old 24 speed Samsung CDRW, but that’s fine, it can still do the job well. The only tool I could find that was already installed on my SME 7.3 server (which is based on CentOS 4.6), is cdrecord cdrecord is a command line utility that can write CD’s, erase rewritable (CDRW) cd’s and write DVD’s as well. I’m not going to go into too much about cdrecord, but will outline some basics on how to write a CD from Linux’s commandline. Let’s get started….. First, we need to see where our cdwriter is in the system, with the following command: [shell] cdrecord -scanbus [/shell] This command will scan your PC for CD witers & DVD writers, and tell you on which bus they are. The output could look like this: [/php] scsidev: ‘ATA’ devname: ‘ATA’ scsibus: -2 target: -2 lun: -2 Linux sg driver version: 3.5.27 Using libscg version ’schily-0.8′. cdrecord: Warning: using inofficial libscg transport code version (schily – Red Hat-scsi-linux-sg.c-1.83-RH ‘@(#)scsi-linux-sg.c 1.83 04/05/20 Copyright 1997 J. Schilling’). scsibus0: 0,0,0 0) * 0,1,0 1) ‘SAMSUNG ‘ ‘CD-R/RW SW-224B ‘ ‘R205′ Removable CD-ROM 0,2,0 2) * 0,3,0 3) * 0,4,0 4) * 0,5,0 5) * 0,6,0 6) * 0,7,0 7) * [/php] From this, I can see that my Samsung CD writer is on bus 0, with SCSI id 1 and LUN 0. We’ll need this info later to tell cdrecord which writer to use. If you have more than 1 writer, you’ll need to choose the one with the disk in it. So, to write a CD, I use the following commands: [php] cdrecord -v -dao -speed=24 -eject dev=ATA:0,1,0 centos51.iso [/shell] This will write the file, centos51.iso (for example) to the CD writer at a speed of 24x and then eject it once it’s done. How do I write to a rewritable CD that already has some data on it? Easy. With the blank=fast option :) [php] cdrecord blank=fast -v -dao -speed=24 -eject dev=ATA:0,1,0 centos51.iso [/php] And that’s it. If you need to know more about cdrecord, or want todo more advanced stuff, then you could either visit the cdrecord documents page, or you could just check the help options, with cdrecord -h

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis

Howto install the Realtek8110C/8169C driver in SME 7.3

0
Filed under SME Server

I have a Gigabyte GA-G31MX-S2 and I run SME Server 7.3 on it. The motherboard has an onboard Realtek 8110C Gigabit Ethernet card, which isn’t supported in CentOS 4.6 (or even CentOS 5 for that matter), so I need to manually install a driver to get it to work. Since I have a 2U server case, which only allows me 1 additional PCI card, and I already have a DGE-528T Gigabit Ethernet Adapter, I have no other choice but to install a driver for this card. I don’t want to go and purchase another motherboard, since these are rather cheap, and packed with nice features. Searching the internet, SME Forums, and the CentOS Forums, and found this useful post: Network card Installation help Urgently needed From here I can see that I need to install the following: [php] yum –enablerepo=dag install dkms kernel-devel dkms-r1000 [/php] P.S. I have already enabled the Dag Wieer’s Repository, as can be seen in this post: Howto setup a local yum proxy for your LAN using http-replicator on SME Server 7.0

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis

Howto setup a local yum proxy for your LAN using http-replicator on SME Server 7.0

0
Filed under HOWTO\'s, SME Server

So you want to setup a local proxy to apt & yum updates for your LAN. This will help save you some bandwidth if you have a a few PC’s on the LAN that use yum to install & update any software.

From the homepage, http://dag.wieers.com/rpm/packages/http-replicator/, we can see the following:

HTTP Replicator is a general purpose, replicating HTTP proxy server.

All downloads through the proxy are checked against a private cache, which is an exact copy of the remote file structure. If the requested file is in the cache, replicator sends it out at LAN speeds. If not in the cache, it will simultaneously download the file and stream it to multiple clients.

No matter how many machines request the same file, only one copy comes down the Internet pipe. This is very useful for maintaining a cache of Linux packages.

Read More »

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis