Embun Pagi


Hak akses folder + linux

Ditulis dalam Belajar oleh alifsmart di/pada Februari 3, 2010

Pada Sistem Operasi Linux semua file memiliki hak aksesnya masing-masing. Hak akses tersebut terdiri atas tiga bagian:

r untuk read (membaca)
w untuk write (menulis)
x untuk execute (menjalankan)
Untuk melakukan check terhadap hak akses suatu file bisa dilakukan dengan menjalankan perintah ls -la pada sebuah shell atau konsol. Berikut salah satu contoh pada saat saya menjalankan perintah ini di dalam folder /home/

# ls -l
drwxrwxrwx 3 root users 4096 1996-02-02 10:59 allusers
drwxr-xr-x 14 gagoyiku gagoyiku 4096 1996-02-02 08:36 gagoyiku
drwxrwxr-x 2 root users 4096 1996-02-02 08:37 windowshare

Berikut adalah penjelasan kolom-kolom yang saya anggap paling penting untuk diketahui artinya.

Kolom pertama pada hasil diatas adalah yang menggambarkan perijinannya, terdiri atas 10 karakter.
Karakter pertama akan menunjukkan apakah objek tersebut adalah sebuah direktori (d), file (-), atau sebuah link ( l ) yang merujuk kepada direktory atau file lainnya
3 karakter selanjutnya akan memperlihatkan ijin untuk membaca, menulis dan menjalankan objek dimaksud, bagi si pemilik objek
3 karakter selanjutnya akan memperlihatkan ijin untuk group pengguna yang mengatur objek
3 karakter selanjutnya akan memperlihatkan ijin untuk pengguna yang lain
Kolom ke tiga akan menunjukkan pemilik objek
Kolom ke empat akan menunjukkan group pengguna pemilik objek tersebut
Kolom terakhir menunjukkan nama dari objek di system
Dari hasil jalannya perintah sebelumnya, bisa kita baca bahwa pemilik dari direktori windowshare adalah root dan group pengguna yang memiliki direktori tersebut adalah group users yang memiliki hak untuk baca, menulis dan menjalankan berbagai macam operasi di folder tersebut; sedangkan pengguna lainnya yang tidak termasuk root dan anggota group users hanya bisa membaca dan menjalankan file (read only).

Namun yang harus kita ingat bahwa user root memiliki kemampuan untuk melakukan apa saja terhadap hak akses tersebut.

Sebagai sebuah persetujuan awal, apabila saya mempergunakan kata file, maka ini bisa merujuk pada file data atau folder.

Merubah Hak Akses Suatu File
Perintah chmod “Numeric Mode”
Perintah ini akan merubah perijinan suatu file/direktori menggunakan kode akses berupa 3 digit nomor tertentu, yang merupakan perwujudan dari hak akses suatu file di Linux. Masing-masing kode tersebut adalah 4 untuk membaca (read), 2 untuk menulis, dan yang terakhir adalah 1 untuk menjalankan sebuah file.

Sebagai contoh, kita ingin sebuah file hanya bisa untuk di baca (4) dan di tulis (2) tapi tidak untuk di jalankan, maka kita bisa mempergunakan perintah 4+2 = 6. Menggunakan cara yang sama apabila kita ingin memberikan hak akses hanya untuk membaca (4), dan memberikan semua hak akses yang ada (7 = 1+2+4).

Lalu kode akses tersebut di kombinasikan berdasarkan urutan ~ hak akses untuk pemilik, group pemilik dan pengguna lain ~ hak kepemilikan sebuah file, dengan sintak perintahnya adalah:

chmod

Sebagai contoh berdasarkan perintah ls -l sebelumnya, kita akan melakukan setting agar folder windowshare bisa di pergunakan oleh semua pengguna agar bisa menulis, membaca, dan menjalankan file di folder tersebut, maka kita mempergunakan perintah:

# chmod 777 /home/windowshare

Sehingga bila kita perlihatkan lagi hak akses menggunakan perintah ls -l, akan kita dapatkan hasil seperti berikut:

# ls -l
<>
drwxrwxrwx 2 root users 4096 1996-02-02 08:37 windowshare
<>

Perhatikan sekarang kode akses yang menjadi drwxrwxrwx, dari yang semulanya drwxrwxr-x.
Namun apabila kita menginginkan hanya si pemilik file saja yang memiliki hak akses dan yang lainnya (bahkan group pemiliknya) hanya memiliki akses membaca saja (read only), kita bisa menggunakan perintah:

# chmod 744 /home/windowshare
# ls -l
<>
drwxr-xr-x 2 root users 4096 1996-02-02 08:37 windowshare
<>

Atau kalau si pemilik saja yang memiliki hak akses, maka kita bisa menjalankan perintah:

# chmod 700 /home/windowshare
# ls -l
<>
drwx—— 2 root users 4096 1996-02-02 08:37 windowshare
<>

