Intrepid has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks and nuns of the Monastery. I'm having trouble setting up cpanplus running on Gnu/Linux to use a partial cpan mirror (a Mini-cpan created with the code of that name) ...on another Linux system on my LAN. On that server I have apache running and serving (a few) static web pages successfully. I acknowledge that this question may have less to do with Perl and more with system administration & configuration, but there are undoubtedly monks here who are very good at that stuff too.

Here's a snippet of what my cpanplus config currently holds:

$Conf->{'conf'}->{'hosts'} = [ { 'scheme' => 'http', 'path' => '/www/public/minicpan', 'host' => '192.168.1.7' }, { 'scheme' => 'http', 'path' => '/', 'host' => 'www.cpan.org' }, ];

I've tried the following variations on path =>:

/minicpan
/public/minicpan
/www/public/minicpan

But none of these work. The failure is seen as

CPAN Terminal> i Archive::Any --verbose Installing Archive::Any (0.0946) [MSG] Trying to get 'http://192.168.1.7/www/public/minicpan/authors/ +id/O/OA/OALDERS/Archive-Any-0.0946.tar.gz' Fetch failed! HTTP response: 404 Not Found [404 Not Found] at /usr/l +ocal/lib/perl5/site_perl/CPANPLUS/Internals/Fetch.pm line 398.

That's pretty clear. One more detail I ought to add is that my minicpan is actually located in /var/mirrors/minicpan:


total 32
drwxr-xr-x 3 somian somian  4096 Jun 23 14:51 authors
drwxr-xr-x 2 somian somian  4096 Jun 23 14:51 modules
-rw-r--r-- 1 somian somian 23768 Jun 23 14:51 RECENT

and I've made a symlink to /var/mirrors/minicpan from /var/www/public/minicpan. Does this seem like a sane setup? I'd be really jazzed if I could get it to work. Thanks in advance for giving me a look.

  Soren

Jun 26, 2025 at 19:35 UTC

A just machine to make big decisions
Programmed by fellows (and gals) with compassion and vision
We'll be clean when their work is done
We'll be eternally free yes, and eternally young
Donald Fagen —> I.G.Y.
(Slightly modified for inclusiveness)

Replies are listed 'Best First'.
Re: Minicpan mirror on lan, not working with cpanplus client
by hippo (Archbishop) on Jun 27, 2025 at 08:21 UTC

    What is the DocumentRoot in your Apache config (for this VirtualHost, if you are running several)? Also, if you bump the LogLevel up, the reason for the 404 will appear in the error log so you could then stop guessing and actually know what the cause is.

    I've made a symlink to /var/mirrors/minicpan from /var/www/public/minicpan. Does this seem like a sane setup?

    It's not utterly insane. But Aliases are generally preferred to symlinks if the link is just there to allow the webserver to serve content.


    🦛

Re: Minicpan mirror on lan, not working with cpanplus client
by ysth (Canon) on Jun 27, 2025 at 15:58 UTC
    Do any of the path variations actually work? Seems a lot easier just to try them outside of your cpan client, e.g.

    curl -I 'http://192.168.1.7/minicpan/authors/id /O/OA/OALDERS/Archive-Any-0.0946.tar.gz'

      ysth asked:

      Do any of the path variations actually work? Seems a lot easier just to try them outside of your cpan client

      I tried out your suggestion with `curl' and apache was unable to find the module via any of the variations, but `find' with the -L switch (to follow symlinks) shows me hundreds of modules present under /var/www/public/minicpan/authors/id/.

      That was a good idea. I'm not sure what I'm going to do now, but I will get this working one way or another. Am checking out the documentation for Apache2 aliases as per hippo's suggestion.

        Soren

        To make Apache follow your symlinks, RTFM: <Directory>, Options:

        <Directory "/some/where/on/your/disk"> Options FollowSymLinks </Directory>

        It should be on by default, but may have been disabled somewhere in the Apache config.

        Alexander

        --
        Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re: Minicpan mirror on lan, not working with cpanplus client
