My Collection'S

Selamat Datang

Subscribe to RSS feed

Basic MySQL Configuration

(c) Peter Harrison, www.linuxhomenetworking.com

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

Most home/SOHO administrators don't do any database programming, but they sometimes need to install applications that require a MySQL database. This chapter explains the basic steps of configuring MySQL for use with a MySQL-based application in which the application runs on the same server as the database.

Preparing MySQL For Applications

In most cases the developers of database applications expect the systems administrator to be able to independently prepare a database for their applications to use. The steps to do this include:

1. Install and start MySQL.

2. Create a MySQL "root" user.

3. Create a regular MySQL user that the application will use to access the
database.

4. Create your application's database.

5. Create your database's data tables.

6. Perform some basic tests of your database structure.

The rest of the chapter is based on a scenario in which a Linux-based application named sales-test needs to be installed. After reading the sales-test manuals, you realize that you have to create a MySQL database, data tables, and a database user before you can start the application. Fortunately sales-test comes with a script to create the tables, but you have to do the rest yourself. Finally, as part of the planning for the installation, you decided to name the database salesdata and let the application use the MySQL user mysqluser to access it.

I'll cover all these common tasks in detail in the remaining sections.

Installing MySQL

In most cases you'll probably want to install the MySQL server and MySQL client RPMs. The client RPM gives you the ability to test the server connection and can be used by any MySQL application to communicate with the server, even if the server software is running on the same Linux box.

You need to make sure that the mysql-server and mysql software RPMs is installed. When searching for the RPMs, remember that the filename usually starts with the software package name followed by a version number, as in mysql-server-3.23.58-4.i386.rpm.

There are a number of supporting RPMs that may be needed, so the yum utility may be the best RPM installation method to use. (For more on downloading and installing RPMs, see Chapter 6, "Installing RPM Software.").

Starting MySQL

You have to start the MySQL process before you can create your databases. To configure MySQL to start at boot time, use the chkconfig command:

[root@bigboy tmp]# chkconfig mysqld on

You can start, stop, and restart MySQL after boot time using the service commands.

[root@bigboy tmp]# service mysqld start

[root@bigboy tmp]# service mysqld stop

[root@bigboy tmp]# service mysqld restart



Remember to restart the mysqld process every time you make a change to the configuration file for the changes to take effect on the running process.

You can test whether the mysqld process is running with



[root@bigboy tmp]# pgrep mysqld



You should get a response of plain old process ID numbers.

The /etc/my.cnf File

The /etc/my.cnf file is the main MySQL configuration file. It sets the default MySQL database location and other parameters. The typical home/SOHO user won't need to edit this file at all.

The Location of MySQL Databases

According to the /etc/my.cnf file, MySQL databases are usually located in a subdirectory of the /var/lib/mysql/ directory. If you create a database named test, then the database files will be located in the directory /var/lib/mysql/test.

Creating a MySQL "root" Account

MySQL stores all its username and password data in a special database named mysql. You can add users to this database and specify the databases to which they will have access with the grant command. The MySQL root or superuser account, which is used to create and delete databases, is the exception. You need to use the mysqladmin command to set your root password. Only two steps are necessary for a brand new MySQL installation.



1. Make sure MySQL is started.

1. Use the mysqladmin command to set the MySQL root password. The syntax is as
follows:



[root@tmp bigboy]# mysqladmin -u root password new-password



If you want to change your password later, you will probably have to do a root password recovery.

Accessing The MySQL Command Line

MySQL has its own command line interpreter (CLI). You need to know how to access it to do very basic administration.

You can access the MySQL CLI using the mysql command followed by the -u option for the username and -p, which tells MySQL to prompt for a password. Here user root gains access:



[root@bigboy tmp]# mysql -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 14 to server version: 3.23.58



Type 'help;' or '\h' for help. Type '\c' to clear the buffer.



mysql>



Note: Almost all MySQL CLI commands need to end with a semi-colon. Even the exit command used to get back to the Linux prompt needs one too!

Creating and Deleting MySQL Databases

Many Linux applications that use MySQL databases require you to create the database beforehand using the name of your choice. The procedure is relatively simple: Enter the MySQL CLI, and use the create database command:



mysql> create database salesdata;

Query OK, 1 row affected (0.00 sec)



mysql>



If you make a mistake during the installation process and need to delete the database, use the drop database command. The example deletes the newly created database named salesdata.



mysql> drop database salesdata;

Query OK, 0 rows affected (0.00 sec)



mysql>



Note: Sometimes a dropped database may still appear listed when you use the show databases command explained further below. This may happen even if your root user has been granted full privileges to the database, and it is usually caused by the presence of residual database files in your database directory. In such a case you may have to physically delete the database sub-directory in /var/lib/mysql from the Linux command line. Make sure you stop MySQL before you do this.



[root@bigboy tmp]# service mysqld stop


Granting Privileges to Users

On many occasions you will not only have to create a database, but also have to create a MySQL username and password with privileges to access the database. It is not a good idea to use the root account to do this because of its universal privileges.

MySQL stores all its username and password data in a special database named mysql. You can add users to this database and specify the databases to which they will have access with the grant command, which has the syntax.



sql> grant all privileges on database.* to username@"servername" identified by 'password';


So you can create a user named mysqluser with a password of pinksl1p to have full access to the database named salesdata on the local server (localhost) with the grant command. If the database application's client resides on another server, then you'll want to replace the localhost address with the actual IP address of that client.


sql> grant all privileges on salesdata.* to mysqluser@"localhost" identified by 'pinksl1p';


The next step is to write the privilege changes to the mysql.sql database using the flush privileges command.


