Browsing: Linux

Tutorial Install Webserver Nginx PHP56-FPM dan MariaDB

yum -y epel-release
rpm -Uvh https://centos6.iuscommunity.org/ius-release.rpm
nano /etc/yum.repos.d/MariaDB.repo

copy this code to MariaDB.repo file
# MariaDB 5.5 CentOS repository list - created 2017-08-22 12:43 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

save file, alt + x + s
next
yum -y install MariaDB-client MariaDB-server nginx php56u-fpm php56u-mbstring php56u-mcrypt php56u-mysql php56u-gd
done, next
chkconfig nginx on
chkconfig php-fpm on
chkconfig mysql on
service nginx start
service php-fpm start
service mysql start
mysql_secure_installation

{ Add a Comment }

Cara install PPTP di centos

caranya begini

rpm -i http://poptop.sourceforge.net/yum/stable/rhel6/pptp-release-current.noarch.rpm
yum -y install pptpd
echo "localip 192.168.254.1" >> /etc/pptpd.conf
echo "remoteip 192.168.254.2-254" >> /etc/pptpd.conf
echo "username pptpd password 192.168.254.2" >> /etc/ppp/chap-secrets
echo "ms-dns 8.8.8.8" >> /etc/ppp/options.pptpd
echo "ms-dns 8.8.8.8" >> /etc/ppp/options.pptpd
echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/sysctl -w net.ipv4.ip_forward=1
service pptpd restart
chkconfig pptpd on

edit iptables ganti kayak gini

# Generated by iptables-save v1.4.7 on Tue Oct 10 12:13:25 2017
*filter
:INPUT ACCEPT [8591388:2012853449]
:FORWARD ACCEPT [918214:442449306]
:OUTPUT ACCEPT [8383396:2600857229]
COMMIT
# Completed on Tue Oct 10 12:13:25 2017
# Generated by iptables-save v1.4.7 on Tue Oct 10 12:13:25 2017
*nat
:PREROUTING ACCEPT [1226735:95267308]
:POSTROUTING ACCEPT [14116:1449024]
:OUTPUT ACCEPT [451739:34020974]
-A POSTROUTING -o eth0 -j MASQUERADE
-A POSTROUTING -o ppp0 -j MASQUERADE
-A POSTROUTING -o ppp1 -j MASQUERADE
-A POSTROUTING -o ppp2 -j MASQUERADE
-A POSTROUTING -o ppp3 -j MASQUERADE
-A POSTROUTING -o ppp4 -j MASQUERADE
-A POSTROUTING -o ppp5 -j MASQUERADE
-A POSTROUTING -o ppp6 -j MASQUERADE
-A POSTROUTING -o ppp7 -j MASQUERADE
-A POSTROUTING -o ppp8 -j MASQUERADE
-A POSTROUTING -o ppp9 -j MASQUERADE
-A POSTROUTING -o ppp10 -j MASQUERADE
-A POSTROUTING -o ppp11 -j MASQUERADE
-A POSTROUTING -o ppp12 -j MASQUERADE
COMMIT
# Completed on Tue Oct 10 12:13:25 2017

{ Add a Comment }

Cara install TightVNC dan XFCE di centos

Copy paste aja biar gak lama
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum -y install fontforge
yum -y install xorg-x11-fonts-*
yum -y groupinstall xfce
yum -y install tigervnc-server
echo 'VNCSERVERS="1:root"' >> /etc/sysconfig/vncservers
echo 'VNCSERVERARGS[1]="-geometry 1024x768"' >> /etc/sysconfig/vncservers

Setting Password
vncpasswd
Nyalakan VNC nya
vncserver
Edit File /root/.vnc/xstartup
tambahkan baris ini setelah unset DBUS_SESSION_BUS_ADDRESS
startxfce4
Install Firefox
yum install firefox
Restart VNC Server
service vncserver stop
chkconfig vncserver on
service vncserver start

Silahkan remote VNC nya lewat port 5901 dengan menggunakan aplikasi TightVNC untuk di windows

{ Add a Comment }

Bersih-bersih aplikasi yang tidak diperlukan ketika pertama deploy server

biasanya ini yang saya lakukan
yum -y install wget nano
cd /tmp
chkconfig saslauthd off
service saslauthd stop
chkconfig sendmail off
service sendmail stop
chkconfig xinetd off
service xinetd stop
chkconfig rsyslog off
service rsyslog stop
chkconfig snmpd off
service snmpd stop
yum -y remove bind bind-libs
yum -y remove mysql mysql-libs mysql-server php-mysql
yum -y remove php php-cli php-common php-gd php-mbstring php-mcrypt php-pso php-xml
yum -y remove httpd httpd-tools
yum -y remove sendmail cronie cronie-noanacron crontabs sendmail-cf
yum -y remove xinetd finger-server talk-server
yum -y remove rsyslog
yum -y remove net-snmp net-snmp-libs net-snmp-utils
yum clean all

udah itu aja

{ Add a Comment }

Cara membuat block storage VULTR sebagai direktori data MySQL

Masuk ke konsole
login sebagai root
copy paste atau ketikan kode dibawah ini
parted -s /dev/vdb mklabel gpt
parted -s /dev/vdb unit mib mkpart primary 0% 100%
mkfs.ext4 /dev/vdb1
mkdir /var/lib/mysql
echo "/dev/vdb1 /var/lib/mysql ext4 defaults,noatime 0 0" >> /etc/fstab
mount /var/lib/mysql

dengan kode diatas block storage akan termount sebagai /var/lib/mysql setelah itu baru install webserver dan mysql nya

{ Add a Comment }

Cara membuat file swap untuk linux di VPS yang tidak memiliki partisi swap

Masuk ke konsole
login sebagai root
copy paste atau ketikan kode dibawah ini
dd if=/dev/zero of=/swapfile bs=1024 count=1024k
ls -lah /swapfile
mkswap /swapfile
swapon /swapfile
chown root:root /swapfile
chmod 0600 /swapfile
swapon -s
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
mount -a

dengan kode diatas akan terbuat swap dengan ukuran 1GB, jika ingin lebih besar tinggal ganti “1024” nya dengan angka yang diharapkan

{ Add a Comment }