Skip to main content

Posts

How To Disable IPV6 in Ubuntu

I want to  disable  ipv6  in my Ubuntu Server. First, I open  /etc/sysctl.conf  using  text editor. $ sudo nano /etc/sysctl.conf Then I  insert these following lines at the end. net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1 After that, I save the file using Ctrl+O and exit from text editor using Ctrl+X. On terminal, I type this command  $ sudo sysctl -p I get result in terminal as, net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1 After that when I check, $ cat /proc/sys/net/ipv6/conf/all/disable_ipv6 I get result as, 1 From the result, I know my  ipv6 disabled  successfully.

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.s...

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 ...

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.

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

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

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

Enable compression on Apache Centos/Fedora

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 #DeflateFil...