sql> flush privileges;


Running MySQL Scripts To Create Data Tables

Another common feature of prepackaged applications written in MySQL is that they may require you to not only create the database, but also to create the tables of data inside them as part of the setup procedure. Fortunately, many of these applications come with scripts you can use to create the data tables automatically.

Usually you have to run the script by logging into MySQL as the MySQL root user and automatically importing all the script file's commands with a < on the command line.

The example runs a script named create_mysql.script whose commands are applied to the newly created database named salesdata. MySQL prompts for the MySQL root password before completing the transaction. (You have to create the database first, before you can run this command successfully.)


[root@bigboy tmp]# mysql -u root -p salesdata < create_mysql.script

Enter password:

[root@bigboy tmp]#


Viewing Your New MySQL Databases

A number of commands can provide information about your newly created database. Here are some examples:

> Login As The Database User: It is best to do all your database testing as the MySQL user you want the application to eventually use. This will make your testing mimic the actions of the application and results in better testing in a more production-like environment than using the root account.


[root@bigboy tmp]# mysql -u mysqluser -p salesdata


> List all your MySQL databases: The show databases command gives you a list of all your available MySQL databases. In the example, you can see that the salesdata database has been successfully created:


mysql> show databases;

+-----------+

| Database |

+-----------+

| salesdata |

+-----------+

1 row in set (0.00 sec)



mysql>



Listing The Data Tables In Your MySQL Database

The show tables command gives you a list of all the tables in your MySQL database, but you have to use the use command first to tell MySQL to which database it should apply the show tables command.

The example uses the salesdata database; notice that it has a table named test.


mysql> use salesdata;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A



Database changed

mysql> show tables;

+---------------------+

| Tables_in_salesdata |

+---------------------+

| test |

+---------------------+

1 row in set (0.00 sec)



mysql>



Viewing Your MySQL Database's Table Structure

The describe command gives you a list of all the data fields used in your database table. In the example, you can see that the table named test in the salesdata database keeps track of four fields: name, description, num, and date_modified.



mysql> describe test;

+---------------+--------------+------+-----+------------+----------------+

| Field | Type | Null | Key | Default | Extra |

+---------------+--------------+------+-----+------------+----------------+

| num | int(11) | | PRI | NULL | auto_increment |

| date_modified | date | | MUL | 0000-00-00 | |
| name | varchar(50) | | MUL | | |

| description | varchar(75) | YES | | NULL | |

+---------------+--------------+------+-----+------------+----------------+

6 rows in set (0.00 sec)



mysql>



Viewing The Contents Of A Table

You can view all the data contained in the table named test by using the select command. In this example you want to see all the data contained in the very first row in the table.



mysql> select * from test limit 1;



With a brand new database this will give a blank listing, but once the application starts and you enter data, you may want to run this command again as a rudimentary database sanity check.



Configuring Your Application

After creating and testing the database, you need to inform your application of the database name, the IP address of the database client server, and the username and password of the application's special MySQL user that will be accessing the data.

Frequently this registration process is done by the editing of a special application-specific configuration file either via a Web GUI or from the command line. Read your application's installation guide for details.

You should always remember that MySQL is just a database that your application will use to store information. The application may be written in a variety of languages with Perl and PHP being the most popular. The base PHP and Perl RPMs are installed with Fedora Linux by default, but the packages used by these languages to talk to MySQL are not. You should also ensure that you install the RPMs listed in Table 34.1 on your MySQL clients to ensure compatibility. Use the yum utility discussed in Chapter 6, "Installing Linux Software", if you are uncertain of the prerequisite RPMs needed.

Table 34.1 Required PHP and Perl RPMs for MySQL Support

RPM
Description

php-mysql
MySQL database specific support for PHP

perl-DBI
Provides a generic Perl interface for interacting with relational databases

perl-DBD-MySQL
MySQL database specific support for Perl



Recovering / Changing Your MySQL Root Password

Sometimes you may have to recover the MySQL root password because it was either forgotten or misplaced. The steps you need are:



1. Stop MySQL



[root@bigboy tmp]# service mysqld stop

Stopping MySQL: [ OK ]

[root@bigboy tmp]#


2. Start MySQL in Safe mode with the safe_mysqld command and tell it not to read the grant tables with all the MySQL database passwords.


[root@bigboy tmp]# safe_mysqld --skip-grant-tables &

[1] 4815

[root@bigboy tmp]# Starting mysqld daemon with databases from /var/lib/mysql

[root@bigboy tmp]#



3. Use the mysqladmin command to reset the root password. In this case, you are setting it to ack33nsaltf1sh.



[root@bigboy tmp]# mysqladmin -u root flush-privileges \

password "ack33nsaltf1sh"

[root@bigboy tmp]#



4. Restart MySQL normally.



[root@bigboy tmp]# service mysqld restart

Stopping MySQL: 040517 09:39:38 mysqld ended [ OK ]

Starting MySQL: [ OK ]

[1]+ Done safe_mysqld --skip-grant-tables

[root@bigboy tmp]#



The MySQL root user will now be able to manage MySQL using this new password.

MySQL Database Backup

The syntax for backing up a MySQL database is as follows:



mysqldump --add-drop-table -u [username] -p[password] [database] > [backup_file]



In the previous section, you gave user mysqluser full access to the salesdata database when mysqluser used the password pinksl1p. You can now back up this database to a single file called /tmp/salesdata-backup.sql with the command



[root@bigboy tmp]# mysqldump --add-drop-table -u mysqluser \

-ppinksl1p salesdata > /tmp/salesdata-backup.sql



Make sure there are no spaces between the -p switch and the password or else you may get syntax errors.

