Linux/Tipps/Fedora

Aus VivaLV
< Linux‎ | Tipps
Version vom 31. Dezember 2006, 00:34 Uhr von Thomas (Diskussion | Beiträge)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen

Kernel-Source installieren (FC1)

  • Kernel-Source-RPM installieren
  • in /usr/src/linux-2.4/Makefile "custom" am Ende von EXTRAVERSION entfernen
cp /boot/config-[KERNELNAME] /usr/src/linux-2.4/.config
  • in /boot/grub/menu.lst default auf 0 setzen

Kernel-Source compilieren (FC1)

Dies sollte man als normaler Benutzer machen können. Falls nicht:

su -
chown -R Benutzer.Gruppe /usr/src/linux-2.4

Compilieren:

cd /usr/src/linux-2.4
make mrproper
make oldconfig
make dep

Kernel-Source installieren und compilieren (FC2/FC3)

su -
cd /usr/src/redhat
chmod 777 BUILD
chmod 777 RPMS/i386
chmod 777 RPMS/i586
chmod 777 SOURCES
chmod 777 SPECS
chmod 777 SRPMS
chmod 777 /usr/src

Als normaler Benutzer:

  • Kernel-Source-RPM downloaden
rpm -ivh Kernel-Source-RPM
rpmbuild -bp --target=noarch  /usr/src/redhat/SPECS/kernel-2.6.spec
cd /usr/src
ln -s redhat/BUILD/kernel-2.6.10/linux-2.6.10 linux
ln -s redhat/BUILD/kernel-2.6.10/linux-2.6.10 linux-2.6.10
cd linux
mv .config .config.orig
cp /boot/config-[KERNELNAME] .config
make mrproper
make oldconfig
make

Power-Button soll den Rechner ordentlich runterfahren, anstatt hart auszuschalten

Dafür ist es zunächst einmal notwendig, dass "/proc/acpi" existiert. Falls nicht, hat Fedora nicht erkannt, dass der Rechner ACPI-fähig ist. In diesem Fall hilft evtl. ein acpi=on als Bootparameter in "/boot/grub/grub.conf". Ist das der Fall, müsste auch der acpid laufen (zu prüfen mit "ps -afe | grep acpid"). Falls nicht, kann man dies erreichen mit "chkconfig acpid on" und "service acpid start".

In "/etc/acpi/events/power.conf" muss dann folgendes stehen:

event=button/power.*
action=/sbin/shutdown -h now

Mailserver einrichten (FC5)

Angaben in <> müssen entsprechend ersetzt werden.

Mail für root umleiten
su -
  • /etc/aliases:
root:    <local user>
newaliases
exit
fetchmail
touch $MAIL
su -
chmod 777 /var/spool/mail
yum install fetchmail
  • /etc/fetchmailrc:
set postmaster "<local user>"
set no bouncemail
set no spambounce
set properties ""
set daemon 300
poll <POP3 server> with proto POP3
      user '<POP3 user>' there with password '<POP3 password>' is '<local user>' here
chmod 600 /etc/fetchmailrc
  • /etc/rc.local:
fetchmail -f /etc/fetchmailrc --syslog
fetchmail -f /etc/fetchmailrc --syslog
exit
uwimap mit SSL
su -
yum install openssl xinetd uw-imap
  • /etc/c-client.cf:
set mail-subdirectory mail
cd /etc/pki/tls/certs
openssl req -new -x509 -nodes -out imapd.pem -keyout imapd.pem -days 3650
  • Common Name = IP oder DNS-Name
  • /etc/xinetd.d/imap:
disable = no
  • /etc/xinetd.d/imaps:
disable = no
service xinetd restart
exit
Postfix statt Sendmail
su -
yum intall postfix
alternatives --config mta
  • Postfix auswählen und beenden
chkconfig sendmail off
chkconfig postfix on
service sendmail stop
service postfix start
exit
Postfix mit TLS
su -
yum install postfix
  • Server-Zertifikate erstellen (siehe entsprechender Punkt auf dieser Seite)
cd /etc/pki/tls/misc
cp newcert.pem /etc/postfix/
cp newkey.pem /etc/postfix/
  • Ändern /etc/postfix/main.cf:
myhostname = <hostname>.localhost.localdomain
mydomain = localhost.localdomain
myorigin = <maildomain.de>
inet_interfaces = all
  • Hinzufügen zu /etc/postfix/main.cf:
