Showing posts with label vps. Show all posts
Showing posts with label vps. Show all posts

Thursday, May 7, 2015

Install proxmox on debian

#reinstall debian minimal 64 bit

nano /etc/hosts
#tambahkan
192.168.6.177 proxmox-6-177.proxmox.com proxmox-6-177 pvelocalhost

nano /etc/apt/sources.list
#tambahkan
deb http://ftp.at.debian.org/debian wheezy main contrib
# PVE repository provided by proxmox.com, only for installation (this repo will stay on 3.1)
deb http://download.proxmox.com/debian wheezy pve
# security updates
deb http://security.debian.org/ wheezy/updates main contrib

wget -O- "http://download.proxmox.com/debian/key.asc" | apt-key add -
apt-get update && apt-get dist-upgrade -y

apt-get install -y pve-firmware pve-kernel-2.6.32-26-pve pve-headers-2.6.32-26-pve
reboot
uname -a
#Linux ...-pve

apt-get remove linux-image-amd64 linux-image-3.2.0-4-amd64 linux-base
update-grub
apt-get install -y proxmox-ve-2.6.32 ntp ssh lvm2 postfix ksm-control-daemon vzprocps open-iscsi bootlogd

==

Monday, January 6, 2014

Tuesday, November 19, 2013

VNC on DEBIAN 7

apt-get update -y && apt-get upgrade -y

apt-get install -y lxde xfonts-100dpi xfonts-100dpi-transcoded xfonts-75dpi xfonts-75dpi-transcoded xfonts-base

#Installing and Configuring vnc4server
apt-get install -y vnc4server nano

# Now we need to add a user
adduser vncuser

# lakukan ini
mkdir -p /etc/vncserver
echo "
VNCSERVERS=\"1:vncuser\"
VNCSERVERARGS[1]=\"-geometry 1024x768\"
" >  /etc/vncserver/vncservers.conf

# copy paste
touch /etc/init.d/vncserver
chmod +x /etc/init.d/vncserver
nano /etc/init.d/vncserver

# Contents of /etc/init.d/vncserver

#!/bin/bash
### BEGIN INIT INFO
# Provides:          vncserver
# Required-Start:    $syslog
# Required-Stop:     $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: vnc server
# Description:
#
### END INIT INFO

unset VNCSERVERARGS
VNCSERVERS=""
[ -f /etc/vncserver/vncservers.conf ] && . /etc/vncserver/vncservers.conf
prog=$"VNC server"

start() {
 . /lib/lsb/init-functions
 REQ_USER=$2
 echo -n $"Starting $prog: "
 ulimit -S -c 0 >/dev/null 2>&1
 RETVAL=0
 for display in ${VNCSERVERS}
 do
 export USER="${display##*:}"
 if test -z "${REQ_USER}" -o "${REQ_USER}" == ${USER} ; then
 echo -n "${display} "
 unset BASH_ENV ENV
 DISP="${display%%:*}"
 export VNCUSERARGS="${VNCSERVERARGS[${DISP}]}"
 su ${USER} -c "cd ~${USER} && [ -f .vnc/passwd ] && vncserver :${DISP} ${VNCUSERARGS}"
 fi
 done
}

stop() {
 . /lib/lsb/init-functions
 REQ_USER=$2
 echo -n $"Shutting down VNCServer: "
 for display in ${VNCSERVERS}
 do
 export USER="${display##*:}"
 if test -z "${REQ_USER}" -o "${REQ_USER}" == ${USER} ; then
 echo -n "${display} "
 unset BASH_ENV ENV
 export USER="${display##*:}"
 su ${USER} -c "vncserver -kill :${display%%:*}" >/dev/null 2>&1
 fi
 done
 echo -e "\n"
 echo "VNCServer Stopped"
}

case "$1" in
start)
start $@
;;
stop)
stop $@
;;
restart|reload)
stop $@
sleep 3
start $@
;;
condrestart)
if [ -f /var/lock/subsys/vncserver ]; then
stop $@
sleep 3
start $@
fi
;;
status)
status Xvnc
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac

# Register the service

update-rc.d vncserver defaults 99

# Now we must create a VNC connection password for our user. First we will use the su command to login to the user's shell and use the vncpasswd to set the password.

su vncuser
vncpasswd

# We need to start then stop the server to generate a configuration file

vncserver :1; vncserver -kill :1

# After we've generated the configuration file, we must edit it so that LXDE is loaded when we connect

nano ~/.vnc/xstartup

# Edit the file or replace its contents so that they look like the code below and save

#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
lxsession -s LXDE &

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
# x-window-manager &

# Drop back to root shell

exit

# Start the VNC service

service vncserver start

Connecting to your VNC server from your local PC

Monday, August 5, 2013

VPS RamNode

1.Reinstall dg Debian 6 32bit, password root diset yg panjang

root@ns1:~# free
             total       used       free     shared    buffers     cached
Mem:        131072      21924     109148          0          0      14168
-/+ buffers/cache:       7756     123316
Swap:       131072          0     131072

2.update dan upgrade
apt-get update && apt-get upgrade

root@ns1:~# free
             total       used       free     shared    buffers     cached