Note: Always backup the database named mysql too, because it contains all the database user access information.

MySQL Database Restoration

The syntax for restoring a MySQL database is:



mysql -u [username] -p[password] [database] < [backup_file]



So, using the previous example, you can restore the contents of the database with



[root@bigboy tmp]# mysql -u mysqluser -ppinksl1p salesdata \

< /tmp/salesdata-backup.sql



Note: You may have to restore the database named mysql also, because it contains all the database user access information.

MySQL Table Backup and Restoration

Sometimes you may want to backup only one or more tables from a database. There are some practical reasons for wanting to do this. You may have a message board / forums application that uses MySQL to store its data and you want to create a brand new forum with the same users as the old one so that the users don't have to register all over again.

The MySQL SELECT statement can be used to export the data to a backup file and the LOAD command can be used to import the data back into the new database used by the new forum. In this example the data in the phpbb_users and phpbb_themes tables of the forums-db-old database are exported to files named /tmp/forums-db-users.sql and /tmp/forums-db-themes.sql respectively. The data is then imported into tables of the same name in the forums-db-new database.



mysql> use forums-db-old;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A



Database changed

mysql> SELECT * INTO OUTFILE '/tmp/forums-db-users.sql' FROM phpbb_users;

Query OK, 1042 rows affected (0.03 sec)



mysql> SELECT * INTO OUTFILE '/tmp/forums-db-themes.sql' FROM phpbb_themes;

Query OK, 1038 rows affected (0.03 sec)



mysql> use forums-db-new;

Database changed

mysql> load data infile '/tmp/forums-db-users.sql' replace into table forums-db.phpbb_users ;

Query OK, 1042 rows affected (0.06 sec)

Records: 1042 Deleted: 0 Skipped: 0 Warnings: 0



mysql> load data infile '/tmp/forums-db-themes.sql' replace into table forums-db.phpbb_themes ;

Query OK, 1038 rows affected (0.04 sec)

Records: 1038 Deleted: 0 Skipped: 0 Warnings: 0



mysql>



As you can see, the syntax is fairly easy to understand. The REPLACE directive will overwrite any previously existing records with the same unique, or primary, key in the source and destination tables. The IGNORE directive will only insert records where the primary keys are different.

Very Basic MySQL Network Security

By default MySQL listens on all your interfaces for database queries from remote MySQL clients. You can see this using netstat -an. Your server will be seen to be listening on IP address 0.0.0.0 (all) on TCP port 3306.





[root@bigboy tmp]# netstat -an

Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address Foreign Address State

...

...

tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN

...

...

[root@bigboy tmp]#



The problem with this is that it exposes your database to MySQL queries from the Internet. If your SQL database is going to be accessed only by applications running on the server itself, then you can force it to listen only to the equivalent of its loopback interface. Here's how.



5. Edit the /etc/my.cnf file and use the bind-address directive in the [mysqld] section to define the specific IP address on which MySQL listens for connections.



[mysqld]

bind-address=127.0.0.1





6. Restart MySQL. The netstat -an command will show MySQL listening on only the loopback address on TCP port 3306, and your application should continue to work as expected.

Basic MyQL Troubleshooting

You can confirm whether your MySQL installation has succeeded by performing these few simple steps.

Connectivity Testing

In the example scenario, network connectivity between the database and the application will not be an issue because they are running on the same server.

In cases where they are not, you have to use the troubleshooting techniques in Chapter 4, "Simple Network Troubleshooting," to test both basic connectivity and access on the MySQL TCP port of 3306.

Test Database Access

The steps outlined earlier are a good test of database access. If the application fails, then retrace your steps to create the database and register the database information into the application. MySQL errors are logged automatically in the /var/log/mysqld.log file; investigate this file at the first sign of trouble.

Sometimes MySQL will fail to start because the host table in the mysql database wasn't created during the installation, this can be rectified by running the mysql_install_db command.

[root@bigboy tmp]# service mysqld start

Timeout error occurred trying to start MySQL Daemon.

Starting MySQL: [FAILED]

[root@bigboy tmp]# tail /var/log/mysql.log

...

...

050215 19:00:33 mysqld started

050215 19:00:33 /usr/libexec/mysqld: Table 'mysql.host' doesn't exist

050215 19:00:33 mysqld ended

...

...

[root@bigboy tmp]# mysql_install_db

...

...

[root@bigboy tmp]# service mysqld start

Starting MySQL: [ OK ]

[root@bigboy tmp]#



A Common Fedora Core 1 MySQL Startup Error

You may notice that you can start MySQL correctly only once under Fedora Core 1. All subsequent attempts result in the message "Timeout error occurred trying to start MySQL Daemon.".



[root@bigboy tmp]# /etc/init.d/mysqld start

Timeout error occurred trying to start MySQL Daemon.

Starting MySQL: [FAILED]

[root@bigboy tmp]#



This is caused by the MySQL startup script incorrectly attempting to do a TCP port ping to contact the server. The solution is:



1. Edit the script /etc/rc.d/init.d/mysqld.

2. Search for the two mysqladmin lines with the word ping in them and insert the string "-u $RANDOM" before the word "ping":



if [ -n "`/usr/bin/mysqladmin -u $RANDOM ping 2> /dev/null`" ]; then

if !([ -n "`/usr/bin/mysqladmin -u $RANDOM ping 2> /dev/null`" ]); then



3. Restart MySQL.



After doing this MySQL should function correctly even after a reboot.

Conclusion