by eyepopslikeamosquito (Archbishop) on Jun 27, 2025 at 10:28 UTC

    I'd be really jazzed if I could get it to work. Thanks in advance for giving me a look.

    G'day Intrepid,

    Not answering your excellent question, but as a keen student of Saints in our Book, I could not help but notice that you are now on 2999 XP.

    I'd be really jazzed to finally see you reach the coveted 3000 milestone and so deservedly appear at Saints in our Book.

    Congratulations on your perseverance and well-deserved upcoming Sainthood!

    Congrats to Boldra too, who I see has similarly recently attained Sainthood here after 25 long years roaming around the Monastery.

    See Also

    Updates

    Jun 30, 2025: After 25 years, Intrepid and Boldra are now tied in last place at Saints in our Book on 3008 XP apiece :-)

    Jul 8, 2025: Intrepid is now well clear of Boldra and has drawn level with legendary PM pioneer BBQ on 3031 XP

    Aug 1, 2025: Intrepid has passed the redoubtable jo37 and drawn level with Perl celebrity BooK on 3090 XP

    Aug 18, 2025: jo37 caught up to Intrepid at 3118 XP, and has now moved ahead of him once again

    Aug 27, 2025: Intrepid caught up to jo37 ... tied again at 3140 XP ... and again at 3144 XP on Aug 31 ... and again at 3151 XP on Sep 3 (inseparable :)

    Sep 12, 2025: Intrepid takes the lead, 3179 XP to 3157 XP with 7 monks in between (Sandy, bbfu, Hero Zzyzzx, jsprat, betterworld, SparkeyG, snoopy)

    Sep 22, 2025: Intrepid leading 3200 XP to 3169 XP with 11 monks in between

    Oct 1, 2025: Intrepid leading 3242 XP to 3180 XP with 24 monks in between

    Perl MonkEmojiNotes
    Intrepid🧗Intrepid (fearless and adventurous) mountain climbing
    Intrepid🚢🛫Intrepid aircraft carrier (USS Intrepid)
    jo37🐻Resembles the bear on jo37's home page (see also)

    👁️🍾👍🦟

      I appreciate your encouragement and well-wishing, eyepopslikeamosquito, thank you. It will be a true milestone when I reach 3000, for sure.

      Jun 30, 2025 at 19:47 UTC
Re: Minicpan mirror on lan, not working with cpanplus client
by Intrepid (Curate) on Jul 01, 2025 at 17:07 UTC

    Ok! I have it working!!! The key suggestion came from hippo. This might help someone else, so even though its not strictly Perl, I'll detail the steps I took to get my minicpan online.

    I first edited the Apache config-file: `sudo vim /etc/apache2/apache2.conf' to introduce a new Alias:

    
    # Alias definition
    Alias /minicpan "/var/mirrors/minicpan"
    

    Then a new Directory entry goes next into apache2.conf:

    
    # Directory permissions
    <Directory "/var/mirrors/minicpan">
            Options Indexes FollowSymLinks
            AllowOverride None
            Require all granted
    </Directory>
    

    Warning: I don't actually understand all the lines in the Directory permissions block. I'm guilty of cargo-cult coding here; I just copied what Google AI answered with. Sorry ;-)

    Finally, one needs to remember to restart apache so that it will read the edited apache2.conf; my server is running on Debian and a good way for Debian users to get a restart is `sudo systemctl restart apache2'

    So once again PerlMonks came through for me, and I really appreciate it.

      Soren

    Jul 01, 2025 at 17:05 UTC
      Warning: I don't actually understand all the lines in the Directory permissions block. I'm guilty of cargo-cult coding here; I just copied what Google AI answered with. Sorry ;-)

      Don't blindly follow suggestions from an LLM AI. That's even worse than blindly following code in some random blog you've never read before. In this case the Options line is probably unnecessary and really should not have FollowSymLinks. AllowOverride None is good, but should really be at the top level, not just in this dir. Require all granted allows public access to all methods - fine for a fully internal server but bear it in mind if you are opening it up to clients on the wider web.

      a good way for Debian users to get a restart is `sudo systemctl restart apache2'

      You don't need a restart just to pick up a change in config like this. If you are stuck with using systemd then sudo systemctl reload apache2 will do. If you are free from systemd (or just don't want to give it the satisfaction of using its own commands) then a simple sudo apachectl graceful is the way.

      Glad you have it working now. Enjoy your minicpan!


      🦛

        Thank you for the good information hippo. I am glad I have it working. It's really quite cool having many perl packages available through connection on my local LAN.

        Jul 05, 2025 at 15:41 UTC