splash
Ardiansyah
A Father of four children, and wants to lead all of the family to reach the highest location in Jannah
Dari Ibnu Abbas ia berkata, "Dahulu aku pernah berada di belakang Rasulullah, lalu beliau bersabda: "Wahai anak kecil sesungguhnya aku ingin mengajarimu beberapa kalimat, jagalah Allah, maka pasti Allah menjagamu, jagalah Allah pasti kau akan dapati Allah dihadapanmu. Apabila engkau meminta maka mintalah kepada Allah dan jika engkau meminta pertolongan maka mintalah pertolongan kepada Allah. Ketahuilah, seandainya suatu umat berkumpul untuk memberikan manfaat kepadamu maka mereka tidak akan bisa memberi manfaat tersebut kecuali yang telah Allah takdirkan untukmu dan apabila mereka berkumpul untuk memadharatkanmu maka mereka tidak akan bisa memadharatkanmu kecuali dengan apa-apa yang Allah takdirkan atasmu, telah diangkat pena dan telah kering lembaran-lembaran(takdir)" (HR. Tirmidzi, hasan shohih)
 

You Are Viewing Online Note for System Administrator

How to Reset the MySQL Root Password on Unix Systems

Posted By BlogAdmin on March 3rd, 2014

On Unix, use the following procedure to reset the password for all MySQL root accounts. The instructions assume that you will start the server so that it runs using the Unix login account that you normally use for running the server. For example, if you run the server using the mysql login account, you should log in as mysql before using the instructions. Alternatively, you can log in as root, but in this case you must start mysqld with the –user=mysql option. If you start the server as root without using –user=mysql, the server may create root-owned files in the data directory, such as log files, and these may cause permission-related problems for future server startups. If that happens, you will need to either change the ownership of the files to mysql or remove them.

Log on to your system as the Unix user that the mysqld server runs as (for example, mysql).

Locate the .pid file that contains the server’s process ID. The exact location and name of this file depend on your distribution, host name, and configuration. Common locations are /var/lib/mysql/, /var/run/mysqld/, and /usr/local/mysql/data/. Generally, the file name has an extension of .pid and begins with either mysqld or your system’s host name.

You can stop the MySQL server by sending a normal kill (not kill -9) to the mysqld process, using the path name of the .pid file in the following command:

1 shell> kill `cat /mysql-data-directory/host_name.pid`

Use backticks (not forward quotation marks) with the cat command. These cause the output of cat to be substituted into the kill command.

Create a text file containing the following statements. Replace the password with the password that you want to use.

1 UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
2 FLUSH PRIVILEGES;

Write the UPDATE and FLUSH statements each on a single line. The UPDATE statement resets the password for all root accounts, and the FLUSH statement tells the server to reload the grant tables into memory so that it notices the password change.

Save the file. For this example, the file will be named /home/me/mysql-init. The file contains the password, so it should not be saved where it can be read by other users. If you are not logged in as mysql (the user the server runs as), make sure that the file has permissions that permit mysql to read it.

Start the MySQL server with the special –init-file option:

1 shell> mysqld_safe --init-file=/home/me/mysql-init &

The server executes the contents of the file named by the –init-file option at startup, changing each root account password.

After the server has started successfully, delete /home/me/mysql-init.

You should now be able to connect to the MySQL server as root using the new password. Stop the server and restart it normally.

Re-Post from http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html for Private Note

Just a Note : Reconfigure Exim4 MTA in Debian

Posted By BlogAdmin on March 3rd, 2014

Assalamu’alaykum warahmatullahi wabarakatuh,

When we install new Debian Linux System we need to configure how the MTA sends and receives email, the default Debian MTA is EXIM4, just run this command :

1 dpkg-reconfigure exim4-config

Then make the changes that needed

Happy Administer System

How to LSBize and init Script in Debian

Posted By BlogAdmin on March 3rd, 2014

Assalamu’alaykum warahmatullahi wabarakatuh,