MySQL has become one of the most popular Linux databases on the market and it continues to improve each day. If you have a large project that requires the installation of a database, then I suggest seeking the services of a database administrator (DBA) to help install and fine-tune the operation of MySQL. I also suggest, no matter the size of the project, that you practice an application installation on a test Linux system to be safe. It doesn't necessarily have to be the same application. You can find free MySQL-based applications using a Web search engine, and you can use these to be come familiar with the steps outlined in this chapter before beginning your larger project.

How To Install Opera Browser in Ubuntu

The Howto is moved to the Ubuntu Wiki, and is updated to a newer version of Opera.

https://wiki.ubuntu.com/OperaBrowser
Feel free to comment it here.

This is the install instructions for the Opera Internet Suite (Web browser +++)

This installs Opera, adds a menu icon and changes the default file handler from kexec to
gnome-open.

Please give feedback if you have any tricks to make Opera integrate better with the Ubuntu desktop.

------------------------------------------------------------------------------------------

1. wget
ftp://ftp.sunet.se/pub/www/clients/O...qt_en_i386.deb
2. sudo dpkg -i opera-static_8.02-20050727.1-qt_en_i386.deb
3. sudo gedit /usr/share/applications/opera.desktop
4. Insert the following lines into the file:

Code:

[Desktop Entry] Encoding=UTF-8 Name=Opera Web Browser GenericName=Web Browser Comment=Surf the Internet in a safer, faster, and easier way Exec=opera %u Terminal=false MultipleArgs=true Type=Application Icon=/usr/X11R6/include/X11/bitmaps/opera.xpm Categories=Application;Network MimeType=text/html;image/gif;image/jpeg;image/png


5. Save the edited file.
6. mkdir ~/.opera
7. gedit ~/.opera/filehandler.ini
8. Insert the following lines into the file:

Code:

Opera Preferences version 2.0 ; Do not edit this file while Opera is running ; This file is stored in UTF-8 encoding [Settings] Default File Handler=gnome-open exec,1 Default Directory Handler=gnome-open exec,1


9. Save the edited file.
10. Open Opera with Application -> Internet -> Opera Web Browser


To set Opera as the system default browser and mailreader. Follow this steps:
1. Go to System | Preferences | Preferred Applications
2. Under the Web Browser tab select "Custom" and, in the Command box, enter:

Code:

opera -newpage "%s"


3. Under the Mail Reader tab select "Custom" and, in the Command box, enter:

Code:

opera -newmail "%s"

----------------------------------------------------------------------------------------
http://ubuntuforums.org/showthread.php?t=40467

RUU PORNOGRAFI & FORNOAKSI

LAMPIRAN
Ketentuan Pidana menyangkut Pornoaksi

Tindak Pidana
Ancaman Hukuman

Denda

01. Mempertontonkan alat kelamin
1-5 tahun
Rp 50 juta--Rp 250 juta
02. Mempertontonkan pantat di depan umum
2-6 tahun
Rp 100 juta--Rp 300 juta
03. Mempertontonkan payudara di depan umum
1-5 tahun
Rp 50 juta--Rp 250 juta
04. Sengaja telanjang di depan umum
2-6 tahun
Rp 100 juta—Rp 300 juta
05. Berciuman bibir di depan umum
1-5 tahun
Rp 50 juta--Rp 250 juta
06. Menari erotis atau bergoyang-goyang erotis di muka umum
2-10 tahun
Rp 100 juta—Rp 500 juta
07. Melakukan masturbasi dan onani di depan umum
2-10 tahun
Rp 100 juta—Rp 500 juta
08. Melakukan gerakan tubuh yang menyerupai kegiatan masturbasi atau onani di depan umum
1-5 tahun
Rp 50 juta--Rp 250 juta
09. Melakukan hubungan seks di depan umum
2-10 tahun
Rp 100 juta—Rp 500 juta
10. Melakukan hubungan seks dengan anak-anak
3-10 tahun
Rp 100 juta—Rp 1 Milyar
11. Melakukan gerakan tubuh menyerupai kegiatan hubungan seks di muka umum
1-5 tahun
Rp 50 juta--Rp 250 juta
12. Menyelenggarakan acara pertunjukan seks
3-10 tahun
Rp 100 juta—Rp 1 Milyar
13. Menyelenggarakan pesta seks
0,5-1 tahun
Rp 25 juta—Rp 100 juta
14. Menonton acara pertunjukan seks
0,5-2 tahun
Rp 25 juta—Rp 100 juta
15. Menyediakan dana atau tempat untuk melakukan kegiatan pornoaksi
1-5 tahun
Rp 50 juta—Rp 250 juta

Sumber: RUU APP (Kompas, halaman 57, Sabtu, 4 Maret 2006)
-------------------------------------------------------------------------
Untung gak ada yang melarang Onani di kamar mandi yah kekekek .
kalo gak bisa kacauu neh dunia persilatan hehheh (just Kidding ...!!!) hmmmmm

Script Hiding Banner 100webspace

<script>
/* function LaHap_BaNNeR(OpoAe as Object)
// This BaJiLah scripting is one of "n" methods on HIDing the phucked BANNER from:
// http://www.100webspace.com/signup.html (freeprohost, goldeye, freeunixhost, etc.)
//
// USAGE: just put this script at the TOP of your each pages on the Hosting.
//
NiCK_n4m3 = "UNiQUE aka BNM";
R34L_n4m3 = "B***s N*r M*h*mm*d";
ReALm = "Nuker de UNiX un WinDowZ BoxEs";
NaTiVE = "C,BAS,PAS,PHP,JAVA"; */
google_ads = "UNiQUE's Shoutz: Shollaloohu 'Alaa Muhammad!! Alloohumma Sholli Wasallim Wa Baarik 'Alaih..."; /*
if (!banner.ilang)
{
Minggato_BANNER(True);
Clean_Up_Pages(this.fucked.page.berbanner);
document.write "Terima kasih kepada Pihak Hosting yang ikhlas memberikan sgl serpisnyah! smile";
*/{
}
</script>
-------------- /cut here --------------

