Home

Search this site:
 

Horshack’s
very
own site

 

This is Bavaria, Germany!
You will find links to Perl,
bootdisks for system administration,
a lot of Linux,
Windows administration
and some personal belongings.
Linux: daemons

Linux: daemons

Table of contents:

Starting daemons automatically on startup of server

How to make SMTP after POP run without modifying daemons

What you need:

  1. Copy the perlprogram to /root/bin/smtp_after_pop.pl
  2. Create these lines in /etc/rc.d/rc.local:
    # allow ip-addresses who are logged in by pop to use me as relay for smtp
    (/root/bin/smtp_after_pop.pl runforever) &
  3. Create these lines with crontab -e as root (expiration of ip-addresses after about an hour)
    # expire for smtp_after_pop
    0,30 * * * * (/root/bin/smtp_after_pop.pl expirecheck) >/dev/null 2>&1

You will see the following in your logfiles when someone was logging in by POP:

Dez 8 18:04:20 allow popuser 212.34.181.67 to sendmail until 2001.12.08 19:04:20
Dez 8 18:04:20 smtp_after_pop.pl says: popuser buch logged in from ip-address 212.34.181.67
Dez 8 18:04:20 smtp_after_pop.pl says: No expired ip-addresses were deleted
Dez 8 18:04:20 smtp_after_pop.pl says: 2 ip-addresses from outside now allowed to send relayed mail
Dez 8 18:04:21 smtp_after_pop.pl says: allowed user are now: lili, books

 Talking to pop3d by telnet

 

telnet pop.x.com pop3  take contact with port 110
 user horshack  who am i?
 pass xxx  what is my password?
 list  show me all mails (header) waiting for me
 retr 1  get whole mail number 1
 dele 14  delete mail 14
quit leave

 

Talking to SMTPD by telnet

Sending a mail to an smtp-server is not difficult:

[horshack@gatekeeper horshack]$ telnet brainstorm.zirndorf.de smtp
Trying 62.112.132.3...
Connected to brainstorm.zirndorf.de.
Escape character is '^]'.
220 brainstorm.zirndorf.de ESMTP Sendmail 8.12.1/8.12.1; Sat, 8 Dec 2001 18:12:14 +0100
HELO lisa.d.franken.de
250 brainstorm.zirndorf.de Hello pD951D32D.dip.t-dialin.net [217.81.211.45], pleased to meet you
MAIL FROM: horshack@lisa.franken.de
250 2.1.0 horshack@lisa.franken.de... Sender ok
RCPT TO:<horshack@gmx.de>
250 2.1.5 <horshack@gmx.de>... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
Date: 8 Aug 1998 04:10:45 -0000
From: horshack@gmx.de
Subject: Thank you!

Thanks for helping me in this mail-issues.
Richard
.

250 2.0.0 fB8HCEVR010014 Message accepted for delivery
QUIT
221 2.0.0 brainstorm.zirndorf.de closing connection
Connection closed by foreign host.

 

 Samba

Mounting a WindowNT-share with Linux by using a username and password:

# smbmount //yourserver.com/your_share /mnt/yourserver -U username%your_password

 

Apache

Apache, howto configure virtual hosts

Take these lines into your httpd.conf to configure every virtual host in an extra file (this is easier to create config-files by scripts automatically):
...
# This is the default Host:
Include /etc/httpd/conf/lisad.conf
NameVirtualHost *
Include /etc/httpd/conf/iska.conf
Include /etc/httpd/conf/gatekeeper.conf
Create a file like this for a virtual host which listens to all local interfaces. Think that the "ServerName" has to be resolved by the machines which want to access this server.
#
# Virtual Host: iska.rosi13.de
#               (.rosi13.de is an internal-used domain)
#

        ServerName iska.rosi13.de
        ServerAdmin horshack@lisa.franken.de
        # logs:
        # a special errorlog for this server
        #ErrorLog /www/iska.rosi13.de/logs/error.log
        # a special accesslog for this server
        #CustomLog /www/iska.rosi13.de/logs/access.log common
        # directories:
        # wwwroot
        DocumentRoot /var/www/iska.rosi13.de/wwwroot
        
                # rights:
                # rights for this server:
                Order allow,deny
                Allow from all
                DirectoryIndex index.html index.php 
        
        # cgi-bin
        ScriptAlias /cgi-bin/ "/var/www/iska.rosi13.de/cgi-bin/"
        
                # rights:
                # rights for this server:
                Order allow,deny
                Allow from all
                AllowOverride None
                Options ExecCGI
        

Impressum