feedburner
Enter your email address:

Delivered by FeedBurner

feedburner count

Import Mysql File Using Command LIne

Import mysql file using command line on Linux needs several steps. 

Step 1: Upload mysql file to server

You can use either ftp or scp to upload mysql file. 


Step 2: Login to server

 Login to server using ssh application. Example your website domain is pratama.us and username is demby. Type this command to login to your server. 

ssh demby@pratama.us

You can change demby to your username and pratama.us to your domain or ip address.

Step 3: Import Mysql File

To import your mysql file to database you can use command below:

mysql -u USERNAME -p -h HOSTNAME DATABASENAME < FILENAME

Example if your mysql USERNAME is demby,  HOSTNAME is localhost, DATABASENAME is dembydb and FILENAME is dembydb.sql, type this command to import.

mysql -u demby -p -h localhost dembydb < dembydb.sql

If you using ip address or domain as your hostname then your command become:

 mysql -u demby -p -h 118.1.1.1 dembydb < dembydb.sql
or

mysql -u demby -p -h demby.pratama.us dembydb < dembydb.sql

After that, you can check your database and browse the data. This article is to remind me how to import mysql file to database using command line. 

-- 
From Email
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 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