Contoh penggunaan:
Misalnya isi salah satu halaman web anda sbb:

-----------.. cut here ----------- <html>
<head>
.:: Alumni Telsa Community ::.
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<meta name='description' content='Webportal alumni angkatan pertama
smk telekomunikasi tunas harapan kab. semarang'>
<meta name='keywords' content='telsa, hendra, smk tth, tunas, harapan, alumnitelsa, alumnitelsa.it.tc'>
<link rel='stylesheet' href='fusion_themes/Lucidity/styles.css' type='text/css'>
<script type='text/javascript' src='fusion_includes/fusion_script.js'></script>
</head>
<body bgcolor='#F1F1F1' text='#000000'>
dst.
-----------.. /cut here -----------

maka tambahin script menjadi:

-----------.. cut here -----------
<script> /*
function LaHap_BaNNeR(OpoAe as Object)
// This BaJiLah scripting is one of "n" methods on HIDing the phucked BANER from:
// http://www.100webspace.com/signup.html (freeprohost, goldeye, freeunixhost, etc.)
//
// USAGE: just put this script at the TOP of your each pages on the Hosting.
//
NiCK_n4m3 = "UNiQUE aka BNM";
R34L_n4m3 = "B***s N*r M*h*mm*d";
ReALm = "Nuker de UNiX un WinDowZ BoxEs";
NaTiVE = "C,BAS,PAS,PHP,JAVA"; */
google_ads = "UNiQUE's Shoutz: Shollaloohu 'Alaa Muhammad!! Alloohumma Sholli Wasallim Wa Baarik 'Alaih..."; /*
if (!banner.ilang)
{
Minggato_BANNER(True);
Clean_Up_Pages(this.fucked.page.berbanner);
document.write "Terima kasih kepada Pihak Hosting yang ikhlas memberikan sgl serpisnyah! smile"; */{
}
</script>

<html>
<head>
.:: Alumni Telsa Community ::.
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<meta name='description' content='Webportal alumni angkatan pertama smk telekomunikasi tunas harapan kab. semarang'>
<meta name='keywords' content='telsa, hendra, smk tth, tunas, harapan, alumnitelsa, alumnitelsa.it.tc'>
<link rel='stylesheet' href='fusion_themes/Lucidity/styles.css' type='text/css'>
<script type='text/javascript' src='fusion_includes/fusion_script.js'></script>
</head>
<body bgcolor='#F1F1F1' text='#000000'>
dst.

-----------.. /cut here -----------
Di colong Dari Jasakom

How To Fix Vidoe Resolution

Introduction

This Howto is intended for those who have installed or upgraded to Hoary, and their screen resolution is very low. A possible reason for this is that your hardware (video adapter/monitor) may not have been detected properly. There are several fixes that I have seen in the forum and in the IRC support channel. One solution will work for one person and another solution will work for someone else. I hope to provide several different solutions here, ranked in decending order from what I have seen to be the most popular and successful solution to those solutions that have helped only a few. This way, hopefully it will provide an answer for everyone. Let's start with the most popular fix.
Run the Autodetect Script Again

I'm not sure that this is the solution that works for the most people actually, but it most certainly is the quickest and easiest one. All we're doing is running the same script that tried to detect your video hardware when you initially installed. Sometimes this does help. Run the following command.

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.custom
sudo sh -c 'md5sum /etc/X11/xorg.conf > /var/lib/xfree86/xorg.conf.md5sum'
sudo dpkg-reconfigure xserver-xorg

After completion, close any open windows or programs you have running on your desktop and press CTRL-ALT-Backspace to restart X. You will be asked to log into your GNOME session again and hopefully everything will be fixed. If not, try the next solution.
Undetected Monitor Specs

Open the file /etc/X11/xorg.conf in your favourite text editor. I'll assume you are using nano for an editor as it is fairly straight forward.

sudo nano /etc/X11/xorg.conf

Now look for a section in that file called Section "Monitor". Once you find this section, look at the lines of text between Section "Monitor" and EndSection. There should be two lines in there that begin with the words HorizSync and VertRefresh. If those lines don't appear there then don't worry. There is a good chance that we've found the problem already!

You will need to gather two bits of information for your monitor now, either from your User's Manual, the command line, or from online. We need the horizontal sync frequency (usually measured in kHz) and the vertical refresh rate (usually in Hz). Finding these values usually just involves searching [WWW] Google with the model of your monitor. Both of these values are typically given in a range such as "30-98 kHZ" or "50-160 Hz". Write those values down, or otherwise keep them handy. Additionally, if your monitor supports it, you can just run the following command:

sudo ddcprobe grep monitorrange

The first two values returned are your HorizSync rates, the second pair is your VertRefresh values.

There are two ways to enter your monitor information into the file. One way is to run the following commands which will regenerate the file and ask you for the values in the process.

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.custom
sudo sh -c 'md5sum /etc/X11/xorg.conf > /var/lib/xfree86/xorg.conf.md5sum'
sudo dpkg-reconfigure -plow xserver-xorg

The second way is to simply add those values to our /etc/X11/xorg.conf file with a text editor. But first, lets make a backup of that file just in case an error is made.

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup

Editing this file so that it works involves adding two extra lines to the Section "Monitor" section of that file. For example, mine is shown below.

