Enable Remote Access to Database Server

centos-logo

I have two servers for serve as website, 10.0.0.10 as webserver and 10.0.0.11 as database server. And then how to setup that. Both of servers run CentOS 6.7.

In Database Server:

  1. Install mysql-server | this step from rackspace.com
    $ sudo yum install mysql-server
    $ sudo service mysqld start
  2. Then, run the following command:
    $ sudo /usr/bin/mysql_secure_installation

    when section ask about remote access, I do yes, server can act remote acces

  3. Launching at reboot
    $ sudo chkconfig mysqld on
  4. Setup firewall to enable access from only webserver (10.0.0.10), end open port 3306
    $ sudo su
    # iptables -A INPUT -i eth0 -s 10.0.0.10 -p tcp --dport 3306 -m state --state NEW,ESTABLISHED -j ACCEPT
    # iptables -A OUTPUT -p tcp --sport 3306 -m state --state NEW,ESTABLISHED -j ACCEPT
    # service iptables save
    # service iptables restast
    # iptables -L
  5. Setting my.cnf to set server bind-address | step from cyberciti.biz
    $ sudo vim /etc/my.cnf

    At [mysqld] section add line:

    bind-address=10.0.0.11
    $ sudo service mysqld restart

Testing from both servers, database server and webserver
Continue reading “Enable Remote Access to Database Server”

Advertisements

Memasang PHP5.6, NodeJS dan NPM di CentOS 6.7

centos-logo

Saya butuh php 5.6 di CentOS karena versi bawaan adalah 5.3. Mari kita pasang. Caranya:

  1. Tambahkan repo remi,
    $ wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    $ wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
    $ rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
  2. Enable repo dengan mengganti nilai enable = 1 pada bagian [remi-php56]
    $ sudo vim /etc/yum.repos.d/remi.repo
  3. Install php beserta module yg dibutuhkan.
    $ sudo yum install php php-mysql php-devel php-gd php-pecl-memcache php-pspell php-snmp php-xmlrpc php-xml php-mbstring

*sumber: http://www.servermom.org/upgrade-php-53-54-55-centos/1534/

Lanjut masang nodejs dan npm:

  1. Pasang repo epel
    $ sudo yum install epel-release
  2. Pasang nodejs dan npm
    $ sudo yum install nodejs npm
  3. Periksa versi yang terpasang
    $ node –version
    $ npm –version

Selesai!

 

 

CentOS, Apache2, Change DocumentRoot HTTPD

Hi, long time not write something technical.

This week, after install httpd packet for webserver in CentOS, then open port 80 in firewall. I want to move DocumentRoot to my home folder (/home/user/repo). The default DocumentRoot is /var/www/html folder. But I get 403 error. There how to solve this problem:

  1. Set DocumentRoot to path you want, by editing httpd.conf.
    $ sudo vim /etc/httpd/conf/httpd.conf
  2. Set permission for /home/user folder.
    $ chmod 0+x /home/user
  3. Set SELinux for new DocumentRoot
    $ sudo getenforce
    $ sudo setenforce 0
    $ sudo chcon -Rv –type=httpd_t /home/user/repo
    $ sudo setenforce 1
  4. Make simple index.html file in the new DocumentRoot, restart httpd and test access from browser.
    $ sudo service httpd restart
  5. Finish

Yay. That all, please remind me if you find anythink wrong. Thanks

estu~

Kabar Sertifikasi Nasional, Workshop dan Pelatihan ClearOS BLC Pandaan

Tretes, 12 Feb 2012

Wah, akhirnya saya jadi ikut seminarnya.
Workshop selama dua hari, 11-12 Februari 2012.

dari Jogja hanya sendiri, g memudarkan semangat saya buat dateng.
brangkat…..

seminar ClearOS Pandaan
seminar ClearOS Pandaan

Acara seminar yang rencananya diadakan di BLC Pandaan, dipindahkan ke Balai SKSD Palapa, Tretes, Prigen Pandaan. Jadinya lokasi semakin asik, dengan pemandangan khas pegunungan. Dingin…..

Read More