Konfigurasi php, mysql, apache

Posted in Windows 2000 server on September 4, 2008 by gudel92

Install PHP

Pertama, extract paket PHP Anda. Saya lebih suka mengextrac dalam satu direktori yang sama dengan paket Apache yang sudah terinstall ( C:\Program Files\Apache Group\Apache2 ). Buat direktori php. Copy file php.ini-dist di direktori PHP ke direktori windows ( C:\Windows atau C:\Winnt tergantung jenis Windows ) dan rename file menjadi php.ini. Ini adalah file konfigurasi PHP yang nantinya akan kita modifikasi.

Selanjutnya, pindah file php4ts.dll dari direktori PHP ke subdirektori sapi. Anda juga bisa menempatkan php4ts.dll ketempat lain seperti :

  • Direktori dimana apache.exe berada, yaitu ( C:\Program
    Files\Apache Group\Apache2 \bin)
  • Atau pada %SYSTEMROOT%\System32, %SYSTEMROOT%\system dan %SYSTEMROOT%
    directory.Note: %SYSTEMROOT%\System32 hanya pada Windows NT/2000/XP)
  • Atau pada semua %PATH%

Modifikasi Konfigurasi Apache

Apache belum mengenali instalasi PHP Anda. Anda harus menambahkan PHP pada konfigurasi Apache pada C:\Program Files\Apache Group\Apache2\conf\httpd.conf dan tambahkan baris-baris berikut :

LoadModule php4_module php/sapi/php4apache2.dll

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

Baris pertama memberitahu Apache dimana me load dll yang dibutuhkan untuk menjalankan PHP dan baris kedua menunjukkan bahwa setiap file berekstensi .php akan diproses sebagai file PHP. Anda sebenarnya juga bisa mengubahnya ke apa saja yang Anda inginkan seperti .html atau bahkan .asp!. Baris ketiga ditambahkan agar Anda bisa melihat source code file PHP Anda di browser window(tentunya file dengan ekstensi .phps).

Sekarang restart Apache untuk melihat hasil perubahan yang Anda lakukan ( Start
> Programs > Apache HTTP Server 2.0.50 > Control Apache Server > Restart ) . Untuk mengetahui apakah konfigurasi Anda sudah benar buat file baru, beri nama test.php dan letakkan di direktori document root ( C:\Program Files\Apache Group\Apache2\htdocs ). Isi file tersebut seperti dibawah ini.

<?phpphpinfo();

?>

phpinfo() adalah fungsi PHP yang akan memberitahu Anda tentang segala hal mengenai PHP dan konfigurasi server yang telah Anda install. Ketik http://localhost/test.php pada browser address bar dan jika semunya benar, maka Anda akan melihat seperti ini :

Install MySQL

Pertama extract paket Anda (misalnya mysql-4.0.18-win.zip ) ke temporary directory, kemudian jalankan setup.exe. Klik tombol next hingga proses instalasi selesai. Secara default MySQL akan diisntall di C:\mysql.

Buka DOS window dan pindah ke direktori C:\mysql\bin dan ketik mysqld-nt –console , Anda akan melihat pesan sebagai berikut :

C:\mysql\bin>mysqld-nt –consoleInnoDB: The first specified data file .\ibdata1 did not exist:

InnoDB: a new database to be created!
040807 10:54:09 InnoDB: Setting file .\ibdata1 size to 10 MB

InnoDB: Database physically writes the file full: wait…

040807 10:54:11 InnoDB: Log file .\ib_logfile0 did not exist: new to be
created

InnoDB: Setting log file .\ib_logfile0 size to 5 MB

InnoDB: Database physically writes the file full: wait…

040807 10:54:12 InnoDB: Log file .\ib_logfile1 did not exist: new
to be created

InnoDB: Setting log file .\ib_logfile1 size to 5 MB

InnoDB: Database physically writes the file full: wait…

InnoDB: Doublewrite buffer not found: creating new

InnoDB: Doublewrite buffer created

InnoDB: Creating foreign key constraint system tables

InnoDB: Foreign key constraint system tables created

040807 10:54:31 InnoDB: Started

mysqld-nt: ready for connections.

Version: ‘4.0.18-nt’ socket: ” port: 3306

Sekarang coba buka DOS window lain dan ketik C:\mysql\bin\mysql

jika instalasi Anda sukses, Anda akan melihat MySQL client sedang running :

C:\mysql\bin>mysqlWelcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1 to server version: 4.0.18-nt

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

mysql>

Ketik exit pada console mysql> untuk keluar dari MySQL client.

Bagaimana install MySQL sebagai Service Windows? Prosesnya sederhana, cukup ketik mysqld-nt –install dan net start mysql untuk menjalankan service. Sebelumnya shutdown MySQL server dulu menggunakan mysqladmin -u root shutdown

