Benutzer-Werkzeuge

Webseiten-Werkzeuge


linux:grundkonfiguration

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Nächste Überarbeitung
Vorhergehende Überarbeitung
linux:grundkonfiguration [2007-07-29 10:34]
stefan angelegt
linux:grundkonfiguration [2014-04-05 11:42] (aktuell)
Zeile 1: Zeile 1:
-====== ​Postfix mit MySQL-Unterstützung ​====== +====== ​Grundkonfiguration des Systems ​====== 
-  * Pakete ​installieren (MySQL und Postfix) +===== Verschiedenes ​===== 
-    * <code bash>​apt-get ​install mysql-client-5.0 mysql-server-5.0 +  * Alle Pakete ​updaten 
-apt-get ​install postfix postfix-mysql postfix-tls sasl2-bin libsasl2 libsasl2-modules courier-maildrop courier-authdaemon courier-authlib-mysql</​code>​ +    * <code bash>​apt-get ​update 
-  * Benutzer und Gruppe ​''​vmail''​ anlegen ​(UID/GID 1500) +apt-get --o APT::Force-LoopBreak=true upgrade</​code>​ 
-    * Home-Verzeichnis erstellen: ​<code bash>mkdir /​home/​vmail +  * ''​~/bin''​ anlegen ​für eigene Scripts 
-chown vmail.vmail /​home/​vmail +  * Nützliche Pakete ​ 
-chmod 0700 /home/vmail</​code>​ +    * <code bash>apt-get install bzip2 unzip less patch traceroute ssh vim locate dnsutils host telnet lynx wget make</​code>​ 
-  * repair_postfix +  * Zeiten für automatische Scripts in ''​/etc/crontab''​ anpassen
-  * chmod u+s maildrop +
-  * maildrop script anlegen maildroprc +
-  * /etc/courier ​  +
-  * chown vmail maildrop.log ​  +
-  * apt-get install courier-pop courier-pop-ssl courier-imap courier-imap-ssl +
-  * repair_smtp beim systemstart  ​+
  
-===== Konfigurationsdateien ​===== +===== Tipps ===== 
-  * main.cf durchgehen+  * If you just typed in a really long, complicated command and managed to mess it up, you can use fc (fix command) to load said command in your default editor. 
 +  * Ctrl + A – jump to the beginning of the line  
 +  * Ctrl + E – jump to the end of the line  
 +  * Ctrl + U – clear the line  
 +  * Ctrl + L – clear the screen  
 +  * Ctrl + W – delete last word  
 +  * Ctrl + K – delete to the end of the line  
 +  * Alt + T – swap current word with previous (also Esc, T)  
 +  * Alt + F – jump one word forward (also Esc, F)  
 +  * Alt + B – jump one word backward (also Esc, B)  
 +  * Alt + U – uppercase till the end of line (also Esc, U)  
 +  * Alt + u – lowercase till the end of line (also Esc, u)  
 +  * Alt +. – insert last argument (also Esc, .)  
 +  * Ctrl + R – reverse incremental history search  
 +  * Ctrl + X, Ctrl + E – open default text editor to edit a command ​
  
 +===== ~/.bashrc =====
 +<code bash>​export PS1='​\u:​\w\$ ' ​                # Prompt anpassen
 +export PATH=${PATH}:​~/​bin ​            # eigene Scripts in den PATH
  