NOTE: Don't change anything that is written in the file for now. Just add the two lines. The snippet from my file is just an example and may not apply to your hardware.

Section "Monitor"
Identifier "FLATRON 995F"
Option "DPMS"
HorizSync 30-96
VertRefresh 50-160
EndSection

Now save the file, close all open applications, and press CTRL-ALT-Backspace to restart X. Assuming all goes well, you will be prompted to log into your session again.

NOTE: - If you are using XFree86 then you needed to edit /etc/X11/XF86Config-4. Also if you have an issue where only 800x600 is available in the dropdown for screen resolution, then modifying the Modes line within the section in that file called Section "Monitor" and adding the required resolution could solve this.

SubSection "Display"
Depth 24
Modes "1024x768" "800x600" "640x480"
EndSubSection

Resolution is not delivered by the vBios

This problem appears sometimes for laptops with "non-standard"-screen resolution in combination with certain Intel graphic-chips. Background: It seems like the Video Bios (vBios) has to deliver the right resolution for the lcd-screen to enable the autoconfiguration to set this resolution. However sometimes the right resolution is not delivered and consequently the right resolution can not be implemented. You can fix the problem by overwriting the vBios setting in the RAM by using a program called 855resolution.

Here is the description of the 855resolution-developer: "855resolution is a software to change the resolution of an available vbios mode for the 855 / 865 / 915 Intel graphic chipset" To install 855-resolution on Ubuntu 5.10 make sure that you have includet the "universe" repository and type:

sudo apt-get install 855resolution

Once the program is installed you can use the program to list all available vBios modes:

sudo 855resolution -l

The result should look similar to:

855resolution version 0.4, by Alain Poirier

Chipset: Unknown (id=0x25908086)
VBIOS type: 2
VBIOS Version: 3412

Mode 30 : 640x480, 8 bits/pixel
Mode 32 : 800x600, 8 bits/pixel
Mode 34 : 1024x768, 8 bits/pixel
Mode 38 : 1280x1024, 8 bits/pixel
Mode 3a : 1600x1200, 8 bits/pixel
Mode 3c : 1400x1050, 8 bits/pixel
Mode 41 : 640x480, 16 bits/pixel
Mode 43 : 800x600, 16 bits/pixel
Mode 45 : 1024x768, 16 bits/pixel
Mode 49 : 1280x1024, 16 bits/pixel
Mode 4b : 1600x1200, 16 bits/pixel
Mode 4d : 1400x1050, 16 bits/pixel
Mode 50 : 640x480, 32 bits/pixel
Mode 52 : 800x600, 32 bits/pixel
Mode 54 : 1024x768, 32 bits/pixel
Mode 58 : 1280x1024, 32 bits/pixel
Mode 5a : 1600x1200, 32 bits/pixel
Mode 5c : 1400x1050, 32 bits/pixel

If the resolution of your sceen is not present then you can permanently overwrite a unused mode by the value of you screen. For example if you want to overwrite the mode 41 by the resolution 2400x1600 edit the the file /etc/default/855resolution

sudo gedit /etc/default/855resolution

Your file should look similar to:

}
#
# 855resolution default
#
# find free modes by /usr/sbin/855resolution -l
# and set it to MODE
#
MODE=41
#
# and set resolutions for the mode.
XRESO=2400
YRESO=1600

This will ensure that the vBios mode 41 is overwritten in the RAM at boot-time, before initializing the X-windows. Since the resolution is now available in the vBios your system should automatically be able to set the right resolution after rebooting.
Incorrect DefaultDepth

Sometimes the automatic X configuration sets the colour depth to a value higher than some hardware can properly handle. To see if this is the case for you, first backup your /etc/X11/xorg.conf file.

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup

Now open the file in your favourite text editor. I'll assume you'll use nano for now since it is relatively simple to use, but you can use whatever text editor you like.

sudo nano /etc/X11/xorg.conf

Search for the word DefaultDepth (notice it is one word) in that file. The default colour depth set by Hoary is typically "24", but as mentioned, some hardware may not be able to use a value that high. It's pretty safe to change it to something like "16" just to test whether it solves your video problems or not. If this change does not solve anything, it is just as simple to change it back the way it was.

Once the value of DefaultDepth is changed, save the file, close all open windows on your desktop, and press CTRL-ALT-Backspace to restart X. Assuming all goes well, you will be prompted to log into GNOME again, hopefully at a higher resolution.
GDM looks right, but Gnome looks wrong

This problem occured on a vanilla installation of 5.10 that -- somewhat unnaturally -- was running under VirtualPC. Because this was not a normal device, I set the device to VESA and the resolution to 1024x768 in the configuration manager by:

sudo dpkg-reconfigure xserver-xorg

Naturally, make sure you configure these settings properly for your hardware.

These settings allowed GDM to present a normal login screen. However, completely login caused the display to fail.

Fix this by running the gconf-editor tool as a normal user and altering the screen settings within Gnome's XML configuration registry to equal the /etc/X11/xorg.conf settings:

startx gconf-editor

Browse the editor to /desktop/gnome/screen/default/%d where %d will probably be 0. Select this node and change the resolution to your resolution of choice, and make sure rate is something functional for your display device as well.

Exit the editor, and try logging in through GDM again.
The End

So far, this is all of the possible solutions I've collected for this problem. If none of the above corrected your situation, consider posting your question in the [WWW] Ubuntu Support Forum or in the #ubuntu IRC support channel on the irc.freenode.net network.

Meningkatkan Security di Linux Box

Bingun Mau ngedit Port ssh . !!
sambil main main di goolge akhrinya aku temukan tulisan sesorang di arsif nya pak google
ini dia tulisannya semoga membantu yang ingin tau smile
====================================================================

