feedburner
Enter your email address:

Delivered by FeedBurner

feedburner count

How to install rsync server on CentOS

These are steps to install rsync server. 

Install xinetd and rsync packages
#yum -y install xinetd rsync

Then make sure xinetd is running on levels 3, 4 and 5
#chkconfig --level 345 xinetd on

Modify rsync xinetd configuration. We shoud change disable = yes to disable = no

#vi /etc/xinetd.d/rsync

Next, create rsync secrets file for password with format of username:password
#vi /etc/rsyncd.secrets

Last create configuration for rsync shares
#vi /etc/rsyncd.conf

Fill this configuration
# rsyncd.conf
secrets file = /etc/rsyncd.secrets
motd file = /etc/rsyncd.motd
read only = yes
list = yes
uid = nobody
gid = nobody

[out]
comment = Interesting stuff from this server
path = /home/rsync/out

[confidential]
comment = FYI
path = /home/rsync/secret-out
auth users = demby,pratama
hosts allow = *.pratama.us
hosts deny = *
list = false 

Then save

After that, fix up permission and ownership file, and restart xinetd service
#chown root.root /etc/rsyncd.*
#chmod 600 /etc/rsyncd.*
#service xinetd restart

You can test it locally:

#telnet 127.0.0.1 873

You should check your server. If SELinux is running, you must disable it or you can let it run. But you have to change some variable. Use this command
#setsebool -P rsync_disable_trans 1
#service xinetd restart

Running the client:

On the remote machine:
# rsync -arv your-user-name@host-with-code-to-sync:/home/rsync/out ./

That's how to install rsync server on CentOS
Read More.. Digg ThisAdd To Del.icio.us Add To Reddit Fav This With Technorati Add To Yahoo MyWeb Add To Newsvine Add To Google Bookmarks Add To Bloglines Add To Ask Add To Windows Live Add To Slashdot Stumble This



Website Using HTTPS Protocol

Last week, I changed protocol of my website from http to https. There were steps that i had to do.

First, I installed openssl package and mod_ssl

# yum install mod_ssl openssl

Then, I configured the openssl  and created certificate

# cd /etc/pki/tls/certs

# make server.key
# openssl rsa -in server.key -out server.key
# make server.csr
# openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 3650
# chmod 400 server.*


After that, I changed configuration of httpd/apache 

#nano /etc/httpd/conf.d/ssl.conf

DocumentRoot "/var/www/html"

ServerName www.server.world:443
SSLCertificateFile /etc/pki/tls/certs/server.crt
SSLCertificateKeyFile /etc/pki/tls/certs/server.key

Last, I restarted the webserver

#service httpd restart

That's all what i did last week to change my website protocol from http to https.
Read More.. Digg ThisAdd To Del.icio.us Add To Reddit Fav This With Technorati Add To Yahoo MyWeb Add To Newsvine Add To Google Bookmarks Add To Bloglines Add To Ask Add To Windows Live Add To Slashdot Stumble This



Grep Log for Specific Date Range

We can use the grep command to search for a particular date range e.g. need to grep the data for specific date range. Example from 25 Maret to 27 Maret 2013, the command is :

grep -n "2[5-0]/Mar/2013" input_file

Or we can use regex if the months is difference

egrep  '2[0-5]/(April|May)/2008' logfile


Read More.. Digg ThisAdd To Del.icio.us Add To Reddit Fav This With Technorati Add To Yahoo MyWeb Add To Newsvine Add To Google Bookmarks Add To Bloglines Add To Ask Add To Windows Live Add To Slashdot Stumble This



How to fix Apache – "Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName" Error on Ubuntu

Labels: , ,

While restarting the Apache server on Ubuntu, I have this problem.

pratama@pratama:~$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2                                                apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
To fix that problem, I need to edit the httpd.conf file. Open the terminal and type,
sudo nano /etc/apache2/httpd.conf
By default httpd.conf file will be blank. Now, simply I add the following line to the file.
ServerName PratamaServer
Then I save the file (Ctrl+O) and exit (Ctrl+X) from nano. Finally restart the server.
sudo /etc/init.d/apache2 restart
Read More.. Digg ThisAdd To Del.icio.us Add To Reddit Fav This With Technorati Add To Yahoo MyWeb Add To Newsvine Add To Google Bookmarks Add To Bloglines Add To Ask Add To Windows Live Add To Slashdot Stumble This

Enable compression on Apache Centos/Fedora

Labels: ,

Make sure your mod_deflate is enable. Check file httpd.conf :
nano /etc/httpd/httpd.conf

Find this :
LoadModule deflate_module modules/mod_deflate.so

Create /etc/httpd/conf.d/deflate.conf with the following contents 

# Insert filter
SetOutputFilter DEFLATE

# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
BrowserMatch bMSIE !no-gzip !gzip-only-text/html

# Don't compress images
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary

# Don't compress already compressed stuff !
SetEnvIfNoCase Request_URI .(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .pdf$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary

# Log Stuff !
#DeflateFilterNote Input input_info
#DeflateFilterNote Output output_info
#DeflateFilterNote Ratio ratio_info
#LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)' deflate
# CustomLog /var/log/httpd/deflate_log deflate
Now, you have enable your compression
Read More.. Digg ThisAdd To Del.icio.us Add To Reddit Fav This With Technorati Add To Yahoo MyWeb Add To Newsvine Add To Google Bookmarks Add To Bloglines Add To Ask Add To Windows Live Add To Slashdot Stumble This