-===== Datenbanktabellen ===== +umask 022
-<code sql>​CREATE TABLE `domains` ( +
-  `domain` varchar(50) NOT NULL, +
-  PRIMARY KEY  (`domain`) +
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;​+
  
-DROP TABLE IF EXISTS `forwardings`;​ +export LS_OPTIONS='​--color=auto' ​     # '​ls'​ Ausgabe farbig machen 
-CREATE TABLE `forwardings( +eval "`dircolors`" 
-  ​`source` varchar(80) NOT NULL, +alias ls='ls $LS_OPTIONS'​ 
-  ​`destination` text NOT NULL, +alias ll='ls $LS_OPTIONS -l' 
-  ​PRIMARY KEY  (`source`) +alias l='ls $LS_OPTIONS -lA'
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;+
  
-CREATE TABLE `users` ( +alias vi='​vim' ​                       # immer vim nutzen 
-  ​`email` varchar(80) NOT NULL, +alias cdsrc='cd /​usr/​local/​src'​
-  `password` varchar(20) NOT NULL, +
-  PRIMARY KEY  (`email`) +
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;+
  
-GRANT all privileges on mail.* TO mail@localhost IDENTIFIED BY 'password'; +bash -c "echo -ne '​\033]0;​`hostname`\007'"​ # send hostname to PuTTY 
-GRANT all privileges ​on mail.* TO mail@127.0.0.1 IDENTIFIED BY 'password';</​code>​+ 
 +# save all the histories  
 +export HISTFILESIZE = 1000000  
 +export HISTSIZE = 1000000 
 + 
 +# don't put duplicate lines or empty spaces in the history  
 +export HISTCONTROL=ignoreboth  
 +# combine multiline commands in history  
 +shopt -s cmdhist 
 +# merge session histories  
 +shopt -s histappend 
 + 
 +# enable colors  
 +eval "​`dircolors -b`"  
 +# force ls to always use color and type indicators  
 +alias ls ='ls -hF --color=auto'​  
 +# make the dir command work kinda like in windows (long format)  
 +alias dir ='ls --color=auto --format =long'  
 +# make grep highlight results using color  
 +export GREP_OPTIONS ='​--color=auto'​  
 +# colorful man pages  
 +export LESS_TERMCAP_mb=$'​\E[01;31m' ​ 
 +export LESS_TERMCAP_md=$'​\E[01;​31m'​  
 +export LESS_TERMCAP_me=$'​\E[0m'​  
 +export LESS_TERMCAP_se=$'​\E[0m'​  
 +# end the info box  
 +export LESS_TERMCAP_so=$'​\E[01;​42;​30m'​  
 +# begin the info box  
 +export LESS_TERMCAP_ue=$'​\E[0m'​  
 +export LESS_TERMCAP_us =$'​\E[01;​32m'​ 
 + 
 +# use colordiff instead of diff if available  
 +command -v colordiff >/​dev/​null 2 >&1 && alias diff="​colordiff -u"  
 +# use htop instead of top if installed  
 +command -v htop >/​dev/​null 2 >&1 && alias top=htop 
 +</​code>​ 
 + 
 +===== Vim ===== 
 +==== ~/.vimrc ==== 
 +<​code>​set wrap 
 +set tabstop=4 
 +set shiftwidth=4 
 +set expandtab 
 +set autoindent 
 +set wildchar=<​Tab>​ 
 +set nonumber 
 +set foldmethod=marker 
 +set hidden 
 +set wmh=0 
 +filetype ​on</​code>​ 
 + 
 +==== /​etc/​vim/​vimrc ==== 
 +<​code>"​ This line should not be removed as it ensures that various options are 
 +" properly set to work with the Vim-related packages available in Debian. 
 +runtime! debian.vim 
 + 
 +syntax on 
 + 
 +set autoindent ​        "​ always set autoindenting on 
 +set textwidth=       "​ Don't wrap words by default 
 +set nobackup ​          "​ Don't keep a backup file 
 +set viminfo='​20,​\"​50 ​  "​ read/write a .viminfo file, don't store more than 50 lines of registers 
 +set history=50 ​        "​ keep 50 lines of command line history 
 +set ruler              " show the cursor position all the time 
 +set nopaste 
 +set pastetoggle=<​F2>​ 
 + 
 +" Suffixes that get lower priority when doing tab completion for filenames. 
 +" These are files we are not likely to want to edit or read. 
 +set suffixes=.bak,​~,​.swp,​.o,​.info,​.aux,​.log,​.dvi,​.bbl,​.blg,​.brf,​.cb,​.ind,​.idx,​.ilg,​.inx,​.out,​.toc 
 + 
 +" If using a dark background within the editing area and syntax highlighting 
 +" turn on this option as well 
 +set background=dark 
 + 
 +" Uncomment the following to have Vim jump to the last position when 
 +" reopening a file 
 +if has("​autocmd"​) 
 +  au BufReadPost * if line("'\""​) > 0 && line("'\""​) <= line("​$"​) 
 +    \| exe "​normal g'​\""​ | endif 
 +endif 
 + 
 +" Uncomment the following to have Vim load indentation rules according to the 
 +" detected filetype. Per default Debian Vim only load filetype specific 
 +" plugins. 
 +if has("​autocmd"​) 
 +  filetype plugin on 
 +  filetype indent on 
 +endif 
 + 
 +" The following are commented out as they cause vim to behave a lot 
 +" differently from regular Vi. They are highly recommended though. 
 +set showcmd ​        "​ Show (partial) command in status line. 
 +set showmatch ​      "​ Show matching brackets. 
 +set ignorecase ​     " Do case insensitive matching 
 +"set smartcase ​     " Do smart case matching 
 +set incsearch ​      "​ Incremental search 
 +set autowrite ​      "​ Automatically save before commands like :next and :make 
 +"set hidden ​        "​ Hide buffers when they are abandoned 
 +"set mouse=a ​       " Enable mouse usage (all modes) in terminals 
 +set hlsearch 
 + 
 +" Konfiguration für Syntax Highlighting => HTML 
 +let use_xhtml = 1 
 +let html_number_lines = 1 
 +let html_use_css = 1</​code>​ 
 + 
 +===== logrotate ===== 
 +Meine Logfiles werden mit //​logrotate//​ wöchentlich gesichert und zwar in das Verzeichnis eines hierfür angelegten FTP-Benutzers. So kann ich die Logs regelmäßig auf meinem Heim-PC sichern.  
 +Eine Konfigurationsdatei für logrotate für die Systemmeldungen sieht z.B. so aus: 
 +<code ini> 
 +/​var/​log/​syslog 
 +/​var/​log/​messages { 
 +        olddir /​home/​ftp/​backup/​logs/​syslog 
 +        weekly 
 +        missingok 
 +        rotate 52 
 +        compress 
 +        delaycompress 
 +        notifempty 
 +        create 700 ftpuser ftpusers 
 +        sharedscripts 
 +
 +</​code>​
linux/grundkonfiguration.1185698072.txt.gz · Zuletzt geändert: 2014-04-05 11:42 (Externe Bearbeitung)