Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
TIP: Simply distfiles mirror
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
soya
Guru
Guru


Joined: 29 Jan 2004
Posts: 429

PostPosted: Tue Apr 05, 2005 11:00 pm    Post subject: TIP: Simply distfiles mirror Reply with quote

TIP: GENTOO DISTFILES MIRROR


Well today i've been reading how to create a rsync LAN sever. After doing it i wanted a distfiles LAN server. I must say it's oriented to LAN usage, but if you have a domain and also could work over inet with some slight modifications.

I'm only going to describe how to share /usr/portage over http to the LAN so everyone can access it with emerge. The main advantage is that you have packages centralized on a server and if it doesn't have the package you're looking for emerge will automatically step to next gentoo mirror and download it from inet. You can also download all packages to your server so they're are always shared to the rest of your network reducing your network traffic and someone somewhere inet traffic, which is not free. I think that this and a rsync servre is a pretty good idea if you have more than one gentoo OS in the same net.

All you need is apache up and running to share /usr/portage over http, restricting it to LAN traffic only
Code:

emerge apache


You can edit some options if you want in /etc/apache2/conf/apache2.conf. The imprescindible is that in the virtual hosts section:
Code:

###
### Virtual Hosts
###
# We include different templates for Virtual Hosting. Have a look in the
# vhosts directory and modify to suit your needs.
Include conf/vhosts/vhosts.conf


We're going to share /usr/portage and not /usr/portage/distfiles, cause when you emerge anything emerge adds "distfiles" to the end of the mirror, hope i made me understand.

Normally, people use to have a personal web or more than a host, so we're going to edit /etc/apache2/conf/vhosts/vhosts.conf
Code:

NameVirtualHost *:80
<VirtualHost *:80>
        ServerAdmin     root@localhost
        DocumentRoot    /usr/portage/
        ErrorLog        /var/log/apache2/LAN-portage-mirror
        ServerName      lan-portage-mirror #introducing it in your browser you will get /usr/portage over your lan net
        Setenv VLOG     /var/log/apache2/

        <Directory /usr/portage>
                AllowOverride All
                Options Indexes FollowSymLinks MultiViews
                Order Deny,Allow
                Allow from 172.26.0.0/255.255.255.0 #here you should place your IP net/mak adreces
        </Directory>
</VirtualHost>

In the same way you can add other hosts, now you have shared your /usr/portage directory over http restricting it to your network.

Now you only have to edit client side options:
Code:

# vi /etc/hosts
.
.
.
<IP_PORTAGE_MIRROR> lan-portage-mirror #taht should be the same name you edited in vhosts.conf file in ServerName section


now let's edit /etc/make.conf and add the following:
Code:

GENTOO_MIRRORS="http://lan-portage-mirror http://gentoo.inode.at/ etc................."


Well now when you emerge whatever portage will look first at your server. This tip could be complemented by creating a rsync server, which there are lots of howto's out there

I hope it can help someone :)

PD: If there are any error, post and will correct them, thanks.

sIbOk
_________________
Si el tonto te alaba laméntalo, si el listo te censura piénsalo.
Back to top
View user's profile Send private message
throck
n00b
n00b


Joined: 10 Apr 2004
Posts: 39

PostPosted: Wed Apr 06, 2005 8:46 pm    Post subject: Reply with quote

I don't want to say you wrote this for nothing, but you might also be interested in this thread: https://forums.gentoo.org/viewtopic.php?t=173226. It accomplished the same basic task, but caches the distfiles so if a second computer needs the same files as the first, it is already downloaded automagically.

throck
_________________
Adopt an Unanswered Post Initiative
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum