Install Reposado with Margarita on CentOS / Red Hat Enterprise Linux

Reposado installation

The instruction to install Reposado are available on the github project. The instruction on this post will be specific to the CentOS / Red Hat Enterprise Linux installation, if more informations are needed please consult the Reposado project.

– Go to the root of your drive and clone the sources of Reposado to your server :

cd /
git clone git://github.com/wdas/reposado.git

– Move the reposado directory to /usr/local/sbin/ :

mv reposado /usr/local/sbin

– Create any necessary directories :

mkdir -p /var/local/reposado/html/
mkdir -p /var/local/reposado/metadata/

– Configure Apache to share the correct folder and to authorize the folder listing by editing with vi :

vi /etc/httpd/conf/httpd.conf

– Search for the “DocumentRoot” entry and press “i” key to enter the “Insert mode”. Replace the standard path with :

/var/local/reposado/html

– A bit lower, edit the <Directory /> settings and add the “+Indexes” option :

<Directory />
 Options FollowSymLinks +Indexes
 AllowOverride None
</Directory>

– Exit the “Insert mode” by pressing the “ESC” key. Your file should look like this :

– Press the key “:” and enter the command “wq” to write the file and quit vi. The command appears at the bottom left of the screen. If you want to quit the file without saving, you can use the command :q!.
– CentOS and Red Hat Enterprise Linux are delivered with a wonderful tool to complicate life, SELinux. SELinux permits to configure the different levels of security of the system, and in our case where which software can access. We need to add the Apache webserver context to the Reposado html directory :

chcon -R -v --type=httpd_sys_content_t /var/local/reposado/html

– You can verify your last command using ls :

ls -Z /var/local/reposado/

– Add a rule to local firewall to allow the TCP port 80 and save it :

iptables -I INPUT -p tcp --dport 80 -j ACCEPT
iptables-save > /etc/sysconfig/iptables

– Remove the welcome message of Apache webserver :

rm -rf /etc/httpd/conf.d/welcome.conf

– Start the Apache web server and enable it on boot :

service httpd start
chkconfig httpd on

– Go to the Reposado binary directory and launch the configuration command :

cd /usr/local/sbin/reposado/code/
./repoutil --configure

– Proceed to configuration like the example below :

./repoutil --configure
 [root@localhost code]# ./repoutil --configure
 Path to store replicated catalogs and updates [None]: /var/local/reposado/html/ 
 Path to store Reposado metadata [None]: /var/local/reposado/metadata/
 Base URL for your local Software Update Service
 (Example: http://su.your.org -- leave empty if you are not replicating updates) [None]: updates.adminsys.ch

– Add a rule to sync updates from Apple to Reposado (this example adds a rule every day at 3 am) :

crontab -e

– Press “i” key to enter the “Insert mode” and add a new line to the blank file :

00      03      *       *       *       /usr/local/sbin/reposado/code/repo_sync

– Exit the “Insert mode” by pressing the “ESC” key. Your file should look like this :

– Press the key “:” and enter the command “wq” to write the file and quit vi. The command appears at the bottom left of the screen. If you want to quit the file without saving, you can use the command :q!.

– Start the scheduler tool (crontab) and enable it on boot :

service crond start
chkconfig crond on

– Start the initial sync by running this command and :

/usr/local/sbin/reposado/code/repo_sync

– Check if your new update server can be accessed by the web and if few folders appears :

Reposado is correctly installed on your system. You can use it like that by referring to the official documentation. Or you can continue to read this post and learn how to install a web interface to manage Reposado.

12 Replies to “Install Reposado with Margarita on CentOS / Red Hat Enterprise Linux”

  1. absolutely beautiful howto guide – worked perfectly

    also, per the instructions here, i added a .htaccess file to the directory /var/local/reposado/html

    with instructions found here:

    https://github.com/wdas/reposado/blob/master/docs/URL_rewrites.txt

    so as i only needed to put the catalogURL as http://example.com/index.sucatalog on client machines and the apache2 mod_rewrite engine on the reposado box figured out which index to send it to regardless of version of the macosx client

    again, thank you for this wonderful page.

  2. I was curious if you have found a way to secure this with .htaccess? I have so far been unsuccessful. Margarita doesn’t respect the the file.

  3. Thanks for this tutorial.

    The standard command to configure the client is:
    sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL

  4. failure: repodata/c7c64887b23d8a76ac7d8b0b4a2673a3e832963c948a8700c8647f4fa8bbd339-primary.sqlite.bz2 from updates: [Errno 256] No more mirrors to try.

    problem connecting to softer sources

    plz help me in this regards

    thank u

  5. Brilliant work here…a single run through the setup process on Centos 6.5 resulted in a fully working reposado + margarita configuration.

    Thank you for providing such a detailed walkthrough.

  6. I am not familiar with reposado but we have working outdated reposado and just wonder how can I update so the yosemette and elcapitan clients can update from?

Leave a Reply

Your email address will not be published. Required fields are marked *

*