![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
Ubuntu 9.10 is out!!!
When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu. The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely. |
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Still having fun...
![]() Join Date: Dec 2006
Beans: 3,007
Ubuntu 9.10 Karmic Koala
|
[Howto] Setup and use Leafnode-2 with the newsreader slrn
======================
Introduction ====================== This 'Howto' aims to show how to use the amazing NNTP proxy server Leafnode-2 with your copy of John E Davis' slrn. If you do not have slrn running already I suggest you spend some time with my other Ubuntu Forums 'HowTo': HOWTO: Setup slrn, the CLI newsreader. Leafnode-2 can be used by any newsreader that can utilise a local news spool so this guide can also be used in conjunction with other news clients. I concentrate mostly on slrn as this is the newsreader I am most familiar with First some preparation work: ==================== Set a FQDN ==================== For the best setup you should have an unique Fully Qualified Domain Name (FQDN) set to your system. Check this with the following command: Code:
$ hostname --fqdn Code:
127.0.0.1 localhost 127.0.1.1 desktop Code:
127.0.0.1 localhost 127.0.1.1 desktop.your.domain desktop
I suggest you burrow into the Leafnode-2 source code that we will download shortly and read the excellent document: README-FQDN.html. This speaks of the FQDN in much greater detail. A word of warning: an incorrect or false FQDN might expose you to merciless flaming so spend a little time getting this set correctly But now to start installing the program: ====================== Install some Files ====================== First some development files are required from the Ubuntu repositories. Leafnode-2 depends on the PCRE regular-expression matching library, as well some compiling tools are needed plus checkinstall and an inetd package: Code:
$ sudo apt-get install libpcre3 libpcre3-dev openbsd-inetd build-essential checkinstall Code:
$ cd $HOME/Desktop $ wget http://home.pages.de/~mandree/leafnode/beta/leafnode-2.0.0.alpha20081229a.tar.bz2 $ tar xjvf leafnode-2.0.0.alpha20081229a.tar.bz2 $ cd leafnode-2.0.0.alpha20081229a Code:
$ ./configure --prefix=/usr \ --sysconfdir=/etc/leafnode \ --mandir=/usr/man \ --localstatedir=/var \ --enable-runas-user=news \ --enable-spooldir=/var/spool/news $ make $ sudo checkinstall -D --install=yes --fstrans=no ====================== Some Leafnode Settings ====================== There is a sample config file that Leafnode-2 installs as /etc/leafnode/config.example and unless you already have a configuration file you will need to do the following: Code:
$ sudo touch /etc/leafnode/local.groups $ sudo cp /etc/leafnode/config.example /etc/leafnode/config $ sudo vim /etc/leafnode/config Code:
server = your.news.server username = your.username password = your.password Code:
initialfetch = 500 Code:
$ sudo fetchnews -vvv -N alt.os.linux.ubuntu -x 2000 ====================== Setting the server ====================== The following steps set the NNTP proxy server. Open the file inetd.conf as follows: Code:
$ sudo vim /etc/inetd.conf Code:
nntp stream tcp nowait news /usr/sbin/tcpd /usr/sbin/leafnode Code:
#-- leafnode begin leafnode: 127.0.0.1 #-- leafnode end Code:
#-- leafnode begin leafnode: ALL #-- leafnode end Code:
$ sudo kill -HUP `cat /var/run/inetd.pid` $ telnet localhost 119 Code:
andrew@ilium:~$ telnet localhost 119 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 200 Leafnode NNTP daemon, version 2.0.0.alpha20070602a at <domain> ====================== Fetchnews & Texpire ====================== Fetchnews transports news to and from Leafnode-2 while Texpire cleans out old messages. There are many ways to set these running but I will demonstrate a method using crontab that sets Fetchnews to run every hour at 15 past the hour and runs Texpire at 2145 every night. Open or create the news crontab as follows: Code:
$ sudo crontab -u news -e Code:
# Sets texpire to clean out news at 2145hrs every day: 45 21 * * * /usr/sbin/texpire 1>/dev/null # Sets fetchnews to run at 15 past every hour: 15 * * * * /usr/sbin/fetchnews 1>/dev/null Code:
$ sudo crontab -u news -l ====================== Logging for Leafnode ====================== It is a good idea to set some logging for Leafnode and we will be doing this by tapping into Linux system logging. Before doing this there is a small amount of bug-work to do: if you have had a previous version of Leafnode installed there may be a residual configuration file that must be removed: Code:
$ sudo mv -v /etc/logrotate.d/leafnode $HOME/Desktop/leafnode_bak Code:
$ sudo mkdir -pv /var/log/news/oldnews $ sudo touch /var/log/news/news.info $ sudo touch /var/log/news/news.crit $ sudo touch /var/log/news/news.err $ sudo touch /var/log/news/news.notice Code:
$ sudo vim /etc/syslog.conf Code:
news.=crit -/var/log/news/news.crit news.=err -/var/log/news/news.err news.notice -/var/log/news/news.notice news.info -/var/log/news/news.info Code:
$ sudo vim /etc/logrotate.conf Code:
/var/log/news/* {
daily
rotate 7
olddir /var/log/news/oldnews
missingok
postrotate
kill -1 `cat /var/run/syslogd.pid`
endscript
compress
}
Code:
$ sudo kill -1 `cat /var/run/syslogd.pid` $ sudo logrotate -dv /etc/logrotate.conf ====================== Running the program ====================== First run fetchnews from the command line with the following parameters: Code:
$ sudo fetchnews -vvv Code:
$ sudo texpire -vvv ============================== Set slrn to read the spool ============================= There are really only 2 extra steps required to get slrn talking with Leafnode-2. Enter the following into ~/.bashrc: Code:
NNTPSERVER=localhost && export NNTPSERVER Code:
% Tell slrn which newsrc file it should use for which server. server "localhost" ".jnewsrc" Code:
Leafnode placeholder for group alt.os.linux.ubuntu ====================== In conclusion... ====================== A big 'Thank you' to Gary Knight whose page Using Leafnode as a caching news proxy provided a huge amount of information for this page. And a special thanks again to PJR, always my most helpful critic, and all those from news.software.readers who proffered advice. April 7th, 2009. Andrew Strong Last edited by andrew.46; September 5th, 2009 at 07:22 PM.. Reason: Update version |
|
|
|
|
|
#2 |
|
5 Cups of Ubuntu
![]() Join Date: Sep 2007
Location: Ann Arbor, MI
Beans: 19
Ubuntu 7.10 Gutsy Gibbon
|
Re: [Howto] Setup and use Leafnode-2 with the newsreader slrn
That's super useful. Thank you for the tutorial.
__________________
When I first started, it was hard finding Ubuntu applications to show the true extent of Linux and open development. An list with screenshots and videos would have made the process easier. See apps like GNOME Do and Brightside at The Daily Ubuntu. |
|
|
|
|
|
#3 |
|
Still having fun...
![]() Join Date: Dec 2006
Beans: 3,007
Ubuntu 9.10 Karmic Koala
|
Re: [Howto] Setup and use Leafnode-2 with the newsreader slrn
Hi Mary:
It is my pleasure! I hope you enjoy this amazing sodtware. A fellow australian has produced a nice macro that places an 'X-NNTP-Proxy'' (leafnode 2' header in slrn which may interest you: http://piggo.com/~troy/slrn#custom He does not give the full syntax on the page, which is: Code:
define post_hook ()
{
set_string_variable ( "custom_headers",
sprintf ("Message-ID: <%s>\nX-NNTP-Proxy: Leafnode-2 (http://www-dt.e-technik.uni-dortmund.de/~ma/leafnode/beta/)", create_msg_id ()));
}
define followup_hook()
{
set_string_variable ( "followup_custom_headers",
sprintf ("Message-ID: <%s>\nX-NNTP-Proxy: Leafnode-2 (http://www-dt.e-technik.uni-dortmund.de/~ma/leafnode/beta/)", create_msg_id ()));
}
define reply_hook()
{
set_string_variable ( "reply_custom_headers",
sprintf ("Message-ID: <%s>\nX-NNTP-Proxy: Leafnode-2 (http://www-dt.e-technik.uni-dortmund.de/~ma/leafnode/beta/)", create_msg_id ()));
}
Andrew PS My apologies for giving mangled syntax in the initial post, I have corrected it.
__________________
Do you think that's air you're breathing? Last edited by andrew.46; February 4th, 2008 at 02:19 AM.. Reason: Corrected syntax |
|
|
|
|
|
#4 |
|
Still having fun...
![]() Join Date: Dec 2006
Beans: 3,007
Ubuntu 9.10 Karmic Koala
|
Re: [Howto] Setup and use Leafnode-2 with the newsreader slrn
Hi,
I have updated the guide to the most stable, recent version of Leafnode-2 and I suspect I shall leave the guide to slumber quietly now. There has been little interest in the guide, which is a great pity as Leafnode-2 is a fantastic piece of software and once setup no trouble to administer. I will be available for questions but in the meantime slumber on my least utilised guide All the best, Andrew |
|
|
|
|
|
#6 | |
|
Still having fun...
![]() Join Date: Dec 2006
Beans: 3,007
Ubuntu 9.10 Karmic Koala
|
Re: [Howto] Setup and use Leafnode-2 with the newsreader slrn
Hi alipensen,
Quote:
Andrew
__________________
Do you think that's air you're breathing? |
|
|
|
|
|
|
#7 |
|
5 Cups of Ubuntu
![]() Join Date: Oct 2009
Beans: 43
|
Re: [Howto] Setup and use Leafnode-2 with the newsreader slrn
Thanks for a nice how-to.
|
|
|
|
|
|
#8 |
|
Still having fun...
![]() Join Date: Dec 2006
Beans: 3,007
Ubuntu 9.10 Karmic Koala
|
Re: [Howto] Setup and use Leafnode-2 with the newsreader slrn
Hi kevin,
My pleasure! Good to see that this guide is still being used, as I promised above I intend polishing it a little with the release of Karmic Koala which is only a few weeks away now... All the best, Andrew
__________________
Do you think that's air you're breathing? |
|
|
|
|
|
#9 |
|
Still having fun...
![]() Join Date: Dec 2006
Beans: 3,007
Ubuntu 9.10 Karmic Koala
|
Re: [Howto] Setup and use Leafnode-2 with the newsreader slrn
Hmmm.... unfortunately this version of leafnode-2 does not compile under Karmic Koala. I shall investigate..... Looks like the latest version fails as well, I have posted to leafnode-list.
Andrew
__________________
Do you think that's air you're breathing? Last edited by andrew.46; 3 Weeks Ago at 03:46 AM.. |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|