30 September 2014

How To: Setting Multiple Domain / Sub Domain in CentOS

A Peladen Web (Web server) can be used to serve more than one Realm (Domain) or Sub Domains (Sub Domain), as configured in the Domain Naming System Peladen (DNS), the next stay and configure VirtualHost directive in the Web Peladen, in this case configure the httpd.conf

Okay, this example is CentOS 5.5 on a server, then stay just edit the httpd.conf configuration file located at: /etc/httpd/conf/httpd.conf and add the following line to the bottom line of the file:

NameVirtualHost ip-server-web:80
DocumentRoot "/web/document/location"
ServerAdmin andri@ranah.web.id
ServerName nama.ranah.web.id
allow from all
Options +Indexes
  DocumentRoot "/web/document/location" ServerAdmin andri@ranah.web.id ServerName namadomain.com allow from all Options +Indexes

After that, its just restart httpd, /etc/init.d/httpd restart and vhosts is ready to use.

Hopefully Helpful;-)

Could not connect: Lost connection to MySQL server at 'reading initial communication packet', system error: 111

Yup, it was informed that the above title which we access the MySQL server does not allow connections from outside. This is a classic problem experienced when an application with a separate database.

Way of overcoming it easy, just edit the mysql configuration (/etc/mysql/my.cnf), then reject (marked #) 2 configuration lines below:

skip-external-locking
bind-address = 127.0.0.1
 
become :
 
#skip-external-locking
#bind-address = 127.0.0.1

Restart mysql with this command :
 
# /etc/init.d/mysql restart

Hopefully Helpful ;-)

How To: Disable SELinux in Centos

SELinux or abbreviation of Security-Enhanced Linux is a security enhancement that regulate a variety of access control in our linux system. But sometimes there are some conditions where we do not want, such as ftp access become writeable, etc..

In CentOS 5.5 this SELinux enabled by default, to disable it, simply edit the configuration of SELinux which is located in: / etc / selinux / config to be like this:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
#SELINUX=enforcing
SELINUX=disabled
  # SELINUXTYPE= type of policy in use. Possible values are: # targeted - Only targeted network daemons are protected. # strict - Full SELinux protection. SELINUXTYPE=targeted

Next save and reboot your CentOS
Hopefully Helpful;-)