Difference between revisions of "Debian"

From Server Knowledge Base
Jump to navigationJump to search
m
Line 18: Line 18:


http://wiki.debian.org/motd
http://wiki.debian.org/motd
== mutt ==
If you use mutt to send emails via scripts and get this message because the attachment is too large:
<pre>postdrop: warning: uid=0: File too large
sendmail: fatal: root(0): message file too big
Error sending message, child exited 75 (Deferred.).
Could not send the message.</pre>
Be warned installing exim to solve the issue will do the following:
<pre>apt-get install exim4
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  exim4-base exim4-config exim4-daemon-light
Suggested packages:
  eximon4 exim4-doc-html exim4-doc-info spf-tools-perl swaks
The following packages will be REMOVED:
  postfix
The following NEW packages will be installed:
  exim4 exim4-base exim4-config exim4-daemon-light
0 upgraded, 4 newly installed, 1 to remove and 31 not upgraded.
Need to get 2,080 kB of archives.
After this operation, 807 kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://ftp.uk.debian.org/debian/ squeeze/main exim4-base amd64 4.72-6+squeeze3 [1,016 kB]
Get:2 http://ftp.uk.debian.org/debian/ squeeze/main exim4-daemon-light amd64 4.72-6+squeeze3 [594 kB]
Get:3 http://ftp.uk.debian.org/debian/ squeeze/main exim4-config all 4.72-6+squeeze3 [462 kB]
Get:4 http://ftp.uk.debian.org/debian/ squeeze/main exim4 all 4.72-6+squeeze3 [7,812 B]
Fetched 2,080 kB in 0s (7,680 kB/s)
E: Could not perform immediate configuration on 'exim4-daemon-light'. Please see man 5 apt.conf under APT::Immediate-Configure for details. (2)</pre>
root@serverkb:/usr/sbin# apt-get install exim4-base exim4-config<br>
Reading package lists... Done<br>
Building dependency tree<br>
Reading state information... Done<br>
The following package was automatically installed and is no longer required:<br>
  '''pve-kernel-2.6.32-19-pve'''<br>
Use 'apt-get autoremove' to remove them.<br>
The following extra packages will be installed:<br>
  pve-kernel-2.6.32-19-pve<br>
Suggested packages:<br>
  eximon4 exim4-doc-html exim4-doc-info spf-tools-perl swaks<br>
The following packages will be REMOVED:<br>
  bsd-mailx postfix proxmox-ve-2.6.32 pve-manager<br>
The following NEW packages will be installed:<br>
  exim4-base exim4-config pve-kernel-2.6.32-19-pve<br>
0 upgraded, 3 newly installed, 4 to remove and 30 not upgraded.<br>
Need to get 31.9 MB/33.4 MB of archives.<br>
After this operation, 553 kB disk space will be freed.<br>
Do you want to continue [Y/n]? Y<br>
Get:1 http://download.proxmox.com/debian/ squeeze/pve pve-kernel-2.6.32-19-pve amd64 2.6.32-96 [31.9 MB]<br>
Fetched 31.9 MB in 3s (8,937 kB/s)<br>
Preconfiguring packages ...<br>
(Reading database ... 56486 files and directories currently installed.)<br>
Removing bsd-mailx ...<br>
'''Removing proxmox-ve-2.6.32''' ...<br>
'''Removing pve-manager''' ...<br>
'''Removing postfix''' ...<br>
'''Stopping Postfix Mail Transport Agent: postfix.'''<br>
Processing triggers for man-db ...<br>
Selecting previously deselected package exim4-config.<br>
(Reading database ... 55756 files and directories currently installed.)<br>
Unpacking exim4-config (from .../exim4-config_4.72-6+squeeze3_all.deb) ...<br>
Selecting previously deselected package exim4-base.<br>
Unpacking exim4-base (from .../exim4-base_4.72-6+squeeze3_amd64.deb) ...<br>
Selecting previously deselected package pve-kernel-2.6.32-19-pve.<br>
Unpacking pve-kernel-2.6.32-19-pve (from .../pve-kernel-2.6.32-19-pve_2.6.32-96_amd64.deb) ...<br>
Processing triggers for man-db ...<br>
Setting up exim4-config (4.72-6+squeeze3) ...<br>
grep: /etc/inetd.conf: No such file or directory<br>
Adding system-user for exim (v4)<br>
Setting up exim4-base (4.72-6+squeeze3) ...<br>
insserv: warning: script 'K01jira' missing LSB tags and overrides<br>
insserv: warning: script 'jira' missing LSB tags and overrides<br>
Setting up pve-kernel-2.6.32-19-pve (2.6.32-96) ...<br>
update-initramfs: Generating /boot/initrd.img-2.6.32-19-pve<br>
Generating grub.cfg ...<br>
Found linux image: /boot/vmlinuz-2.6.32-19-pve<br>
Found initrd image: /boot/initrd.img-2.6.32-19-pve<br>
Found linux image: /boot/vmlinuz-2.6.32-18-pve<br>
Found initrd image: /boot/initrd.img-2.6.32-18-pve<br>
Found memtest86+ image: /memtest86+.bin<br>
Found memtest86+ multiboot image: /memtest86+_multiboot.bin<br>
done<br>
<pre>apt-get install exim4-daemon-light
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  pve-kernel-2.6.32-19-pve
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  exim4-daemon-light
0 upgraded, 1 newly installed, 0 to remove and 30 not upgraded.
Need to get 0 B/594 kB of archives.
After this operation, 1,135 kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously deselected package exim4-daemon-light.
(Reading database ... 58349 files and directories currently installed.)
Unpacking exim4-daemon-light (from .../exim4-daemon-light_4.72-6+squeeze3_amd64.deb) ...
Processing triggers for man-db ...
Setting up exim4-daemon-light (4.72-6+squeeze3) ...
Starting MTA: exim4.</pre>


