pvresize –setphysicalvolumesize 15G /dev/vda
Monthly Archives: October 2013
LVM extents currently allocated
pvs -v –segments /dev/vda2
Using physical volume(s) on command line
PV VG Fmt Attr PSize PFree Start SSize LV Start Type PE Ranges
/dev/vda2 VolGroup lvm2 a– 9.51g 0 0 2066 lv_root 0 linear /dev/vda2:0-2065
/dev/vda2 VolGroup lvm2 a– 9.51g 0 2066 368 lv_swap 0 linear /dev/vda2:2066-2433
resize qcow2 disk image
sudo qemu-img resize /var/lib/libvirt/images/centos.qcow2 +5G
systemd change run levels
systemctl isolate runlevel3.target
systemctl isolate runlevel5.target
systemd list services
systemctl list-unit-files –type=service
openvz start all containers at once
for ctid in `vzlist -SHo ctid`; do vzctl start $ctid; done
if you want stop all running OpenVZ containers:
for ctid in `vzlist -aHo ctid`; do vzctl stop $ctid; done
Syntax error on line 28 of /etc/apache2/sites-enabled/000-apps.vhost: Invalid command ‘SuexecUserGroup’, perhaps misspelled or defined by a module not included in the server configuration Action ‘configtest’ failed.
a2enmod suexec
dpkg was interrupted
dpkg –configure -a
openvz set disk space unlimited
vzctl set 100 –diskspace 99999G:99999G –save
or if you want remove disk quota in container config file:
DISK_QUOTA=no
This is also possible via this option:
DISKSPACE=”unlimited”
Tomcat hint – Debian
Download java: http://www.oracle.com/technetwork/java/javase/downloads/index.html
and save to /opt
cd /opt
wget http://apache.mirror.vu.lt/apache/tomcat/tomcat-8/v8.0.0-RC3/bin/embed/apache-tomcat-8.0.0-RC3-embed.tar.gz
tar -xvf apache-tomcat-8.0.0-RC3-src.tar.gz
ln -s apache-tomcat-8.0.0-RC3-src tomcat
mkdir /opt/tomcat/logs
groupadd tomcat
useradd -g tomcat -d /opt/tomcat tomcat
usermod -G www-data tomcat
chown tomcat:tomcat tomcat/ -R
vi /etc/init.d/tomcat
#!/bin/sh
CATALINA_HOME=/opt/tomcat
export CATALINA_HOME
JAVA_HOME=/opt/jdk1.6.0_25
export JAVA_HOME
TOMCAT_OWNER=tomcat
export TOMCAT_OWNER
JAVA_OPTS=”-Djava.awt.headless=true -Dfile.encoding=UTF-8
-server -Xms768m -Xmx768m
-XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m
-XX:MaxPermSize=256m -XX:+DisableExplicitGC”
export JAVA_OPTS
start() {
echo -n “Starting Tomcat: ”
su $TOMCAT_OWNER -c $CATALINA_HOME/bin/startup.sh
}
stop() {
echo -n “Stopping Tomcat: ”
su $TOMCAT_OWNER -c $CATALINA_HOME/bin/shutdown.sh
}
case “$1″ in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo $”Usage: tomcat {start|stop|restart}”
exit
esac
update-rc.d – debian
Insert links using the defaults:
update-rc.d foobar defaults
Equivalent command using explicit argument sets:
update-rc.d foobar start 20 2 3 4 5 . stop 20 0 1 6 .
Insert links for a service that should be running during multi-user
mode, but that does not need to be explicitly stopped on shutdown:
update-rc.d foobar multiuser
Equivalent command using explicit argument sets:
update-rc.d foobar start 20 2 3 4 5 . stop 20 1 .
More typical command using explicit argument sets:
update-rc.d foobar start 30 2 3 4 5 . stop 70 0 1 6 .
Remove all links for a script (assuming foobar has been deleted
already):
update-rc.d foobar remove
Example of disabling a service:
update-rc.d -f foobar remove
update-rc.d foobar stop 20 2 3 4 5 .
Example of a command for installing a system initialization-and-
shutdown script:
update-rc.d foobar start 45 S . start 31 0 6 .
Example of a command for disabling a system initialization-and-shutdown
script:
update-rc.d -f foobar remove
update-rc.d foobar stop 45 S .
amavis
Amavis is an open source content filter for electronic mail, implementing mail message transfer, decoding, some processing and checking, and interfacing with external content filters to provide protection against spam, viruses and other malware. It can be considered an interface between a mailer (MTA, Mail Transfer Agent) and one or more content filters.
enable vi syntax colors
vi ~/.vimrc
syntax on
colorscheme default
if only temporally:
:syntax on
simple ispconfig install debian
mkdir /opt/phpfcgi-5.4.12
mkdir /usr/local/src/php5-build
cd /usr/local/src/php5-build
wget http://de.php.net/get/php-5.4.12.tar.bz2/from/this/mirror -O php-5.4.12.tar.bz2
tar jxf php-5.4.12.tar.bz2
apt-get install build-essential
apt-get build-dep php5
apt-get install libfcgi-dev libfcgi0ldbl libjpeg62-dbg libmcrypt-dev libssl-dev libc-client2007e libc-client2007e-dev
ln -s /usr/lib/libc-client.a /usr/lib/x86_64-linux-gnu/libc-client.a
./configure \
–prefix=/opt/phpfcgi-5.4.12 \
–with-pdo-pgsql \
–with-zlib-dir \
–with-freetype-dir \
–enable-mbstring \
–with-libxml-dir=/usr \
–enable-soap \
–enable-calendar \
–with-curl \
–with-mcrypt \
–with-zlib \
–with-gd \
–with-pgsql \
–disable-rpath \
–enable-inline-optimization \
–with-bz2 \
–with-zlib \
–enable-sockets \
–enable-sysvsem \
–enable-sysvshm \
–enable-pcntl \
–enable-mbregex \
–with-mhash \
–enable-zip \
–with-pcre-regex \
–with-mysql \
–with-pdo-mysql \
–with-mysqli \
–with-jpeg-dir=/usr \
–with-png-dir=/usr \
–enable-gd-native-ttf \
–with-openssl \
–with-fpm-user=www-data \
–with-fpm-group=www-data \
–with-libdir=/lib/x86_64-linux-gnu \
–enable-ftp \
–with-imap \
–with-imap-ssl \
–with-kerberos \
–with-gettext \
–enable-cgi
make
make install
php.ini: cp -v /usr/local/src/php5-build/php-5.4.12/php.ini-production /opt/phpfcgi-5.4.12/lib/php.ini
cd /tmp
wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
tar xvfz ISPConfig-3-stable.tar.gz
cd ispconfig3_install/install
/opt/php-5.3.22/bin/php -q install.php
apt-spy – debian
Apt-spy is a program used to test a series of Debian’s mirrors for bandwidth. Apt-spy will then generate a /etc/apt/sources.list file with the fasted server. You can select which of the Debian server’s to benchmark by geographical location.
apt-spy -d stable -s lt