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
---















No comments:

Post a Comment