Configuration Noekeon.org

From miki
Revision as of 06:01, 18 July 2016 by Mip (talk | contribs) (→‎Server Install OVH: Remove setuid procmail)
Jump to navigation Jump to search

Domain

Tentative zone file for migration to OVH.

  • HTTP web site served by my OVH server immie.org.
  • HTTPS still served by Priorweb.be.
  • mail for domain noekeon.org served by Priorweb.be.
  • mails for domain test.noekeon.org server by OVH server immie.org.
; @ = noekeon.org

; A - AAAA records
*                10800 IN A      91.134.134.85
ftp              10800 IN A      62.182.63.46
kiwi             10800 IN A      62.182.63.48
localhost        10800 IN A      127.0.0.1
@                10800 IN A      62.182.63.46
prime            10800 IN A      91.134.134.85

; CNAME records
mail             10800 IN CNAME  mail.priorweb.be.
mail.test        10800 IN CNAME  prime
pop              10800 IN CNAME  pop.priorweb.be.
smtp             10800 IN CNAME  smtp.priorweb.be.

; MX records
@                10800 IN MX 10  mx10.priorweb.be.
@                10800 IN MX 20  mx20.priorweb.be.
@                10800 IN MX 30  mx30.priorweb.be.
test             10800 IN MX 10  prime

Original zone on OVH (with minimal entries):

$TTL 3600
@          IN SOA    dns105.ovh.net. tech.ovh.net. (2016070301 86400 3600 3600000 300)
           IN NS     ns105.ovh.net.
           IN NS     dns105.ovh.net.
           IN MX 1   redirect.ovh.net.
           IN A      213.186.33.5
           IN TXT    "1|www.noekeon.org"
www        IN MX 1   redirect.ovh.net.
www        IN A      213.186.33.5
www        IN TXT    "3|welcome"
www        IN TXT    "l|fr"

PriorWeb Hints and Tips

  • MySQL
