How to install rsync server on CentOS
Posted by
depratama
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

Wednesday, April 10, 2013 |
Website Using HTTPS Protocol
Posted by
depratama
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
Read More..
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.

Friday, March 08, 2013 |
Grep Log for Specific Date Range
Posted by
depratama
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 :
Read More..
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

Wednesday, March 06, 2013 |
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
Posted by
depratama
Labels:
linux,
Networking,
Troubleshooting
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
* 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
sudo nano /etc/apache2/httpd.conf
ServerName PratamaServer
sudo /etc/init.d/apache2 restart

Wednesday, July 11, 2012 |
Enable compression on Apache Centos/Fedora
Posted by
depratama
Labels:
linux,
Networking
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 compressionRead More..

Friday, June 08, 2012 |
Subscribe to:
Posts (Atom)