== MySQL ==
== MySQL ==

Revision as of 19:27, 19 July 2013

Broken package

initscripts : Breaks: nfs-common (< 1:1.2.5-3) but 1:1.2.2-4squeeze2 is to be installed

If you're on Debian 6 (squeeze) do:

vim /etc/apt/sources.list

Make sure there are no lines like the one below:

deb http://ftp.uk.debian.org/debian sid main

Cron log

cat /var/log/syslog | grep CRON

motd

http://wiki.debian.org/motd

mutt

If you use mutt to send emails via scripts and get this message because the attachment is too large:

postdrop: warning: uid=0: File too large
sendmail: fatal: root(0): message file too big
Error sending message, child exited 75 (Deferred.).
Could not send the message.

Be warned installing exim to solve the issue will do the following:

apt-get install exim4
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  exim4-base exim4-config exim4-daemon-light
Suggested packages:
  eximon4 exim4-doc-html exim4-doc-info spf-tools-perl swaks
The following packages will be REMOVED:
  postfix
The following NEW packages will be installed:
  exim4 exim4-base exim4-config exim4-daemon-light
0 upgraded, 4 newly installed, 1 to remove and 31 not upgraded.
Need to get 2,080 kB of archives.
After this operation, 807 kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://ftp.uk.debian.org/debian/ squeeze/main exim4-base amd64 4.72-6+squeeze3 [1,016 kB]
Get:2 http://ftp.uk.debian.org/debian/ squeeze/main exim4-daemon-light amd64 4.72-6+squeeze3 [594 kB]
Get:3 http://ftp.uk.debian.org/debian/ squeeze/main exim4-config all 4.72-6+squeeze3 [462 kB]
Get:4 http://ftp.uk.debian.org/debian/ squeeze/main exim4 all 4.72-6+squeeze3 [7,812 B]
Fetched 2,080 kB in 0s (7,680 kB/s)
E: Could not perform immediate configuration on 'exim4-daemon-light'. Please see man 5 apt.conf under APT::Immediate-Configure for details. (2)

root@serverkb:/usr/sbin# apt-get install exim4-base exim4-config
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:

 pve-kernel-2.6.32-19-pve

Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:

 pve-kernel-2.6.32-19-pve

Suggested packages:

 eximon4 exim4-doc-html exim4-doc-info spf-tools-perl swaks

The following packages will be REMOVED:

 bsd-mailx postfix proxmox-ve-2.6.32 pve-manager

The following NEW packages will be installed:

 exim4-base exim4-config pve-kernel-2.6.32-19-pve