MySQL Host Name:
  • Use the generic name mysqlhost as MySQL host name in PHP scripts (as suggested by Priorweb's control panel)
$db_host="mysqlhost";
Create a new database:
Copy database:
  • First create the new database using Priorweb's Control Panel.
  • Second, go to Priorweb's phpMyAdmin page
  • Select database to backup
  • From menu above, chooose Operations, and then Copy Database To.
  • Uncheck CREATE DATABASE before copying, and check Add AUTO_INCREMENT value (no idea if that's necessary, but it is selected on the Export page), then click Go
Backup a database - Using phpMyAdmin:
  • Go to Priorweb's phpMyAdmin page
  • Select database to backup
  • From menu above, select EXPORT, select export in SQL format, export Structure and Data, choose a compression method (e.g. gzipped), click Go
Restoring a database - Using phpMyAdmin:
  • Go to Priorweb's phpMyAdmin page
  • Select database to restore
  • QUESTION: Do we have to delete the content of the database before importing???
Backup / Restore using command-line:
  • See procedure used to back-up this wiki here
  • Or see here

Miki's Kiwi Wiki

See dedicated page.

Miki's ToDoList

cd ~/kiwi.noekeon.org/miki/todo
unzip todolist.zip
mv todolist/* .
rmdir todolist
#Now remove garbage files...
find . -name _notes -exec rm -r {} \;            # Ignore errors on directory not found
find . -name __MACOSX -exec rm -r {} \;
  • Edit file dbconnection.php
$db_host="mysqlhost";
$db_name="mikido";
$username="miki";
$password="********";
username: miki
pwd: ********
database: mikido
DirectoryIndex todolist.php
  • Now you can visit https://kiwi.noekeon.org/miki/todo/. Create a user first before creating a task. Note that you must refresh the page (F5) first otherwise drop-down list is not refreshed and page generates an error.

Shell

  • In the following notes, ~ refers to original home directory /opt/www/daemenj/web.
  • bash shell resource file in ~/private/mip.bashrc:
#! /bin/bash

# Clever trick because we cannot write in /opt/www/daemenj/web...
# ... move HOME to private directory so that all commands fetch their configuration file there
export HOME=/opt/www/daemenj/web/private

# Ignore some controlling instructions
export HISTIGNORE="[   ]*:&:bg:fg:exit"

# Aliases
# #######

alias grep='grep --color'                     # show differences in colour

# Some shortcuts for different directory listings
eval `dircolors -b ~/.dircolors.cfg`
alias ls='ls -F --color=auto'					# classify files in colour
alias ll='ls -l'                                                # long list
alias la='ls -A'                                                # all but . and ..
alias l='ls -lA'                                                #
alias dir='ls --format=vertical'
alias vdir='ls --format=long'
  • Resource file for vim ~/private/.vimrc:
syntax enable
set bg=light
set number
nnoremap j h
nnoremap l j
"nnoremap k k
nnoremap m l
nnoremap h m
vnoremap j h
vnoremap l j
"vnoremap k k
vnoremap m l
vnoremap h m
  • Directory colors ~/private/.dircolors.cfg:
# Configuration file for dircolors, a utility to help you set the
# LS_COLORS environment variable used by GNU ls with the --color option.
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
# slackware version of dircolors) are recognized but ignored.
# Below, there should be one TERM entry for each termtype that is colorizable
TERM linux
TERM linux-c
TERM mach-color
TERM console
TERM con132x25
TERM con132x30
TERM con132x43
TERM con132x60
TERM con80x25
TERM con80x28
TERM con80x30
TERM con80x43
TERM con80x50
TERM con80x60
TERM cygwin
TERM dtterm
TERM mlterm
TERM putty
TERM xterm
TERM xterm-color
TERM xterm-debian
TERM rxvt
TERM rxvt-unicode
TERM screen
TERM screen-bce
TERM screen-w
TERM vt100
TERM Eterm
# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
NORMAL 00 # global default, although everything should be something.
FILE 00 # normal file
DIR 01;34 # directory
LINK 36 # symbolic link. (If you set this to 'target' instead of a
 # numerical value, the color is as for the file pointed to.)
FIFO 40;33 # pipe
SOCK 35 # socket
DOOR 35 # door
BLK 40;33;01 # block device driver
CHR 40;33;01 # character device driver
ORPHAN 40;31;01 # symlink to nonexistent file
# This is for files with execute permission:
EXEC 32
# List any file extensions like '.gz' or '.tar' that you would like ls
# to colorize below. Put the extension, a space, and the color init string.
# (and any comments you want to add after a '#')
# If you use DOS-style suffixes, you may want to uncomment the following:
#.cmd 32 # executables (bright green)
#.exe 32
#.com 32
#.btm 32
#.bat 32
.tar 01;31 # archives or compressed (bright red)
.tgz 01;31
.arj 01;31
.taz 01;31
.lzh 01;31
.zip 01;31
.z 01;31
.Z 01;31
.gz 01;31
.bz2 01;31
.deb 01;31
.rpm 01;31
.jar 01;31
# image formats
.jpg 35
.jpeg 35
.gif 35
.bmp 35
.pbm 35
.pgm 35
.ppm 35
.tga 35
.xbm 35
.xpm 35
.tif 35
.tiff 35
.png 35
.mov 35
.mpg 35
.mpeg 35
.avi 35
.fli 35
.gl 35
.dl 35
.xcf 35
.xwd 35
# audio formats
.flac 35
.mp3 35
.mpc 35
.ogg 35
.wav 35

Cron

This is the crontab file on noekeon.org. Install it with crontab -u daemenj crontab.

# use /bin/bash to run commands, instead of the default /bin/sh
SHELL=/bin/bash
# mail any output to 'michael.peeters@noekeon.org', no matter whose crontab this is
MAILTO="michael.peeters@noekeon.org"
#
#
# m h dom mon dow    command   (dow=0|7 is sunday)
33 8 * * *            ~daemenj/private/changemonitor/monitor-all.sh >/dev/null 2>/dev/null

Server Install OVH

Miscellaneous

  • Postfix complains that it is setuid root:
Jul 18 05:22:30 ober postfix/sendmail[27605]: warning: the Postfix sendmail command has set-uid root file permissions
Jul 18 05:22:30 ober postfix/sendmail[27605]: warning: or the command is run from a set-uid root process
Jul 18 05:22:30 ober postfix/sendmail[27605]: warning: the Postfix sendmail command must be installed without set-uid root file permissions
It is not necessary to run procmail as setuid root with postfix [1], so we do:
ls -l /usr/bin/procmail
# -rwsr-sr-x 1 root mail 88K Feb 11  2015 /usr/bin/procmail
chmod u-s /usr/bin/procmail
ls -l /usr/bin/procmail
# -rwxr-sr-x 1 root mail 88K Feb 11  2015 /usr/bin/procmail