| |
Network: Newsserver: How do I set up my own simple newsserver(last edit: 2001-03-06)
I can't remember if I finished this document. So if parts are missing mail the detail to me
at the adress at the bottom.
------------------------------------------------------------------------------------------
Here is how to set up a news server that retreives a few newsgroups so that you can connect to your newsserver
and read them. My intentio is to do this for binary groups so that I won't mis any postings because I'm not home
and when I get back they've expired.
For reference you should visit:
freebsddiary.org
And also, ragnet.demon.co.uk
Step1
Install inn-stable and suck
You can find them in your ports dir, under /usr/ports/news
Step2:
Execute the following commands:
cd /usr/local/news/db
echo 'control 0000000000 0000000001 n' > active
echo 'junk 0000000000 0000000001 n' >> active
chown news:news active
chmod 0664 active
touch history
chown news:news history
chmod 0664 history
/usr/local/news/bin/makehistory -r -i
mv history.n.dir history.dir
mv history.n.pag history.pag
chown news:news history.dir
chmod 0664 history.dir
chown news:news history.pag
chmod 0664 history.pag
note:
messages will be kept in /var/spool/news This partition is usually quite small.
You could place a news dir elsewhere and make a link to in in /var/spool
Step3:
To allow access for certain computer to you newsserver you should edit
/usr/local/news/etc/nnrp.access
in there you should add things like this:
*.t-l.org:Read Post:::*
Step4:
Now edit /etc/syslog.conf and uncomment the three lines for inn
For setting up i could be usefull to add:
news.* /var/log/news/news.all
Thsi should later be removed.
Go to your /var/log and make sure you have a news dir there. If not create it.
in /var/log/news you must make your log files with the touch command like so:
# touch /var/log/news/news.all
# touch /var/log/news/news.crit
# touch /var/log/news/news.err
# touch /var/log/news/news.notice
# touch /var/log/news/suck.err
# touch /var/log/news/suck.notice
# chown news:news /var/log/news/news.*
# chown news:news /var/log/news/suck.*
# chmod 0664 /var/log/news/news.*
# chmod 0664 /var/log/news/suck.*
Now you need to resstart you system logger with:
# kill -HUP `cat /var/run/syslog.pid'
You can find the pid with:
ps -aux|grep syslog
The pid is the first number on the line of output.
Now you can connect to your newsserver and read/post messages. Of course we want to get some groups on there, so that there
actually is something to read. This is where suck comes into play.
Step5:
Now you should run the inn sanity checker. It can be found in /usr/local/news/bin/inncheck
Of course fix any errors it gives you.
Step6:
You should start looking at you log file like so:
tail -f /var/log/news/news.all
Now we'll start innd like so:
su news -c /usr/local/news/bin/rc.news
Note:
According to what I read innwatch should now also be running but it wasn't so I started it manually with:
su news -c /usr/local/news/bin/innwatch
Then you should see somthing like this appear in your log:
-----------------------------------------------------------------------
bsd [/var/log/news> tail -f news.all
Nov 20 12:49:41 bsd ctlinnd[35537]: Reading config from /usr/local/news/etc/inn.conf
Nov 20 12:49:46 bsd inndstart: Reading config from /usr/local/news/etc/inn.conf
Nov 20 12:49:46 bsd innd: SERVER descriptors 1064
Nov 20 12:49:46 bsd innd: SERVER outgoing 1051
Nov 20 12:49:46 bsd innd: SERVER ccsetup control:11
Nov 20 12:49:46 bsd innd: SERVER lcsetup localconn:13
Nov 20 12:49:46 bsd innd: SERVER rcsetup remconn:4
Nov 20 12:49:46 bsd innd: SERVER bad_newsfeeds no feeding sites
Nov 20 12:49:46 bsd innd: SERVER perl filtering enabled
Nov 20 12:49:46 bsd innd: SERVER starting
Nov 20 12:50:47 bsd ctlinnd[35604]: Reading config from /usr/local/news/etc/inn.conf
Nov 20 12:50:47 bsd innd: s
-----------------------------------------------------------------------
Step7:
Now you should test reading and posting messages, you should try something like:
-----------------------------------------------------------------------
# telnet localhost nntp
Trying 127.0.0.1...
Connected to localhost.my.domain.
Escape character is '^]'.
200 ragnet.demon.co.uk InterNetNews server INN 1.7.2 08-Dec-1997 ready
mode reader
200 ragnet.demon.co.uk InterNetNews NNRP server INN 1.7.2 08-Dec-1997
ready (posting ok).
list active
215 Newsgroups in form "group high low flags".
control 0000000000 0000000001 n
junk 0000000000 0000000001 n
.
quit
205 .
Connection closed by foreign host.
-----------------------------------------------------------------------
And something like:
-----------------------------------------------------------------------
# telnet localhost nntp
Trying 127.0.0.1...
Connected to localhost.my.domain.
Escape character is '^]'.
200 ragnet.demon.co.uk InterNetNews server INN 1.7.2 08-Dec-1997 ready
ihave <1@test>
335
.
437 Empty article
quit
205 .
Connection closed by foreign host.
-----------------------------------------------------------------------
Step8:
If this all work we will try adding a newsgroup to your server.
The command should be somthing like:
/usr/local/news/bin/ctlinnd newgroup bsd.t-l.test
What I got in my logfile was this:
-----------------------------------------------------------------------
Nov 20 13:25:20 bsd ctlinnd[38764]: Reading config from /usr/local/news/etc/inn.conf
Nov 20 13:25:20 bsd innd: k:bsd.t-l.test:y:
-----------------------------------------------------------------------
Now you should be able to see this newsgroup with a newsreader, when you connect to your own server. (of course
you need the ip adress in the nnrp.access file, see step3)
Mail questions to the below adress.
Sjoerd
Send your questions to: I.dont.get.it@t-l.org
Click here to go back to the index.
|