C:\mysql\bin>mysqladmin -u root shutdown

C:\mysql\bin>mysqld-nt –install

Service successfully installed.

C:\mysql\bin>net start mysql

The MySQL service was started successfully.

C:\mysql\bin>mysql

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

Your MySQL connection id is 1 to server version: 4.0.18-nt

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

mysql>

Modifikasi file komfigurasi PHP ( php.ini )

PHP menyimpan semua konfigurasi dalam satu file yang disebut php.ini.Anda bisa mencari file ini pada direktori tempat PHP Anda diinstall. Beberapa perubahan kdang diperlukan misalnya untuk menggunakan PHP extension.

Beberapa perubahan yang diperlukan antara lain :

  1. register_globals
  2. error_reporting and display_errors
  3. extension and extension_path
  4. session.save_path
  5. max_execution_time

register_globals

Sebelum PHP 4.2.0 default value untuk register_globals adalah On dan setelah 4.2.0 menjadi Off. Alasan utamanya tentu adalah source code yang aman apabila register_globals bernilai Off pada php.ini.

error_reporting and display_errors

Set value nya menjadi error_reporting = E_ALL selama pross development. Cuman saya lebih sering menggunakan E_ERROR, jadi hanya error yang krusial saja yang akan ditampilkan :p

Alasan menggunakan E_ALL selama pengambangan agar Anda bisa melihat semua Bugs(kesalahan)dalam code Anda. PHP akan mengeluarkan pesan error setiap code Anda salah dan pesan peringatan ( misalnya jika Anda mencoba menggunakan variable yang tidak diinisialisasi dulu).

Catatan, Anda bisa mengubah value nya menjadi E_NONE setelah development.

Jangan lupa untuk memberi nilai On pada bagian display_erros agar setting error_reporting = E_ALL juga berfungsi

extension dan extension_path

PHP4 punya sekitar 51 extensions seperti GD library ( untuk membuat dan memanipulasi grafik), CURL, PostgreSQL support dll. Extensions ini tidak secara otomatis berfungsi. Jika Anda membutuhkan extension tententu maka Anda juga harus menspesifikasi dimana extension tersebut dan menghilangkan tanda comment di extension yang ingin Anda gunakan pada file konfigurasi PHP.

Nilai extension_path harus diset sesuai dengan direktori dimana extension diinstal yang biasanya PHP_INSTALL_DIR/extensions, PHP_INSTALL_DIR adalah direktori instalasi PHP Anda. Contoh jika Anda menginstall PHP di C:\Program Files\Apache Group\Apache2\php maka extensions path adalah :

extension_path = C:/Program Files/Apache Group/Apache2/php/extensions/

Jangan lupa menambahakan slash agar berfungsi dengan benar

Setelah Anda menspesifikasi extension_path Anda juga harus menghilangkan tanda comment di extension yang ingin Anda gunakan pada file konfigurasi PHP pada extension yang digunakan. Comment diawalai dengan tanda semicolon (;). Contoh jika Anda ingin menggunakan GD library hiangkan tanda semicolon pada awal ;extension=php_gd2.dll menjadi extension=php_gd2.dll

session.save_path

Konfigurasi ini akan memberitahu PHP dimana menyimpan session data. Ubahlah sesuai keinginan Anda. Di Windows Anda bisa mengubah nilainya menjadi session.save_path = c:/windows/temp/

max_execution_time

Nilai default max_execution_time adalah 30 ( dalam detik ).

Jika script Anda butuh waktu lebih untuk proses maka Anda bisa merubah nilai max_execution_time lebih tinggi sesuai kebutuhan Anda

PHP memiliki fungsi untuk memodifikasi konfigurasi pada runtime,yaitu ini_set(). Setting file konfigurasi PHP menggunakan fungsi ini tidak permanent, ketika sebuah script selesai dieksekusi, maka setting ini juga hilang. Read more »

Install Windows 2000 server

Posted in Uncategorized on August 29, 2008 by gudel92

How can I install Windows 2000 Server?

As a Microsoft Windows 2000 Server support professional, one of your tasks may be to install the operating system.

Step #1: Plan your installation

When you run the Windows 2000 Server Setup program, you must provide information about how to install and configure the operating system. Thorough planning can make your installation of W2K more efficient by helping you to avoid potential problems during installation. An understanding of the configuration options will also help to ensure that you have properly configured your system.

I won’t go into that part right now but here are some of the most important things you should take into consideration when planning for your Windows Server 2000 installation:

  • Check System Requirements

  • Check Hardware and Software Compatibility

  • Determine Disk Partitioning Options

  • Choose the Appropriate File System: FAT, FAT32, NTFS

  • Decide on a Workgroup or Domain Installation

  • Complete a Pre-Installation Checklist