0 upgraded, 3 newly installed, 4 to remove and 30 not upgraded.
Need to get 31.9 MB/33.4 MB of archives.
After this operation, 553 kB disk space will be freed.
Do you want to continue [Y/n]? Y
Get:1 http://download.proxmox.com/debian/ squeeze/pve pve-kernel-2.6.32-19-pve amd64 2.6.32-96 [31.9 MB]
Fetched 31.9 MB in 3s (8,937 kB/s)
Preconfiguring packages ...
(Reading database ... 56486 files and directories currently installed.)
Removing bsd-mailx ...
Removing proxmox-ve-2.6.32 ...
Removing pve-manager ...
Removing postfix ...
Stopping Postfix Mail Transport Agent: postfix.
Processing triggers for man-db ...
Selecting previously deselected package exim4-config.
(Reading database ... 55756 files and directories currently installed.)
Unpacking exim4-config (from .../exim4-config_4.72-6+squeeze3_all.deb) ...
Selecting previously deselected package exim4-base.
Unpacking exim4-base (from .../exim4-base_4.72-6+squeeze3_amd64.deb) ...
Selecting previously deselected package pve-kernel-2.6.32-19-pve.
Unpacking pve-kernel-2.6.32-19-pve (from .../pve-kernel-2.6.32-19-pve_2.6.32-96_amd64.deb) ...
Processing triggers for man-db ...
Setting up exim4-config (4.72-6+squeeze3) ...
grep: /etc/inetd.conf: No such file or directory
Adding system-user for exim (v4)
Setting up exim4-base (4.72-6+squeeze3) ...
insserv: warning: script 'K01jira' missing LSB tags and overrides
insserv: warning: script 'jira' missing LSB tags and overrides
Setting up pve-kernel-2.6.32-19-pve (2.6.32-96) ...
update-initramfs: Generating /boot/initrd.img-2.6.32-19-pve
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-19-pve
Found initrd image: /boot/initrd.img-2.6.32-19-pve
Found linux image: /boot/vmlinuz-2.6.32-18-pve
Found initrd image: /boot/initrd.img-2.6.32-18-pve
Found memtest86+ image: /memtest86+.bin
Found memtest86+ multiboot image: /memtest86+_multiboot.bin
done

apt-get install exim4-daemon-light
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  pve-kernel-2.6.32-19-pve
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  exim4-daemon-light
0 upgraded, 1 newly installed, 0 to remove and 30 not upgraded.
Need to get 0 B/594 kB of archives.
After this operation, 1,135 kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously deselected package exim4-daemon-light.
(Reading database ... 58349 files and directories currently installed.)
Unpacking exim4-daemon-light (from .../exim4-daemon-light_4.72-6+squeeze3_amd64.deb) ...
Processing triggers for man-db ...
Setting up exim4-daemon-light (4.72-6+squeeze3) ...
Starting MTA: exim4.

MySQL

It is commonly easier to use this to dump and restore MySQL, instead of using mysqldump on the new server via .sql files:

mysqldump --default-character-set=binary --user=root --password=EnterPasswordHere databasename > dbdump.txt
mysql --silent --local --password=EnterPasswordHere DatabaseName < dbdump.txt

Speed up SSH login

By default for some reason in Debian 6 (Squeeze) /etc/ssh/sshd_config does not have UseDNS=no within it. Add it into the file and restart SSH and this will greatly improve SSH login as a sudo user or root. GSSAPIAuthentication=no may also help.

Transmission

The easiest way to get this working is by doing:

vim /etc/apt/sources.list

Add in this line:

deb http://ftp.uk.debian.org/debian sid main

Do apt-get update , then do:

apt-cache show transmission-cli | grep Version
apt-cache show transmission-common | grep Version
apt-cache show transmission-daemon | grep Version
apt-get install transmission-cli transmission-common transmission-daemon

Then, to edit the files without it overwriting /etc/transmission-daemon/settings.json

Stop the service, edit the file, backup the file and then start the service.

/etc/init.d/transmission-daemon stop
vim /etc/transmission-daemon/settings.json
cp /etc/transmission-daemon/settings.json /root/settings.json.backup
/etc/init.d/transmission-daemon start

Check /etc/transmission-daemon/settings.json is the same file you edited and that it is owned by debian-transmission:debian-transmission

Wordpress

If you are using a Vanilla build of a Unix OS you will need to do this so themes and plugins can install:

cd /var/www/vhosts/
chown www-data:www-data yourdomain.co.uk/* -R

Stop prompting for FTP credentials

echo "" >> /var/www/vhosts/yourdomain.co.uk/wp-config.php
echo "define('FS_METHOD', 'direct');" >> /var/www/vhosts/yourdomain.co.uk/wp-config.php