When we want to add a script that run automatically at system start up, we need to add the script to rc.d at local machine with this command :

1 update-rc.d local defaults

where local is your own script that located in /etc/init.d

if you just type in your script DebianOS makes you to have an LSB Script, how to make a LSB Script ?
It was easy, just put this commands in your script,

1 ### BEGIN INIT INFO
2 # Provides:          scriptname
3 # Required-Start:    $remote_fs $syslog
4 # Required-Stop:     $remote_fs $syslog
5 # Default-Start:     2 3 4 5
6 # Default-Stop:      0 1 6
7 # Short-Description: Start daemon at boot time
8 # Description:       Enable service provided by daemon.
9 ### END INIT INFO

So Debian will accept your script and add it into your machine init script that run in your desire run level.
Happy Administer System !

How to List MySQL Users

Posted By ariandita on July 24th, 2013

Assalamu’alaykum warahmatullahi wabarakatuh,

When using MySQL as a backend database, sometimes we need to list the MySQL users to see whom have access to the database server, heres how :

Login to MySQL Database Command Line Interfaces
[sourcecode language=”bash”]
mysql -u mysql-user -p mysql-user-password
[/sourcecode]

Then run this command
[sourcecode language=”bash”]
select user from mysql.user ;
[/sourcecode]

Sometimes we need to know from which machine the user have access, so run this command
[sourcecode language=”bash”]
select host,user from mysql.user ;
[/sourcecode]

Here’s the example of the result
[sourcecode language=”bash”]
+—————-+——————+
| host | user |
+—————-+——————+
| 10.100.150.140 | wp-home-edu |
| 10.100.150.140 | wp-home-org |
| 10.100.150.142 | wp-home-tv |
| 10.100.150.145 | wp-home-sd |
| 127.0.0.1 | root |
| localhost | debian-sys-maint |
| localhost | root |
| walldb | root |
+—————-+——————+
[/sourcecode]

Happy Administer System !

Redirect Full Sub Domain to Another Domain

Posted By ariandita on July 3rd, 2013

In many case our Website redirect a full sub-domain to another sub-domain or maybe to another sub-domain in another domain, here’s how to redirect it by editting the apache2 configuration

[code language=”bash”]
<VirtualHost>
ServerName somechild.domain.com
Redirect permanent / http://morechild.anotherdomain.com
</VirtualHost>
[/code]

With those setting you’ve made a redirection to morechild.anotherdomain.com when there are requests to somechild.domain.com.

Happy Administer System……….

Backup and Restore MySQL Database

Posted By ariandita on December 20th, 2012

Hi there . . . .
As System Administrator we need to maintain Database Server, whether it’s open source or proprietary. I am using MySQL Server as database backend of WordPress, and one day a notification showed up, tell me that the newest WordPress had been released.
Wow it’s time to upgrade, but the notification also tell me to backup database and content first before upgrading, so I have to google to find out how to backup and restore a MySQL databse, I remembered that the last time I google I’ve found it in the most incredible blog about Linux, The CyberCiti, but I couldn’t find it now, I found the solution from thegeekstuff.com instead.

  1. How to backup
    Backup MySQL database can be done with two ways that I could find in thegeekstuff.com,

    • first with the mysqldump syntax
    • and the mysqlhotcopy syntax

    I choose to backup with mysqldump syntax, which is
    [code language=”bash”]
    mysqldump -u username -p username_password MySQL_database_name > dumpfilename.sql
    [/code]

  2. How to Restore
    to restore from dumpfile we can use this syntax
    [code language=”bash”]
    mysql -u username -p username_password MySQL_database_name < dumpfilename.sql
    [/code]

The backup progress sometime get failed with this notification

[code language=”bash”]
mysqldump: Got error: 1016: Can’t open file: ‘./databasename/tablename.frm’ (errno: 24) when using LOCK TABLES
[/code]

Use these additional parameter to the backup command
[code language=”bash”]
–skip-lock-tables
[/code]
or
[code language=”bash”]
–lock-tables=false
[/code]