After you made sure you can go on, start the installation process.

Step #2: Beginning the installation process

You can install Windows 2000 Server in several methods – all are valid and good, it all depends upon your needs and your limitations.

  • Manual installations usually come in 3 flavors:

  • Boot from CD – No existing partition is required.

  • Boot from the 4 Setup Boot Disks, then insert the CD – No existing partition is required.

  • Boot from an MS-DOS startup floppy, go to the command prompt, create a 4GB FAT32 partition with FDISK, reboot, format the C partition you’ve created, then go to the CD drive, go into the I386 folder, and run the WINNT.EXE command.

  • Run an already installed OS, such as Windows NT 4.0 Server. From within NT 4.0 go to the I386 folder in the W2K installation CD and run the WINNT32.EXE command.

  • If you want to upgrade a desktop OS such as Windows 98 into Windows 2000 Professional you can follow the same procedure as above (You cannot upgrade Windows 98 into W2K Server).

There are other non-manual installation methods, such as using an unattended file along with a uniqueness database file, using Sysprep, using RIS or even running unattended installations from within the CD itself, but we won’t go into that right now.

It doesn’t matter how you run the setup process, but the moment it runs – all setup methods look alike.

Step #3: The text-based portion of the Setup program

The setup process begins loading a blue-looking text screen (not GUI). In that phase you will be asked to accept the EULA and choose a partition on which to install W2K, and if that partition is new, you’ll be asked to format it by using either FAT, FAT32 or NTFS.

  1. Start the computer from the CD.

  2. You can press F6 if you need to install additional SCSI adapters or other mass-storage devices. If you do you will be asked to supply a floppy disk with the drivers and you CANNOT browse it (or a CD for that matter). Make sure you have one handy.

  1. Setup will load all the needed files and drivers.

  1. Select To Setup W2K Now. If you want, and if you have a previous installation of the OS, you can try to fix it by pressing R. If not, just press ENTER.

  1. In case your server is a new one, or it is using a new hard disk that hasn’t been partitioned yet, you’ll get a warning message. Read it, and if you want to continue, press C.

  1. Read and accept the licensing agreement and press F8 if you accept it.

  1. Select or create the partition on which you will install W2K. Depending upon your existing disk configuration choose one of the following:

  • If the hard disk is not yet partitioned, you can create and size the partition on which you will install Windows 2000. Press C.

  • If the hard disk is new and you want to create a partition that will span the entire hard disk’s size – press Enter.

Other optionsL

  • If the hard disk is already partitioned, but has enough unpartitioned disk space, you can create an additional partition in the unpartitioned space.

  • If the hard disk already has a partition that is large enough, you can install Windows 2000 on that partition. If the partition has an existing operating system, you will overwrite that operating system if you accept the default installation path. However, files other than the operating system files, such as program files and data files, will not be overwritten.

  • If the hard disk has an existing partition, you can delete it to create more unpartitioned space for the new partition. Deleting an existing partition erases all data on that partition.

If you select a new partition during Setup, create and size only the partition on which you will install Windows 2000. After installation, use Disk Management to partition the remaining space on the hard disk.

  1. Select a file system for the installation partition. After you create the partition on which you will install W2K, you can use Setup to select the file system with which to format the partition. W2K supports the NTFS file system in addition to the file allocation table (FAT) and FAT32 file systems. Windows Server 2003, Windows XP Professional, Windows 2000, and Windows NT are the only Microsoft operating systems that you can use to gain access to data on a local hard disk that is formatted with NTFS. If you plan to gain access to files that are on a local W2K partition with the Microsoft Windows 95 or Windows 98 operating systems, you should format the partition with a FAT or FAT32 file system. We will use NTFS.

  1. Setup will then begin copying necessary files from the installation point (CD, local I386 or network share).

  2. Note: If you began the installation process from an MS-DOS floppy, make sure you have and run SMARTDRV from the floppy, otherwise the copying process will probably last more than an hour, perhaps even more. With SMARTDRV (or if setup was run by booting from CD) the copying will probably last a few minutes, no more than 5 max.

  1. The computer will restart in graphical mode, and the installation will continue.

Step #4: The GUI-based portion of the Setup program

The setup process reboots and loads a GUI mode phase.

It will then begin to load device drivers based upon what it finds on your computer. You don’t need to do anything at this stage.

If your computer stops responding during this phase (the progress bar is stuck almost half-way, and there is no disk activity) – shut down your computer and begin removing hardware such as PCI and ISA cards. If it works for you then later try to figure out how to make that specific piece of hardware work (it’s probably not in the HCL).

  1. Click Customize to change regional settings, if necessary.

  • Current System Locale – Affects how programs display dates, times, currency, and numbers. Choose the locale that matches your location, for example, French (Canada).

  • Current Keyboard Layout – Accommodates the special characters and symbols used in different languages. Your keyboard layout determines which characters appear when you press keys on the keyboard.