ECHO-ZINE RELEASE 07
Author: \conan\ aka sugar_free || sugar_free@telkom.net
Online @ www.echo.or.id :: http://ezine.echo.or.id
-----------------------------------------------------------------------------
Bagaimana cara membuat Box Linux kita aman, ini buat tambahan bagi admin yang
pengen boxnya aman dari tangan2 yang tidak bertanggung jawab, ciehhh …..
Oke deh, sekarang kita coba, …
Seperti biasa yang harus disediakan adalah

1) Rokok djie sam soe dan kopi torabika 3in1
2) Linux Box
3) Sedikit kesabaran untuk membaca
4) Sedikit Keberuntungan

Cuma itu doank kok…

Yang pertama dan utama adalah Mengecek Box kita dari Serangan intruder maupun
backdoor (kecuali fresh install),

Jelas donk sebelum kita mengamankan box, kita harus mengecek apakah box kita
masih “bersih” atau sudah ternodai , kekeekkeke .Untuk mengeceknya mungkin teman²
dah pada tau, kita menggunakan chkrootkit untuk mengecek apakah telah ada rootkit
atau backdoor yang “bercokol ” box kita.Langkah-langkahnya sbb.

1.wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz
2.tar –xzvf chkrootkit.tar.gz
3.cd chkrootkit
4.make sense
5.dan yang terakhir adalah “./chkrootkit” gak pake petik. Setelah itu akan berjalan
proses pembersihan dan pengecekan apakah rootkit sudah terinstall atau belum

Yang kedua adalah penggunaan password yang “bagus”

Bagaimanakah criteria password yang bagus ?
Kebanyakan dari admin ataupun penghuni dunia cyber selalu menggunakan password
yang gampang di ingat, dan sayangnya kebanyakan juga yang selalu digunakan itu
gak jauh² dari nama pacar,nomor rumah,“asdfghjkl” atau “qwerty”. Dan kesemuanya
itu dengan gampangnya di crack dengan menggunakan brute force attack.

Untuk mengetes apakah password kita telah sedikit “aman” atau masih ada kemungkinan
bisa di attack dengan menggunakan program brute force attack, kita dapat melihat
trik yang sering di gunakan cracker di http://ezine.echo.or.id/ezine5/ez-r05-moby-artpass.txt

Yang ketiga adalah rutinitas update system

Karena box yang gw pake adalah redhat, kita bias menggunakan “up2date” tanpa petik,
dan segera box kita akan mendapatkan update dari site redhat.com. namun untuk
distro lain dapat dibaca pada website distro masing2


Yang keempat , mematikan service yang tidak kita gunakan

Jika tidak mempunyai alas an yang kuat untuk menjalankan sebuah service sebaiknya
kita harus mematikan service tersebut. Menjalankannya berarti menambah kemungkinan
hole pada box.

Yang kelima,

Jika Kita menggunakan FTP untuk mentranfer file kedalam box, gunakan Secure FTP

Seperti telah kita tau besama, bahwa ftp menggunakan text murni tanpa enkripsi dalam
pengiriman data, ini berarti username dan password yang kita kirim adalah text yang
dapat di baca. Seseorang dengan pengetahuan sedikit mengenai linux, dapat menjalankan
paket sniffer pada jaringan, dan mendapatkan username dan password dari ftp kita.
Oleh Karena itu sangat disarankan untuk menggunakan secure FTP

Yang Keenam Pengamanan SSH

Jika kita ingin mengakses box linux kita, disarankan untuk menggunakan SSH,
dibandingkan Telnet.

Untuk konfigurasinya sbb.
1.nano /etc/ssh/sshd_config
2.cari baris yang ada tulisan #Port 22 , unkoment dan ganti port 22 menjadi angka
yang susah untuk ditebak misal 5110 , ini akan sedikit menolong box kita untuk
menjaga hal-hal seperti masscanner SSH atau worm yang akan menyecan SSH dan melihat
apakah SSH yang kita gunakan dapat di exploit. Ini dapat meningkatkan sedikit
tingkat keamanan box kita dari serangan Cracker2 baru
3.Cari #Protocol 2,1 , unkoment dan ganti menjadi Protocol 2. Ini akan memaksa SSHD
untuk menggunakan SSH versi 2 dibanding Versi 1. Yang di claim lebih aman dari Versi 1
4.Cari #PermitRoorLogin yes, Unkoment dan ganti dengan “PermitRootLogin No” ini akan
menjaga kita untuk menggunakan user root. Namun kita harus menggunakan user dengan
level lebih rendah kemudian menggunakan “su –“ untuk menjadi root. Untuk Cracker yang
akan mendapatkan akses pada box kita, cracker tersebut harus mengetahui user name
kita dan password serta password dari root itu sendiri
5.Save file tersebut kemudian restart SSHD. Biasanya /etc/init.d/sshd restart
6.cek dengan menggunakan “netstat -plnat” |grep sshd ,tanpa petik dan kita akan melihat
bahwa SSHD kita berjalan pada port yang kita inginkan

Jika Linux Box kira berada di internet dan kita mengakses melalui SSH, dan IP kita
menggunakan alamat static, maka kita harus mengconfigure agar Box Linux kita hanya
menerima akses SSH dari IP address kita

1.nano /etc/hosts.allow
2.tambahkan “sshd: ip” tanpa kutip, (ganti ip dengan ip static kita)
3.save file tersebut. Kemudian buka /etc/hosts.deny
4.Tambahkan “sshd: ALL” tanpa petik kemudian di save

Ke Tujuh , Sembunyikan informasi mengenai Versi Service

