MySql/Migration/Php/Apache/Samba/Cups/Rechte/Arch in VirtualBox

https://www.wiki.archlinux.de/title/Shell-Spickzettel

Mysql

mysql data directory on Osx

(da wo die datenbanken sind)

/usr/local/var/mysql


Konfigurationsfile:

/usr/local/etc/my.cnf


create database:

mysqladmin -u root create faq3_de


Login to mysql monitor:

mysql -u root

mysql -uroot -p


Benutzer anlegen (funktioniert nicht:)

mysql> grant all on faq3_de.* to faq3@localhost identified by 'password';

mysq> \q (= exit)


mysql.server start

mysql.server stop

mysql.server restart


WARNING: (OSX)

lool in activity monitor!!

THe file /Library/LaunchAgents/homebrew.mxcl.mariadb.plist

is startet automatically on every requst to mysql(mariadb) and ond start

I dont want this and have renamed it to homebrew.mxcl.mariadb.plist.disabled


mysql.server options: --pid-file --base --dir



Migrating from OSX Mamp to Linux:

https://confluence.atlassian.com/display/CONFKB/Change+MySQL+Database+Character+Encoding+to+UTF8+During+Server+Migration)


cd /Applications/Mamp/Library/ibn


./mysqldump --host=localhost --default-character-set=latin1 --skip-set-charset --no-create-db -uroot -proot faq3_de > /Volumes/transfer/faq3_de.sql


(komischerweise sind die Files dann doch mit Encoding utf 8 gekennzeichnet)


Import in Linux:

mysql -u root faq3_de < /mnt/transfer/faq3_de.sql


Mit iconv unter linux kann man auch konvertieren - hat aber nix gebracht!!

iconv --from-code=ISO-8859-1 --to-code=UTF-8 /mnt/transfer/faq3_de.sql > /mnt/transfer/faq3_de_iso.sql

iconv -l



Kopieren der Daten auf einen anderen Server:

./mysqldump --host=localhost -uroot -proot --opt faq3_de | mysql -u root -p --host=alarm -C faq3_de




Apache:

sudo apachectl start

dauerhaft:

sudo defaults write

/System/Library/LaunchDaemons/org.apache.httpd Disabled -bool false


default http director:

/Library/WebServer/Documnents/


apache config:

Osx:

/etc/apache2/httpd.conf

LoadModule php5_module libexec/apache2/libphp5.so

zugriffrechte fürs Arbeitsdirectory

(die Directorys für die Virtual Hosts müssen

in http-vhosts.conf eingestellt werden!):

<Directory "/srv/http">

Options Indexes FollowSymLinks MultiViews

AllowOverride None

Order allow,deny

Allow from all

</Directory>

auskomentieren für VHosts

Include conf/extra/httpd-vhosts.conf

Include /private/etc/apache2/extra/httpd-phpmyadmin.conf

AddDefaultCharset UTF-8


Linux:

/etc/httpd/


Vitural Hosts in

Osx

/etc/apache2/extras


Linux

/etc/httpd/extras




Php

Php eigener Server:

cd Myproject

php -S localhost:8000

InitFile:

/etc/php.ini


kritische Einstellungen:

engine = On


bei mac auskommentiert

open_basedir = /docroot/:/Library/WebServer/Documents/:home/:/tmp/:usr/share/pear/:/usr/share/webapps/:/Users/adminM/Sites/


display_error = ON


short_open_tag = =ON (should be off)


ist bei mac scheinbar auskommentiert, dann fumktionieren sessions nicht:

session_save_path = "/tmp"



SAMBA


/etc/samba/smb.conf




LMHOSTS Datei:

falls SAMBA als WINS fungieren soll muss hier

die Namesaufloesung stehen (ähnlich wie datei /etc/hosts)

/etc/samba/lmhosts



Falls DNS Server eingerichtet ist befindet sich der in:

/etc/resolv.con


Wenn samba als Server agieren soll:

wins support = yes

name resolve order = wins lmhosts hosts bcast


Wenn samba einen anderen WINS Server benutzen soll:

wins server = 192.168.1.2


Und dabei auch noch auf Broadcasts lauschen soll:

wins proxy = yes


siehe obige Beispielkonfiguration

am Besten ist es eine Gruppe samba mit einem user samb

und einem home dir /srv/samba anzulegen!



Eine Gruppe samba erzeugen:

groupadd samba


addUser:

First Create Unix User:

useradd joe

passwd joe


if the password not working



then add this user to samba:

smbpasswd -a joe

then in /etc/samba/smb.conf

we have to add the user to the share:

[transfer]

path = /pfad zur datei

valid users = admin root joe


list all samba users

pdbedit -L -v


Rechte:

https://wiki.archlinux.de/title/Rechteverwaltung

einzelnen Ordner:

chown joe datei

chgrp samba datei

chmod 750 programmdatei



datei kann mit userrechten ausgeführt werden

darf aber nur von mitgliedern der grppe group ausgeführt werden

alle anderen haben keine Rechte:

chown user:group dateiname

chmod 4650 dateiname



Besitzer kann lesen und schreiben

Gruppe darf lesen und Schreiben

rest nur lesen:

chgrp group datei

chmod 664 datei


Niemand ausser Eigentümer zugriff:

chmod 0700


gruppe lesen aber nicht ausführen

Besitzer dar alles

chgrp group datei

chmod 710 datei


gemeinsames Verzeichniss anlegen

staff darf anlegen und löschen

greuppe der dateien wird automatisch angepass,

rest nur lesen

chgrp staff datei

