Articles Comments

{ Berbagi, Menulis, Dan Mengajar } Ilmu… » 7. Operating System » Ganti IP komputer debian lewat php –> COPAS dari Web Eepis – its… gpp ya saya copy…:D

Ganti IP komputer debian lewat php –> COPAS dari Web Eepis – its… gpp ya saya copy…:D


Cara mengganti IP address lewat web browser :

1. install apache2 php5 visudo

2. edit /etc/visudo

#
# This file MUST be edited with the ‘visudo’ command as root.
#
# See the man page for details on how to write a sudoers file.
#

Defaults        env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL) ALL
www-data ALL=(ALL) NOPASSWD:ALL

——————————————

3. Buat file .php dengan nama do.php

//Ambil variabel dari ip.php
$ip=$_GET['ip'];
$netmask=$_GET['netmask'];
$dev=$_GET['dev'];

//Eksekusi pengubahan IP..
$command=’sudo /sbin/ifconfig ‘.$dev.’ ‘.$ip.’ netmask ‘.$netmask;
$hasil=system($command);

//tampilkan hasil akhir..
$hasil=system(”/sbin/ifconfig “.$dev);
echo $hasil;
?>

dev:

ip:

netmask:


4.   Jangan lupa meletakkan file php di /var/www/apache-default

kalau tidak bisa di letakan coba di chmod 666

5. jalankan di browser //localhost/do.php

Filed under: UncategorizedTrackback Uri

Filed under: 7. Operating System

Leave a Reply

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>