Mem:        131072     113676      17396          0          0      99888
-/+ buffers/cache:      13788     117284
Swap:       131072       4132     126940

3.uninstall apache2
sudo service apache2 stop
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
sudo apt-get autoremove
sudo rm -rf /etc/apache2
shutdown -r now

root@ns1:~# free
             total       used       free     shared    buffers     cached
Mem:        131072      24180     106892          0          0      11648
-/+ buffers/cache:      12532     118540
Swap:       131072          0     131072

4.install lighttpd
apt-get install lighttpd

root@ns1:~# free
             total       used       free     shared    buffers     cached
Mem:        131072      50228      80844          0          0      34176
-/+ buffers/cache:      16052     115020
Swap:       131072          0     131072

5.aktifkan simple vhost
lighttpd-enable-mod simple-vhost

create folder sesuai host:
mkdir -p /var/www/namadomain.com/html

6.edit /etc/lighttpd/conf-enabled/10-simple-vhost.conf
server root=/var/www/
doc root=/html/
default host =namadomain.com

7.buat link utk subdomain
ln -s namadomain.com www.namadomain.com

test dg buat index.html di /var/www/namadomain.com/html/index.html



/etc/init.d/lighttpd force-reload

8.install php n mysql, password root = huruf angka dan karakter simbolik

/etc/init.d/lighttpd force-reload
apt-get install mysql-server php5-cgi php5-mysql

bila perlu:
apt-get install php5-gd php5-mcrypt php5-curl

root@ns1:/etc/lighttpd# free
             total       used       free     shared    buffers     cached
Mem:        131072     122216       8856          0          0     106028
-/+ buffers/cache:      16188     114884
Swap:       131072      14320     116752

9.setup php di lighttpd
cat > /etc/lighttpd/conf-enabled/10-cgi-php.conf
server.modules += ("mod_cgi")
cgi.assign = (".php" => "/usr/bin/php5-cgi")

reload

test:
echo '<?php phpinfo(); ?>' > /var/www/namadomain.com/html/phpinfo.php

             total       used       free     shared    buffers     cached
Mem:        131072     127552       3520          0          0     109460
-/+ buffers/cache:      18092     112980
Swap:       131072      13048     118024

10.update mysql conf, hilangkan innodb
cat > /etc/mysql/conf.d/lowendbox.cnf
[mysqld]
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K
ignore_builtin_innodb
default_storage-engine=MyISAM
^D

restart= /etc/init.d/mysql restart

Bila tidak ada user=root, lakukan:

--cek password
cat /etc/mysql/debian.cnf

mysql -u debian-sys-maint -p
--masukin password disini

--cek
SELECT u.user FROM mysql.user u

--jalanlan: jgn lupa ganti PASSWORDANDA
INSERT INTO mysql.user VALUES ('localhost','root',password('PASSWORDANDA'),'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);



--------
free
             total       used       free     shared    buffers     cached
Mem:        131072     120580      10492          0          0     109524
-/+ buffers/cache:      11056     120016
Swap:       131072       8968     122104

11.butuh ssh? pakai dropbear

12.install wp
mysqladmin -uroot -p[password] create [db]
wget http://wordpress.org/latest.tar.gz
tar zxf latest.tar.gz -C /var/www/namadomain.com/html
mv * ../
mv wp-config-sample.php wp-config.php
edit [username,password dan db]
setup wp

13.backup
 tar zcpf /tmp/semua.tar.gz  --directory=/ --exclude=proc --exclude=sys --exclude=dev/pts --exclude=tmp .


jangan lupa titik di belakangnya
---















Saturday, August 3, 2013

Cara test VPS

Test kecepatan download, cari terbesar:
------------------------
wget -O /dev/null http://cachefly.cachefly.net/100mb.test

lokal:
wget -O /dev/null http://kambing.ui.ac.id/iso/ubuntu/releases/12.04/ubuntu-12.04-alternate-amd64.iso

RamNode=4M/s
CloudKilat=60M/s
OneAsiaHost=26M/s

Pengujian CPU, cari terkecil:
-----------------------------
sysbench --test=cpu --num-threads=2 --cpu-max-prime=20000 run

RamNode=15.4 s
CloudKilat=29.5 s
OneAsiaHost=58 s

Uji RAM, cari tertinggi:
------------------------
sysbench --test=memory --memory-total-size=1G run

RamNode=653.53 M/s
CloudKilat=568.74 M/s
OneAsiaHost=128M VPS Standard
  128.00 MB transferred (691.57 MB/sec)
  256.00 MB transferred (1588.51 MB/sec)
  512.00 MB transferred (1875.09 MB/sec)
  1024.00 MB transferred (1179.22 MB/sec)

Uji Disk IO, cari tertinggi:
-----------------------------
dd bs=1M count=1024 if=/dev/zero of=test conv=fdatasync

RamNode=746 M/s
CloudKilat=75.1 M/s
OneAsiaHost=93.2 M/s     SSD=800M/s
Connect=10-21M/s

VULTR SSD rata2 = 220M/s  if=file1 of=file2

Selesai.

Catat di awal pembelian, tuning tiap bulan, apa ada perubahan?