If you don’t need to make any changes just press Next.

If you do need to make changes press Customize and add your System Locale etc.

Note for Hebrew users: In W2K it is NOT SAFE to install Hebrew language support at this phase!!! Trust me, do it later. If you don’t listen to me, good chances are that you’ll get ???? fonts in some Office applications such as Outlook and others.

Read the Install Hebrew on Windows 2000 page for more info.

  1. Type your name and organization.

  1. Type the product key.

If you’d like to skip this step in the future, please read Install Windows 2000 Without Supplying the CD Key.

  1. Enter the appropriate license type and number of purchased licenses.

  1. Type the computer name and a password for the local Administrator account. The local Administrator account resides in the SAM of the computer, not in Active Directory. If you will be installing in a domain, you need either a pre-assigned computer name for which a domain account has been created, or the right to create a computer account within the domain.

  1. Choose which components to install or remove from the system.

  1. Select the date, time, and time zone settings.

  1. Setup will now install the networking components.

After a few seconds you will receive the Networking Settings window. BTW, if you have a NIC that is not in the HCL (see the What’s the HCL? page) and W2K cannot detect it, or if you don’t have a NIC at all, setup will skip this step and you will immediately go to the final phase of the setup process.

Press Next to accept the Typical settings option if you have one of the following situations:

  • You have a functional DHCP on your network.

  • You have a computer running Internet Connection Sharing (ICS).

  • You’re in a workgroup environment and do not plan to have any other servers or Active Directory at all, and all other workgroup members are configured in the same manner.

Otherwise select Custom Settings and press Next to customize your network settings.

  1. Highlight the TCP/IP selection and press Properties.

In the General tab enter the required information. You must specify the IP address of the computer, and if you don’t know what the Subnet Mask entry should be - you can simply place your mouse pointer over the empty area in the Subnet Mask box and click it. The OS will automatically select the value it thinks is good for the IP address you provided.

Lamer note: In the above screenshot I’ve configured the computer with a valid IP address for MY network, along with the Default Gateway and the address of MY DNS server. Your settings may differ.

If you don’t know what these values mean, or if you don’t know what to write in them, press cancel and select the Typical Settings option. You can easily change these values later.

  1. In the Workgroup or Domain window enter the name of your workgroup or domain.

  • A workgroup is a small group of computers on a network that enables users to work together and does not support centralized administration.

  • A domain is a logical grouping of computers on a network that has a central security database for storing security information. Centralized security and administration are important for computers in a domain because they enable an administrator to easily manage computers that are geographically distant from each other. A domain is administered as a unit with common rules and procedures. Each domain has a unique name, and each computer within a domain has a unique name.

If you’re a stand-alone computer, or if you don’t know what to enter, or if you don’t have the sufficient rights to join a domain – leave the default entry selected and press Next.

If you want to join a domain (NT 4.0 domain of W2K/2003 Active Directory domain) enter the domain’s name in the “Yes, make this computer a member of the following domain” box.

To successfully join a domain you need the following:

  • The person performing the installation must have a user account in Active Directory. This account does not need to be the domain Administrator account.

and

  • The computer must have an existing computer account in the Active Directory database of the domain that the computer is joining, and the computer must be named exactly as its domain account is named.

or

  • The person performing the installation must have appropriate permission to create a domain account for the computer during installation.

Also, you need to have connectivity to the domain’s domain controllers (only to the PDC if on an NT 4.0 domain) and a fully functional DNS server (only in AD domains). Read the Joining a Domain in Windows XP Pro and Requirements when Joining a Domain pages for more on this issue.

Enter the Active Directory domain name (in the form of xxx.yyy, for example: DPETRI.NET) or the NetBIOS name of the NT 4.0 domain (in the form of xxx, for example: DPETRI). Press Next.

Note: If you provide a wrong domain name or do not have the correct connectivity to the domain’s DNS server you will get an error message.

A username/password window will appear. Enter the name and password of the domain’s administrator (or your own if you’re the administrator on the target domain).

Note: Providing a wrong username or password will cause this phase to fail.

  1. Next the setup process will finish copying files and configuring the setup. You do not need to do anything.

  1. After the copying and configuring phase is finished, if Windows Server 2003 finds that you have a badly configured screen resolution it will advise you to change it and ask you if you see the new settings right.

  2. Setup finishes and displays the finish window. Unfortunately, you must press Finish in order to reboot..

  1. Windows 2000 reboots and you should get the CTRL-ALT-DEL window.

  1. That’s it! you’re done!

Hello world!

Posted in Uncategorized on August 22, 2008 by gudel92

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

Follow

Get every new post delivered to your Inbox.