relayhost = <relay host>
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
smtp_sasl_auth_enable = no
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
smtpd_use_tls = yes
smtpd_sasl_local_domain =
#smtpd_tls_auth_only = yes
smtpd_tls_key_file = /etc/postfix/newkey.pem
smtpd_tls_cert_file = /etc/postfix/newcert.pem
smtpd_tls_CAfile = /etc/pki/tls/cert.pem
smtpd_tls_loglevel = 1
#smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
smtp_use_tls = no
  • /usr/lib/sasl2/smtpd.conf:
mech_list: PLAIN LOGIN
chkconfig saslauthd on
service saslauthd start
postfix reload
exit
Postfix SMTP-Authentication zum Provider
su -
  • /etc/postfix/sasl_passwd:
<relay host> <SMTP user>:<SMTP password>
chmod 600 /etc/postfix/sasl_passwd
postmap hash:/etc/postfix/sasl_passwd
  • /etc/postfix/main.cf:
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
postfix reload
exit
Procmail/Spamassassin
mkdir ~/procmail
  • ~/procmail/rc.spam:
:0 E fw: spamassassin.lock
| /usr/bin/spamassassin

:0:
* ^X-Spam-Flag: YES
mail/Spam

:0:
$DEFAULT
su -
apt-get install procmail spamassassin
mkdir /etc/procmailrcs
  • /etc/procmailrcs/<user>:
SHELL=/bin/sh
PMDIR=$HOME/procmail
LOGFILE=$PMDIR/pmlog
LOG="
"
#VERBOSE=YES
MAILDIR=$MAIL
INCLUDERC=$PMDIR/rc.spam
chown <user>.<group> /etc/procmailrcs/<user>
chmod 600 /etc/procmailrcs/<user>
  • /etc/postfix/main.cf:
mailbox_command = /bin/nice /usr/bin/procmail -t -m /etc/procmailrcs/$USER $SENDER $RECIPIENT
postfix reload
exit
Squirrelmail
su -
yum install squirrelmail
ln -s /usr/share/squirrelmail /var/www/html/squirrelmail
exit
POP before SMTP (SMTP after POP)
su -
apt-get install perl-File-Tail perl-Net-Netmask perl-TimeDate
  • pop-before-smtp-conf.pl: Zeilen mit $grace und $file_tail einkommentieren und anpassen
cp pop-before-smtp-conf.pl /etc/
cp pop-before-smtp.init /etc/init.d/pop-before-smtp
cp pop-before-smtp /usr/sbin/

Test (abbrechen mit CTRL-C):

pop-before-smtp --debug --reprocess

Wenn Fehlermeldungen mit "Net::Netmask::imaxblock" kommen, ist evtl. der mynetworks Parameter in Postfix nicht ganz OK oder nicht gesetzt. Dies kann mit "postconf mynetworks" geprüft werden. Sowas z.B. kann pop-before-smtp nicht verarbeiten:

mynetworks = 127.0.0.0/8 192.168.0.0/24 [::1]/128

In diesem Fall wird in "/etc/postfix/main.cf" eingetragen:

mynetworks = 127.0.0.0/8 192.168.0.0/24

Anschließend "postfix reload".


/etc/init.d/pop-before-smtp start
chkconfig pop-before-smtp on
ls -la /etc/postfix/pop-before-smtp* (pop-before-smtp.db muss es geben)
  • vi /etc/postfix/main.cf:
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,check_client_access  hash:/etc/postfix/pop-before-smtp,reject_unauth_destination
postfix reload
exit
Sendmail statt Postfix (alt)
su -
cd /etc/mail
cp sendmail.mc sendmail.mc.orig
cp sendmail.cf sendmail.cf.orig
  • sendmail.mc:
17c17,18
< define(`SMART_HOST',`smtp.your.provider')
---
> dnl define(`SMART_HOST',`smtp.your.provider')
> define(`SMART_HOST',`<SMTP server>')
30c31,34
< define(`confAUTH_OPTIONS', `A')dnl
---
> dnl define(`confAUTH_OPTIONS', `A')dnl
> define(`confAUTH_OPTIONS', `Ay')dnl
> TRUST_AUTH_MECH(`LOGIN PLAIN')dnl
> define(`confAUTH_MECHANISMS', `LOGIN PLAIN')dnl
84c88,89
< DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
---
> dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
> DAEMON_OPTIONS(`Port=smtp,Name=MTA')dnl
140a146,147
> FEATURE(`authinfo',`hash /etc/mail/authinfo') dnl
> define(`confLOG_LEVEL',`13')
make
  • authinfo:
AuthInfo:<SMTP server> "U:<SMTP user>" "P:<SMTP password>"
makemap hash authinfo.db < authinfo
service sendmail restart
exit