Apabila kita ingin mengubah hak akses di folder beserta semua isinya, maka dibutuhkan tambahan perintah berupa tanda -R (recursive). Sehingga bila kita ingin mengubah hak akses di folder /home/windowshare beserta isinya, kita tinggal menjalankan perintah:

# chmod -R 700 /home/windowshare

Perintah chmod “Symbolic Mode”
Kalau pada Numeric Mode menggunakan angka-angka, maka pada symbolic mode mempergunakan huruf yang bisa dikombinasikan. Alhasil perintahnya lebih mudah untuk dimengerti. Berikut sintak penulisannya:

chmod [flags] [u/g/o/a] [+/-/=] [r/w/x]

Kombinasi [u/g/o/a] digunakan untuk mengatur hak akses pengguna, yaitu u (pengguna yang memilikinya), g (group yang memilikinya), o (other/pengguna lain yang bukan termasuk dalam group pemiliknya), atau a (all – semua pengguna). Operator untuk + (melakukan setting/menambah), – (mengurangi hak akses) dan = (set hak akses) harus dikombinasikan dengan perintah pilihan selanjutnya yaitu r (read – membaca), w (write – menulis) dan x (execute – menjalankan) sebuah file.

Sebagai contoh kita dasarkan pada contoh sebelumnya. Misalkan kita ingin agar folder windowshare hanya bisa dipergunakan oleh pemiliknya saja:

#chmod u+rwx,og-rwx /home/windowshare

Atau kita ingin agar semua orang hanya memiliki hak akses untuk membaca saja (read only)

#chmod a+rx-w /home/windowshare

Kita juga bisa memberikan setting hak akses sekaligus untuk isi folder tersebut (recursive)

#chmod -R a+rx-w /home/windowshare

Mengubah Kepemilikan File
Untuk mengubah kepemilikan sebuah file kita bisa mempergunakan perintah chown yang memiliki format yang sama dengan perintah chmod. Bedanya yang kita ubah adalah kepemilikan sebuah file. Sintak yang digunakan adalah:

chown

Misalnya kita ingin mengubah kepemilikan folder windowshare diatas, dari root kepada user dengan login linuz, maka kita tinggal melakukan perintah:

# chown linuz /home/windowshare

Mengubah Group Pemilik File
Untuk mengubah group pemilik sebuah file kita bisa mempergunakan perintah chgrp yang juga memiliki format yang sama dengan perintah chown. Bedanya yang kita ubah adalah group pemiliknya. Misalkan kita ingin mengubah group pemilik folder windowshare diatas, dari users kepada group linuzgroup, kita tinggal melakukan perintah:

#chgrp linuzgroup /home/windowshare

http://ulunrapuydebian.wordpress.com/2008/07/05/hak-aksesperijinan-file-di-linux/

apache + php + mysql + ubuntu

Ditulis dalam Belajar oleh alifsmart di/pada Februari 1, 2010

Installing Apache2 With PHP5 And MySQL Support On Ubuntu 9.10 (LAMP)
2009/12/10its only a note, to learn and to shareTags: apache, database, linux, mysql, ngoprek, php, server, tips, tutorial, ubuntu, web

LAMP singkatan dari Linux, Apache, MySQL, PHP. tutorial ini memperlihatkan cara install Apache2 webserver di Ubuntu 9.10 server dengan PHP5 support (mod_php) dan MySQL support.

I do not issue any guarantee that this will work for you!
1 Preliminary Note

In this tutorial I use the hostname server1.example.com with the IP address 192.168.0.100 atau localhost. These settings might differ for you, so you have to replace them where appropriate.

I’m running all the steps in this tutorial with root privileges, so make sure you’re logged in as root:

sudo su
2 Installing MySQL 5

First we install MySQL 5 like this:

aptitude install mysql-server mysql-client

You will be asked to provide a password for the MySQL root user – this password is valid for the user root@localhost as well as root@server1.example.com, so we don’t have to specify a MySQL root password manually later on:

New password for the MySQL “root” user: <– yourrootsqlpassword
Repeat password for the MySQL “root” user: <– yourrootsqlpassword
3 Installing Apache2

Apache2 is available as an Ubuntu package, therefore we can install it like this:

aptitude install apache2

Now direct your browser to http://192.168.0.100, and you should see the Apache2 placeholder page (It works!):

localhost

Apache’s default document root is /var/www on Ubuntu, and the configuration file is /etc/apache2/apache2.conf. Additional configurations are stored in subdirectories of the /etc/apache2 directory such as /etc/apache2/mods-enabled (for Apache modules), /etc/apache2/sites-enabled (for virtual hosts), and /etc/apache2/conf.d.
4 Installing PHP5

We can install PHP5 and the Apache PHP5 module as follows:

aptitude install php5 libapache2-mod-php5

We must restart Apache afterwards:

/etc/init.d/apache2 restart
5 Testing PHP5 / Getting Details About Your PHP5 Installation

The document root of the default web site is /var/www. We will now create a small PHP file (info.php) in that directory and call it in a browser. The file will display lots of useful details about our PHP installation, such as the installed PHP version.

vi /var/www/info.php

Now we call that file in a browser (e.g. http://localhost/info.php):

phpinfo

As you see, PHP5 is working, and it’s working through the Apache 2.0 Handler, as shown in the Server API line. If you scroll further down, you will see all modules that are already enabled in PHP5. MySQL is not listed there which means we don’t have MySQL support in PHP5 yet.
6 Getting MySQL Support In PHP5

To get MySQL support in PHP, we can install the php5-mysql package. It’s a good idea to install some other PHP5 modules as well as you might need them for your applications. You can search for available PHP5 modules like this:

aptitude search php5

Pick the ones you need and install them like this:

aptitude install php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-json

Now restart Apache2:

/etc/init.d/apache2 restart

Now reload http://localhost/info.php in your browser and scroll down to the modules section again. You should now find lots of new modules there, including the MySQL module:

mysql
7 phpMyAdmin

phpMyAdmin is a web interface through which you can manage your MySQL databases. It’s a good idea to install it:

aptitude install phpmyadmin

You will see the following questions:

Web server to reconfigure automatically: <– apache2
Configure database for phpmyadmin with dbconfig-common? <– No

Afterwards, you can access phpMyAdmin under http://localhost/phpmyadmin/:

phpMyAdmin
8 Links

* Apache: http://httpd.apache.org/
* PHP: http://www.php.net/
* MySQL: http://www.mysql.com/
* Ubuntu: http://www.ubuntu.com/
* phpMyAdmin: http://www.phpmyadmin.net/

souce http://www.howtoforge.com

http://gap.web.id/index.php/2009/12/lamp-server-with-ubuntu-9-10/

sfc /scannow “/System File Checker (sfc)”

Ditulis dalam 1 oleh alifsmart di/pada Januari 25, 2010

System File Checker (sfc)

Scans and verifies the versions of all protected system files after you restart your computer.
Syntax

sfc [/scannow] [/scanonce] [/scanboot] [/revert] [/purgecache] [/cachesize=x]
Top of pageTop of page
Parameters

/scannow : Scans all protected system files immediately.

/scanonce : Scans all protected system files once.

/scanboot : Scans all protected system files every time the computer is restarted.

/revert : Returns the scan to its default operation.

/purgecache : Purges the Windows File Protection file cache and scans all protected system files immediately.

/cachesize=x : Sets the size, in MB, of the Windows File Protection file cache.

/? : Displays help at the command prompt.
Top of pageTop of page
Remarks

You must be logged on as a member of the Administrators group to run sfc.

If sfc discovers that a protected file has been overwritten, it retrieves the correct version of the file from the %systemroot%\system32\dllcache folder, and then replaces the incorrect file.

If the %systemroot%\system32\dllcache folder becomes corrupt or unusable, use sfc /scannow, sfc /scanonce, or sfc /scanboot to repair the contents of the Dllcache directory.
Top of pageTop of page
Formatting legend
Format Meaning

Italic

Information that the user must supply

Bold

Elements that the user must type exactly as shown

Ellipsis (…)

Parameter that can be repeated several times in a command line

Between brackets ([])

Optional items

Between braces ({}); choices separated by pipe (|). Example: {even|odd}

Set of choices from which the user must choose only one

Courier font

Code or program output

Windows File Protection

Using File Signature Verification

Driver Signing for Windows

Command-line reference A-Z

Top of pageTop of page

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/system_file_checker.mspx?mfr=true

Deprecated: Function eregi() is deprecated in …

Ditulis dalam Belajar oleh alifsmart di/pada Januari 9, 2010

find:
PHP Code:
//set the level of error reporting
error_reporting(E_ALL & ~E_NOTICE);
replace with:

PHP Code:
//set the level of error reporting
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);

http://www.oscmax.com/forums/oscmax-v2-installation-issues/19875-deprecated-function-eregi-deprecated-c-xampphtdocsdali-designincludesclasseslanguage-php-line-87-a.html

PHP error Notice: Undefined variable

Ditulis dalam Belajar oleh alifsmart di/pada Desember 11, 2009

Problem

After installing FC3 php gives error messages like “Notice: Undefined variable: Bla bla”.
Reason

The default error setting in php.ini is set to E_ALL.
Solution
Edit /etc/php.ini with your favorite text editor. Replace the line

error_reporting = E_ALL

with

error_reporting = E_ALL & ~E_NOTICE

http://linuxlab.dk/tipsntricks/php-undefined-variable.php

Halaman Berikutnya »