chmod 3770 datei





PHPMYADMIN

verwende Sequel Pro

oder ungezippte php datei in Sites kopieren:

http://sites/phpMyAdmin-4.1.3-all-languages/setup



CUPS

pacman - Syu

pacman -S cups

pacman -S ghostscript

pacman -S gsfonts

pacman -S hplip (fuer HP)

https://192.168.1.10:631


if avahi want start:

/etc/avahi/avahi-daemon.conf

"disallow-other-stacks = yes"


If Webinterface wont start:

nano /etc/cups/cupsd.conf

# Only listen for connections from the local machine.

Listen 192.168.1.10:631



??? modprobe usblp


??? parport ist fuer parallelport!!!

??? geht nicht modprobe parport

??? geht nicht modprobe parport_pc


systemctl enable avahi-daemon.service

systemctl enable cups.service

systemctl systemctl start avahi-daemon.service

systemctl systemctl start cups.service


Drucker installieren:

hp-setup -i


cd /usr/share/ppd/HP/hp-deskjet_f300_series.ppd.gz


testen?:

hp-systray


lppasswd -g sys -a root



nano /etc/cups/cupsd.conf

nano /etc/cups/printers.conf


win7:

add Networkprinter:

http://ALARM2:631/printers/Deskjet_F300



first avahi then cups then samba must be started!!



Istalling new System on VirutalBox

https://wiki.archlinux.org/index.php/Beginners'_Guide

geht Live Cd

make virtual Ha

loadkeys de

setfon Lat2-Terminus16

nano /etc/locale.gen

en_US.UTF-8 UTF-8

de_DE.UTF-8 UTF-8


make 2 partitions using fdisk

format the patitions:

mkfs.ext4 /dev/sda1

mkswap /dev/sda2

mount /mnt sda1


install System:

pacstrap -i /mnt base

generate an fstab file

genfstab -U -p /mnt >> /mnt/etc/fstab

controlll it:

nano /mnt/etc/fstab


chroot into new system:

arch-chroot /mnt /bin/bash


set locale !!!!!!

nano /etc/locale.gen

en.US.UTF-8 UTF-8

de.DE.UTF-8 UTF-8


locale-gen

loadkeys de-latin1

setfont Lat2-Terminus16

nano /etc/vconsole.conf

KEYMAP=de-latin1

FONT=Lat2-Terminus16


timezone

ls /usr/share/zoneinfo/Europe

ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime


UTC harwareclock

syncing over NTPd

hwclock --systohc --utc


setting Hostname

echo myhostname > /etc/hostname


from here on we habve to set Network

password etc..

passwd



Systemd

https://wiki.archlinux.org/index.php/systemd

System:

systemctl list-units --all

systemctl list-units --failed


is unit enaled?:

systemctl is-enabled unit


enable unit to be started on load:

systemctl enable unit


disable unit to not starting during boot

systemctl disable unit


systemctl reboot


systemctl poweroff


systemctl hibernate


systemctl hybrid sleep


siehe auch Handling dependencies !!


Webmin

systemctl enable webmin.service

systemctl start webmin

systemctl disable webmin.service




OwnCloud


install result:

Uncomment extensions gd.so intl.so iconv.so openssl.so xmlrpc.so zip.so

and either pdo_sqlite.so sqlite3.so (for the SQLite backend), pdo_pgsql.so pgsql.so (for the PostgreSQL backend) or mysqli.so pdo_mysql.so (for the MySQL backend)

in /etc/php/php.ini


If using Apache, copy /etc/webapps/owncloud/apache.example.conf to /etc/httpd/conf/extra/owncloud.conf

and add the following lines into /etc/httpd/conf/httpd.conf:

Include /etc/httpd/conf/extra/owncloud.conf

LoadModule php5_module modules/libphp5.so

Include conf/extra/php5_module.conf

Optional dependencies for owncloud

php-apache: to use the Apache web server [installed]

php-sqlite: to use the SQLite database backend

php-pgsql: to use the PostgreSQL database backend

mariadb: to use the MySQL database backend [installed]

smbclient: to mount SAMBA shares [installed]

php-mcrypt [installed]

php-imagick: file preview

ffmpeg: file preview

libreoffice-common: file preview


GIT

Optional dependencies for git

tk: gitk and git gui

perl-libwww: git svn

perl-term-readkey: git svn

perl-mime-tools: git send-email

perl-net-smtp-ssl: git send-email TLS support

perl-authen-sasl: git send-email TLS support

python2: various helper scripts [installed]

subversion: git svn

cvsps: git cvsimport

gnome-keyring: GNOME keyring credential helper

[root@alarm ~]#



git server dir eingerichtet auf 192.168.1.2/mnt/transfer/sites/gitrem

REMOTE:

cd /mnt/transfer/sites/gitrem

mkdir foo.git

cd foo.git

git init --bare (--shared)

git update-server-info #if planing to serve via http




local

mkdir foo

cd foo

git init

copy nul "readme"

git add readme

git commit -m "initial"

git remote add origin gitrem@192.168.1.2:/mnt/transfer/sites/gitrem/foo.git

git push -origin master


git clone gitrem@192.168.1.2:foo.git




Scannen Sane

installier auf alarm2

https://wiki.archlinux.org/index.php/sane#For_HP_hardware

scanimage -L

scanimage --format=tiff > test.tiff


http://www.ellert.se/twain-sane/


ProFTP

systemctl status proftpd.service

systemctl start proftpd.service

/etc/proftp.conf

http://www.proftpd.org/docs/howto/Chroot.html