Jump to content

User:Tobiasco/server: Difference between revisions

From tango.info wiki
Line 38: Line 38:
  http://ntp.isc.org/bin/view/Servers/NTPPoolServers
  http://ntp.isc.org/bin/view/Servers/NTPPoolServers
  http://www.debian.org/doc/manuals/system-administrator/ch-sysadmin-time.html
  http://www.debian.org/doc/manuals/system-administrator/ch-sysadmin-time.html
    date --set 1998-11-02
    date --set 21:08:0
...For this reason, you should make sure that your libc6 package is kept reasonably up to date. This package, from Debian GNU/Linux 2.2 onwards, contains the timezone data.


  /etc/ntp.conf
  /etc/ntp.conf

Revision as of 2007-08-11T11:47:33

terminal

  • w:grep (filtering)
  • w:apache
    • start: /usr/sbin/httpd2
    • stop: kill -TERM `cat /var/run/httpd2.pid`
    • restart: /etc/init.d/apache2 restart
    • show servers, hosts: httpd2 -S
  • q (quit)
  • cd
  • mv <filename1> <filename2> (move)
  • cp (copy)
  • find -name
  • ls -la | grep <something>
  • vi
  • ps , ps -e (show processes)
  • grep video.tango.info access.log | wc
    • grep ist ein suchprogragm. fuettern mit textfile, (hier access.log) suchen nach regex (hier video.tango.info) , pipe output an naechstes programm wc

vi

  • help, i (insert mode), hjkl (curser move in non insert mode), w (write),
  • a (insert append mode)
  • $ (go to line end)
  • A (line end append)

hardware

cat /proc/cpuinfo
cat /proc/meminfo
hdparm -i
fdisk -l

ntp

http://ntp.isc.org/bin/view/Servers/NTPPoolServers
http://www.debian.org/doc/manuals/system-administrator/ch-sysadmin-time.html
    date --set 1998-11-02 
    date --set 21:08:0

...For this reason, you should make sure that your libc6 package is kept reasonably up to date. This package, from Debian GNU/Linux 2.2 onwards, contains the timezone data.

/etc/ntp.conf
    logfile /var/log/xntpd
    driftfile /var/lib/ntp/ntp.drift
    statsdir /var/log/ntpstats/
    
    statistics loopstats peerstats clockstats
    filegen loopstats file loopstats type day enable
    filegen peerstats file peerstats type day enable
    filegen clockstats file clockstats type day enable
    
    server ntp.somedomain.something
    server ntp.something.else


server 0.de.pool.ntp.org
server 1.de.pool.ntp.org
server 2.de.pool.ntp.org

apache

httpd.config

add own config in (/etc/apache2/httpd.conf.local)
putting its name into APACHE_CONF_INCLUDE_FILES in 
/etc/sysconfig/apache2

or /etc/sysconfig/apache2 e.g.

"/etc/apache2/my_conf/"
"/etc/apache2/virtual_hosts/*.conf"
"local/*.conf /srv/www/virtual/"

APACHE_CONF_INCLUDE_DIRS=""

modules

  • vhosts.d


mod_rewrite

/etc/apache2/sysconfig.d/loadmodule.conf (look whether loaded)

LoadModule rewrite_module /usr/lib/apache2-prefork/mod_rewrite.so

if line not exists in loadmodule.conf then /etc/sysconfig/apache2, search variable APACHE_MODULES and add "rewrite"

APACHE_MODULES="access actions alias auth auth_dbm autoindex cgi dir env expires include log_config mime negotiation setenvif ssl suexec userdir php4 rewrite"

  • httpd.include (may have vhost settings)


PHP

apt-get install php5.1

  • additional: libapache2-mod-php5.1 php5.1-common
  • suggest: php-pear php5.1-curl php5.1-exif php5.1-ftp php5.1-gd php5.1-gettext php5.1-mysql php5.1-sqlite
  • recommended: php5.1-session php5.1-cli php5.1-cgi
  • found myself: php5-mbstring

mysql

http://dev.mysql.com/doc/refman/4.1/en/unix-post-installation.html

mysql_install_db
mysqld_safe &
bg (restart order in background) 
/usr/bin/mysqladmin -u root passwd <password>
#:mysql -p(asuserroot)
Enterpassword:<enterwithoutpassword>
mysql> use mysql;
mysql> delete from userwhere User= ;
mysql> delete from dbwhere User= ;
mysql> update usersetPassword= Password('some_passwd')where User='root';
mysql> flushprivileges;
mysql> exit;
show databases;
use <dbname>;
source ./dump.sql
ctrl+c=termianal run stop
http://dev.mysql.com/doc/refman/5.0/en/default-privileges.html
shell> mysql -u root
mysql> SET PASSWORD FOR @'localhost' = PASSWORD('newpwd');

slow log

/var/lib/mysql/......-slow.log

Load Backups

mysql -p
mysql> source ./backup20060524.sql

utf8

set global character_set_client=utf8;
set global character_set_connection=utf8;
set global character_set_results=utf8;
set global character_set_server=utf8;
set global collation_connection=utf8_general_ci;
set global collation_server=utf8_general_ci;

ftp

ftp open example.org
get <filename>
put
mget
mput

exim

  • dpkg-reconfigure exim4-config
    • select options with key up+down
    • Internet Server - Mail gets sent and received directly over SMTP

logs

# LogFormat = 1
# LogFormat = "%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot"
%host Client hostname or IP address (or Sender host for mail log) 
%other Means another field 
%logname Authenticated login/user with format: alex 
%time1 Date and time with format: [dd/mon/yyyy:hh:mm:ss +0000] or [dd/mon/yyyy:hh:mm:ss]
%time2 Date and time with format: yyyy-mm-dd hh-mm-ss
%time3 Date and time with format: Mon dd hh:mm:ss or Mon dd hh:mm:ss yyyy
%time4 Date and time with unix timestamp format: dddddddddd 
%methodurl Method and URL with format: "GET /index.html HTTP/x.x" 
%code Return code status (with format for web log: 999) 
%bytesd Size of document in bytes
%refererquot Referer page with format: "http://from.com/from.htm"
%uaquot User agent with format: "Mozilla/4.0 (compatible, ...)" 
Common Log Format (CLF)
   "%h %l %u %t \"%r\" %>s %b"
Common Log Format with Virtual Host
   "%v %h %l %u %t \"%r\" %>s %b"
NCSA extended/combined log format
   "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""
Referer log format
   "%{Referer}i -> %U"
Agent (Browser) log format
   "%{User-agent}i"
%...h  	Remote host
%...l  	Remote logname (from identd, if supplied). This will return a dash unless IdentityCheck is set On.
%...u  	Remote user (from auth; may be bogus if return status (%s) is 401)
%...t  	Time the request was received (standard english format)
%...{format}t  	The time, in the form given by format, which should be in strftime(3) format. (potentially localized)
%...r  	First line of request
%...b  	Size of response in bytes, excluding HTTP headers. In CLF format, i.e.  a '-' rather than a 0 when no bytes are sent.
%...{Foobar}i  	The contents of Foobar: header line(s) in the request sent to the server.
%...v  	The canonical ServerName  of the server serving the request.
%...s  	Status. For requests that got internally redirected, this is the status of the *original* request --- %...>s  for the last.
  • t.i old
%v %l %u %t \"%r\" %>s %b