Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| centos:repo-own [03.03.2011 17:15. ] – [repository-sync-Script] django | centos:repo-own [20.04.2018 10:38. ] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| + | ====== Eigenes Repository einrichten ====== | ||
| + | {{: | ||
| + | |||
| + | ===== Zielverzeichnis(se) anlegen ===== | ||
| + | Als erstes legen wir unsere Zielpfade an, in denen später die Dateien abgelegt werden sollen. | ||
| + | ==== Centos Base ==== | ||
| + | < | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | ==== rpmforge ==== | ||
| + | Für das **rpmforge-Repository** legen wir auch gleich noch im nächsten Schritt die Verzeichnisstruktur an: | ||
| + | < | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | # mkdir -p / | ||
| + | |||
| + | ==== eigenes Repository ==== | ||
| + | Für etwaig eigene Repositories legen wir zu guter Letzt auich noch die benötigten Verzeichnisse an. | ||
| + | < | ||
| + | # mkdir -p / | ||
| + | ===== initiale Befüllung ===== | ||
| + | Im nächsten Schritt befüllen wir das erste mal unsere lokalen Zielverzeichnisse, | ||
| + | ==== ISO-Images ==== | ||
| + | # / | ||
| + | # / | ||
| + | ==== Centos Base ==== | ||
| + | < | ||
| + | # / | ||
| + | # / | ||
| + | # / | ||
| + | # / | ||
| + | # / | ||
| + | ==== rpmforge ==== | ||
| + | # / | ||
| + | ===== täglicher automatischer Abgleich ===== | ||
| + | Damit unser vorhandenes gespiegeltes Repository immer schön aktuell bleibt, werden wir nun einmal täglich automatisch die Dateien abgleichen lassen. | ||
| + | ==== repository-sync-Script ==== | ||
| + | Hierzu legen wir uns als erstes ein entsprechendes Script an. Mit dem editor unserer Wahl, so z.B. **vim** legen wir ein Script mit dem Namen '' | ||
| + | # vim / | ||
| + | |||
| + | <code bash| sync-repository.sh> | ||
| + | |||
| + | # sync-repository.sh: | ||
| + | # | ||
| + | # Copyright (C) 2009 Django | ||
| + | # | ||
| + | # This program is free software; you can redistribute it and/or | ||
| + | # modify it under the terms of the GNU General Public License | ||
| + | # as published by the Free Software Foundation; either version 2 | ||
| + | # of the License, or (at your option) any later version. | ||
| + | # | ||
| + | # This program is distributed in the hope that it will be useful, | ||
| + | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| + | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
| + | # GNU General Public License for more details. | ||
| + | # | ||
| + | # You should have received a copy of the GNU General Public License | ||
| + | # along with this program; if not, write to the Free Software | ||
| + | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| + | # Or, point your browser to http:// | ||
| + | # | ||
| + | # The author can be reached at django[aett]omni128mnet-mail[punkt]de | ||
| + | # | ||
| + | # The document-page is at http:// | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # CentOS aktuell | ||
| + | # | ||
| + | # (!!! isos und os auskommentieren wenn 1. mirror gelaufen, da spaeter keine Aenderungen !!!) | ||
| + | / | ||
| + | / | ||
| + | # | ||
| + | echo " | ||
| + | / | ||
| + | echo " | ||
| + | / | ||
| + | echo " | ||
| + | / | ||
| + | echo " | ||
| + | / | ||
| + | echo " | ||
| + | / | ||
| + | echo " | ||
| + | / | ||
| + | # | ||
| + | # | ||
| + | # RPMForge Repository | ||
| + | # | ||
| + | echo " | ||
| + | / | ||
| + | |||
| + | </ | ||
| + | Anschließend setzen wir noch die Ausführungsrechte an unserem Script. | ||
| + | # chmod +x vim / | ||
| + | ==== täglichen cronjob ==== | ||
| + | Für den automatischen Abgleich, tragen wir den Aufruf unseres Scriptes in die ''/ | ||
| + | < | ||
| + | |||
| + | # repository update | ||
| + | # eingefügt am 21.06.2009 | ||
| + | 20 1 * * * root / | ||
| + | ===== V-Host Definition für unser Repository ===== | ||
| + | Für den Zugriff via Web-Browser richten wir uns noch einen V-Host auf unserem Apache-Webserver ein. Hierzu tragen wir in die '' | ||
| + | # vim / | ||
| + | <code apache vhosts.conf> | ||
| + | |||
| + | # | ||
| + | # repository | ||
| + | # | ||
| + | |||
| + | < | ||
| + | ServerAdmin webmaster@nausch.org | ||
| + | ServerName repository.nausch.org: | ||
| + | ServerAlias repository.nausch.org www.repository.nausch.org | ||
| + | ServerPath / | ||
| + | DocumentRoot "/ | ||
| + | < | ||
| + | Options Indexes FollowSymLinks | ||
| + | AllowOverride None | ||
| + | Order allow,deny | ||
| + | Allow from all | ||
| + | </ | ||
| + | # Hide file favicon.ico from indexes | ||
| + | IndexIgnore favicon.ico | ||
| + | # Hide file robots.txt from indexes | ||
| + | IndexIgnore robots.txt | ||
| + | # Hide directory repodata from indexes | ||
| + | IndexIgnore repodata | ||
| + | # Hide file mirrotlist from indexes | ||
| + | IndexIgnore mirrorlist | ||
| + | # Protect directory repodata from direct access | ||
| + | < | ||
| + | Options FollowSymLinks | ||
| + | AllowOverride None | ||
| + | Order deny,allow | ||
| + | Deny from all | ||
| + | </ | ||
| + | < | ||
| + | Options Indexes FollowSymLinks | ||
| + | AllowOverride None | ||
| + | Order Deny,Allow | ||
| + | Deny from all | ||
| + | Allow from 127.0.0.1 | ||
| + | Allow from 192.168.10.0/ | ||
| + | </ | ||
| + | < | ||
| + | Options Indexes FollowSymLinks | ||
| + | AllowOverride None | ||
| + | Order Deny,Allow | ||
| + | Deny from all | ||
| + | Allow from 127.0.0.1 | ||
| + | Allow from 192.168.10.0/ | ||
| + | </ | ||
| + | |||
| + | DirectoryIndex index.html | ||
| + | ErrorLog logs/ | ||
| + | CustomLog logs/ | ||
| + | </ | ||
| + | </ | ||
| + | Anschließend geben wir unserem neuen V-Host unserem Webserver bekannt, in dem wir diesen 1x durchstarten. | ||
| + | # service httpd restart | ||
| + | ===== / | ||
| + | Damit nun unsere Clienten auf unser eigenen lokales Repository zugreifen, definieren wir im Verzeichnis ''/ | ||
| + | Zuerst aber sichern wir die Originaldateien, | ||
| + | # mv / | ||
| + | # mv / | ||
| + | Anschließend erstellen wir unsere eigenen Konfigurationsdateien. | ||
| + | < | ||
| + | |||
| + | # CentOS-LOCAL.repo | ||
| + | # | ||
| + | # This file uses a new mirrorlist system developed by Lance Davis for CentOS. | ||
| + | # The mirror system uses the connecting IP address of the client and the | ||
| + | # update status of each mirror to pick mirrors that are updated to and | ||
| + | # geographically close to the client. | ||
| + | # unless you are manually picking other mirrors. | ||
| + | # | ||
| + | # If the mirrorlist= does not work for you, as a fall back you can try the | ||
| + | # remarked out baseurl= line instead. | ||
| + | # | ||
| + | # Version für den Zugriff auf das lokale Centos-Repository | ||
| + | |||
| + | [base-LC] | ||
| + | name=CentOS-5 - Base | ||
| + | baseurl=http:// | ||
| + | priority=1 | ||
| + | gpgcheck=1 | ||
| + | gpgkey=http:// | ||
| + | |||
| + | #released updates | ||
| + | [updates-LC] | ||
| + | name=CentOS-5 - Updates | ||
| + | baseurl=http:// | ||
| + | priority=1 | ||
| + | gpgcheck=1 | ||
| + | gpgkey=http:// | ||
| + | |||
| + | #packages used/ | ||
| + | [addons-LC] | ||
| + | name=CentOS-5 - Addons | ||
| + | baseurl=http:// | ||
| + | priority=1 | ||
| + | gpgcheck=1 | ||
| + | gpgkey=http:// | ||
| + | |||
| + | #additional packages that may be useful | ||
| + | [extras-LC] | ||
| + | name=CentOS-5 - Extras | ||
| + | baseurl=http:// | ||
| + | priority=1 | ||
| + | gpgcheck=1 | ||
| + | gpgkey=http:// | ||
| + | enabled = 1 | ||
| + | |||
| + | #additional packages that extend functionality of existing packages | ||
| + | [centosplus-LC] | ||
| + | name=CentOS-5 - Plus | ||
| + | baseurl=http:// | ||
| + | priority=2 | ||
| + | gpgcheck=1 | ||
| + | enabled=1 | ||
| + | gpgkey=http:// | ||
| + | Das Gleiche machen wir nun für das **rpmforge-Repository** | ||
| + | < | ||
| + | |||
| + | # Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag | ||
| + | # URL: http:// | ||
| + | # geändert auf locales Repository | ||
| + | |||
| + | [rpmforge-LC] | ||
| + | name = Red Hat Enterprise $releasever - RPMforge.net - dag | ||
| + | baseurl = http:// | ||
| + | enabled = 1 | ||
| + | priority=10 | ||
| + | protect = 0 | ||
| + | gpgkey = file:/// | ||
| + | gpgcheck = 1</ | ||
| + | Mit einem '' | ||
| + | # yum clean all | ||
| + | | ||
| + | | ||
| + | | ||
| + | Abschließend bauen wir die Datenbank neu auf: | ||
| + | < | ||
| + | Loaded plugins: fastestmirror, | ||
| + | Determining fastest mirrors | ||
| + | rpmforge-LC | ||
| + | primary.xml.gz | ||
| + | rpmforge-LC | ||
| + | extras-LC | ||
| + | primary.xml.gz | ||
| + | extras-LC | ||
| + | addons-LC | ||
| + | primary.xml.gz | ||
| + | base-LC | ||
| + | primary.xml.gz | ||
| + | base-LC | ||
| + | adobe-linux-i386 | ||
| + | primary.xml.gz | ||
| + | adobe-linux-i386 | ||
| + | updates-LC | ||
| + | primary.xml.gz | ||
| + | updates-LC | ||
| + | centosplus-LC | ||
| + | primary.xml.gz | ||
| + | centosplus-LC | ||
| + | 491 packages excluded due to repository priority protections</ | ||
| + | ====== Repository Metadaten für eigenes Repository generieren ====== | ||
| + | Möchte man RPM-Pakete aus dem zuvor generierten Repository komfortabel einbinden, muss aus den RPM-Paketen in dem gewählten Verzeichnis noch ein gemeinsames metadata Repository generiert werden. Hierzu bedienen wir uns des Dienstprogrammes '' | ||
| + | |||
| + | ===== Installation ===== | ||
| + | Wie soll es anders sein, funktioniert die Installation des benötigten Programms im gewohnten Rahmen via **yum**, welches wir als User **root** ausführen. | ||
| + | # su - | ||
| + | |||
| + | # yum install createrepo | ||
| + | Was uns das Paket **createrepo** alles mitbringt offenbart eine Blick, nach erfolgter Installation des Paketes, in das **RPM**. | ||
| + | < | ||
| + | # rpm -iql createrepo | ||
| + | Name : createrepo | ||
| + | Version | ||
| + | Release | ||
| + | Install Date: Mo 28 Dez 2009 23:42:06 CET Build Host: builder15.centos.org | ||
| + | Group : System Environment/ | ||
| + | Size : 221261 | ||
| + | Signature | ||
| + | URL : http:// | ||
| + | Summary | ||
| + | Description : | ||
| + | Dieses Dienstprogramm wird ein gemeinsames metadata Repository aus einem | ||
| + | Verzeichnis von rpm Paketen generieren | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | ===== createrepo ===== | ||
| + | Die Metadaten für unser eigenes Repository legen wir dann mit dem Programm **createrepo** an. | ||
| + | # createrepo / | ||
| + | Möchten wir einzelne Pakete die im entsprechende Verzeichnis liegen ausnehmen, so können wir diese einfach "// | ||
| + | < | ||
| + | 1/1 - dansguardian-2.10.1.1-1.0.el5.i386.rpm | ||
| + | Saving Primary metadata | ||
| + | Saving file lists metadata | ||
| + | Saving other metadata</ | ||
| + | Einfacher geht es natürlich, wenn man in einer separaten Liste nur die Dateien aufführt, die in das Repository aufgenommen werden sollen. Hierzu legen wir uns eine entsprechende Datei an. | ||
| + | # vim / | ||
| + | Darin hinterlegen wir unsere Dateiennamen in einer Liste. | ||
| + | < | ||
| + | |||
| + | dansguardian-2.10.1.1-1.0.el5.i386.rpm</ | ||
| + | Anschließend rufen wir **// | ||
| + | < | ||
| + | 1/1 - dansguardian-2.10.1.1-1.0.el5.i386.rpm | ||
| + | Saving Primary metadata | ||
| + | Saving file lists metadata | ||
| + | Saving other metadata</ | ||
| + | |||