1 .Jika kita harus menjalankan web service seperti Apache kita harus mendisable atau
mengganti versi apache untuk menghindari cracker amatir dan menghentikan automatic
script yang akan mencari versi apache kita.Caranya sangat gampang, buka file httpd.conf
(biasanya /etc/httpd/conf/httpd.conf) dan cari “ServerSignature” ganti menjadi
“ServerSignature off” dan juga ganti “ServerTokens ” menjadi “ServerTokens ProductOnly”
tanpa kutip. Save kemudian restart apache.Ini akan menyembunyikan Versi dari server.
Atau kita bisa “menipu” ? Para cracker dengan mengganti nama atau versi dari apache kita
pada file httpd.h kemudian kompile ulang apache. Atau dengan cara licik (bukan attacker
doank yg bisa licik kekekekek) kita edit file binary httpd kemudian cari didalam binary
tersebut Apache (silahkan mengedit)

2 .Jika kita menggunakan php, kita dapat menyembunyikan versi php dengan mengedit file
/etc/php.ini, cari “expose_php = On”, dan ganti dengan “expose_php = Off”. Save kemudian
restart apache agar bias keliatan efeknya

3 .Jika kita menggunakan sendmail (tidak direkomendasikan), maka bersiaplah akan serangan
dari cracker, namun kita dapat menyembunyikan versi dengan mengedit
/etc/mail/sendmail.mc

kemudian tambahkan (`confSMTP_LOGIN_MSG',' Welcome all custome to my Mail Server '),
kemudian jalankan m4 /etc/mail/sendmail.mc > /etc/sendmail.cf atau make –C /etc/mail.
Kemudian edit file dengan echo smtp Help > /etc/mail/helpfile .

namun cara tersebut hanya mengurangi cracker dan bukan merupakan solusi mutlak, solusi paling
utama adalah mengupdate dengan versi paling baru

Ke Delapan, Menginstall Libsafe

Libsafe, adalah salah satu solusi untuk menghindari serangan string dan buffer overflows.
Ini akan secara dinamis mengganti LD_PRELOAD.
Untuk menginstall Libsafe adalah sbb

1.wget http://www.research.avayalabs.com/project/libsafe/src/libsafe-2.0-16.i386.rpm
2.rpm –ivh libsafe-2.0-16.i386.rpm
3.untuk melihat bahwa libsafe telah terinstall kita bisa mengecek dengan menggunakan
“cat /etc/ld.so.preload”

Ke Sembilan, Menginstall GRSecurity kernel patch

GRSecutiry adalah kernel pacth yang akan meningkatkan kemampuan dari linux box kita melawan
buffer overflow dan kasus lain pada kernel. Untuk informasi dapat dilihat di
http://www.grsecurity.net/download.php

Ke Sepuluh, Mount /tmp dengan noexec

Salah satu yang akan dilakukan cracker setelah mendapatkan shell adalah berusaha untuk
menaikkan previllage menjadi root atau setara dengan root, dan tempat favorit adalah

/tmp, /usr/tmp, /var/tmp (kekekkek,pengalaman pribadi ?)
Untuk melakukannya dengan langkah sbb

1.cd /dev
2.dd if=/dev/zero of=securetmp bs=1024 count=100000
3.mke2fs /dev/securetmp
4.cp -R /tmp /tmp_backup
5.mount -o loop,noexec,nosuid,rw /dev/securetmp /tmp
6.chmod 0777 /tmp
7.cp -R /tmp_backup/* /tmp/
8.rm -rf /tmp_backup
9.kemudian tambahkan “mount -o loop,noexec,nosuid,rw /dev/securetmp /tmp” pada
/etc/rc.local
atau di /etc/fstab
/dev/tmpMnt/tmp ext2 loop,noexec,nosuid,rw 0 0


10. save file tersebut
11. Coba test directory tmp tersebut dengan menambahan file ke tmp directory dan coba jalankan
file tersebut , akan muncul pesan “Permission Deniad”

Ulangi untuk /var/tmp dan /usr/tmp

Ke Sebelas, Install Firewall

Kita dapat menggunakan APF (Advance Policy Firewall) , script yang menggunakan IPtables dan
sangat mudah untuk di install

1. wget http://www.rfxnetworks.com/downloads/apf-current.tar.gz
2. tar -xzvf apf-*
3. cd apf-*
4. sh install.sh
5. cat README

Ke duabelas, Sembunyikan / Ubah Versi Operating system

Ada 4 buah TCP setting yang akan memungkinkan cracker untuk melihat versi dari operating
system dari Box Linux kita. 2 dari 4 settingan tersebut sangat disarankan untuk diganti
jika kita ingin menyembunyikan versi O/S dari cracker baru dan mempunyai pengetahuan yang
kurang pada operating system (kayak gw, ?). 2 buah setting tersebut adalah Windows Size
dan Default Time to Live. Untuk melihat list fingerprint dapat dilihat pada
http://www.honeynet.org/papers/finger/traces.txt yang akan menunjukkan default setting
untuk tiap O/S, ingat !! Dengan mengubah settingan ini dapat menurunkan atau bahkan
meningkatkan dari performansi Box kita, jadi jangan lupa untuk menyimpan default dari
O/S kita , Salah satu triknya adalah sbb

1.echo 60 > /proc/sys/net/ipv4/ip_default_ttl
2.echo 32768 > /proc/sys/net/core/rmem_max
3.echo 32768 > /proc/sys/net/core/rmem_default
4.jangan lupa untuk menambahkannya pada /etc/rc.local atau /etc/sysctl.conf
February 2012
S M T W T F S
January 2012March 2012
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29