That’s it, than I backed up the WordPress content with
[code language=”bash”]
tar -cvf
[/code]
OK than, I’ve upgraded the WordPress to the newest version, which is 3.5
Happy Administer System !

How to Remove Certain Email from Postfix Queue

Posted By ariandita on December 12th, 2012

As System Administrator sometimes we need to remove certain email from queue, first we have to know what items we want to remove, please use the mailq syntax, let’s try with MAILER-DAEMON items that we actually not need

[code language=”html”]
mailq | grep MAILER-DAEMON
[/code]

when the items is selected and confirmed, use this command to remove all selected items

[code language=”html”]
mailq | grep MAILER-DAEMON | awk ‘{print $1}’ | tr -d ‘*’ | postsuper -d –
[/code]
Happy Administering System

How to Connect to AdminServer when CS Admin Kit.msc is broken (Kaspersky Administration-Kit)

Posted By ariandita on October 15th, 2010

Bina Nusantara uses Kaspersky Total Space Security for workstation’s and file server’s security. The Kaspersky Administration Server named Admin-Kit Server have its build in administration console on top of Microsoft Management Console. The Administration Console have a saved .msc file named “CS Admin Kit.msc”. The Main Server of Binus have Windows 2003 Standard x64 Edition. A few days after upgrading from old Admin-Kit Server, the shortcut won’t work. Look at this :

the Technical Engineer from Optima told me to use mmc.exe that is present in ordinary Windows Installation can be used to open the msc file that came from the Kaspersky Admin-Kit.

How to open FTP Passive Mode and Restrict the port used by FTP Passive Mode on Windows 2003 Server

Posted By ariandita on October 12th, 2010

Default FTP mode in Windows Server 2003 is active mode, it is more simple than FTP passive mode, but when load of the FTP is high we need FTP Passive mode to increase speed of the file transfer. Any mode of FTP will make no problem when we do not activate the built in firewall of Windows Server 2003. If we have to activate the firewall in FTP Active mode we just have to open single port, it is port 21, but if we decide to use FTP passive mode we have to open 10 – 50 dedicated port to server the FTP connection. Opening so many port in Windows Server 2003’s firewall will make us tired and bored, because to open a single port in Windows we need two clicks and several types.

Test Image :

[IMG]http://i259.photobucket.com/albums/hh287/ariandita/File-Location.jpg[/IMG]

How to add binus.edu account to your Blackberry Internet Service

Posted By ariandita on June 28th, 2010

The last Friday is like a nightmare for Binus Datacenter. Our Microsoft Exchange 2007 Client Access Server is dead. The Volume that contains Windows 2003 Operating System is corrupt. Fortunately we have another server that can be promoted to become a Client Access Server. Almost two days we tried to recovered the dying server. And we’ve done it on Saturday. Now we have all system ready but another problem occurred. Everyone that have a Blackberry and connect to our mail system via Blackberry Internet Service report that they don’t receive email for the past three days.

Although Data Center Staff do not have any Blackberry Device we try to get one to try the BIS setting. The problem solved when we erased the old account and created new one.

Please provide these data on the Provider’s Web Email Setting, open your Blackberry Web Browser and open this site

for Telkomsel : http://telkomsel.blackberry.com/
for Indosat : http://indosat.blackberry.com
for XL : http://www.xl.blackberry.com
for 3 : http://tri.blackberry.com/
for Axis : http://axis.blackberry.com/

Please provide this data in the next page

1. Email address : blablabla@binus.edu

2. Your password : “Binus1234”  ( Binus default password )

and click Next

your Blackberry Device will say

The email address or password is incorrect, or we need more detail

Retype the information or provide additonal settings.

Please select the Provide Additional Setting

1. Select Microsoft Outlook WebAccess

2. Provide the Outlook Web Access address for Binus : https://mail.binus.edu/owa

3. Login Name : binus/blablabla

4. Mailbox Name : blablabla

Klik Next

Your Blackberry should accept your configuration.