• TibiaME

    The first Massively Multiplayer Online Role-Playing Game

  • This is default featured slide 2 title

    Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by NewBloggerThemes.com.

  • This is default featured slide 3 title

    Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by NewBloggerThemes.com.

  • This is default featured slide 4 title

    Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by NewBloggerThemes.com.

  • This is default featured slide 5 title

    Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by NewBloggerThemes.com.

[OpenWRT] SFTP Server

SFTP server

Some clients, e.g. GNOME Files or Cyberduck on the Mac, cannot connect to the SCP server provided by OpenWrt's standard ssh server, dropbear, unless an additional binary is installed in /usr/libexec/sftp-server - this can be done with:
# Enable sftp, work around https://trac.cyberduck.io/ticket/4161
 
 opkg update 
 opkg install openssh-sftp-server
 
Now you can use sftp clients such as GNOME Files or Cyberduck to connect to the OpenWrt system. Note that no additional startup scripts are required since all of that is handled by dropbear which is most likely already present on your system.

Announce on the network

If you would like to announce the service on the network using Bonjour/Zeroconf so that Cyberduck finds it, you you can install the announce package, starting from Chaos Calmer:
opkg install announce 
 /etc/init.d/announce enable
 /etc/init.d/announce start
announce will notice that openssh-sftp-server is present and will announce the sftp service on the network.
Share:

[OpenWRT] Web Server

===== Instalasi PHP5 =====

root@WebServer: opkg update
root@WebServer: opkg install php5
root@WebServer: opkg install php-cgi

===== Konfigurasi uHTTPD =====

-- uncomment pada >> list interpreter        “.php=/usr/bin/php-cgi”

root@WebServer: /etc/config# nano uhttpd
———-potong
#List of extension->interpreter mappings.
#Files with an associated interpreter can
#be called outside of the CGI prefix and do
#not need to be executable.
list interpreter        “.php=/usr/bin/php-cgi”
#       list interpreter        “.cgi=/usr/bin/perl”
———–potong

-- save dan restart uhttpd

root@g-wrt:/etc/init.d# ./uhttpd stop
root@g-wrt:/etc/init.d# ./uhttpd start

===== Test PHP5 ===== 

buat file (misalnya) tes-php.php
isinya:
<?php
phpinfo();
?>

save dan simpan di /www
Buka browser, http://ipaddress-router/tes-php.php

===== Enable MySQL Pada PHP5 =====  

Install php-mod-mysql
opkg update
opkg install php-mod-mysql
Edit file /etc/php.ini pada bagian:
edit/tambahkan “short_open_tag = On” (tanpa tanda petik)
dan uncomment “extension=mysql.so” (tanpa tanda petik) pada bagian ; Dynamic Extensions
————potong
; Language Options
engine = On
;short_open_tag = Off
short_open_tag = On
precision    =  12
y2k_compliance = On
————–potong
;extension=json.so
;extension=ldap.so
;extension=mbstring.so
;extension=mcrypt.so
extension=mysql.so
————–potong
===== PHP Script to Test MySQL ===== 

<?php

$host = "localhost"; 
$user = "user12"; 
$pass = "34klq*"; 

$r = mysql_connect($host, $user, $pass);

if (!$r) {
    echo "Could not connect to server\n";
    trigger_error(mysql_error(), E_USER_ERROR);
} else {
    echo "Connection established\n"; 
}

echo mysql_get_server_info() . "\n"; 

mysql_close();

?>
Share:

[OpenWRT] Mysql Server

===== Install dan Konfigurasi =====

opkg update
opkg install mysql-server

sed -i 's,^datadir.*,datadir = "/srv/mysql",g' /etc/my.cnf
sed -i 's,^tmpdir.*,tmpdir = "/tmp",g' /etc/my.cnf

mkdir -p /srv/mysql
mysql_install_db --force
/etc/init.d/mysqld start
/etc/init.d/mysqld enable
mysqladmin -u root password 'password'

===== Test mysql-server =====

root@Arduino:~# mysql -uroot -p
Enter password:
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
+--------------------+
3 rows in set (0.00 sec)
mysql> exit
bye


===== Flush Prifileges =====

root@WebServer:~# ps|grep mysqld
13635  root  25848 S  /usr/bin/mysqld
13659  root   1492 S  grep mysqld

root@WebServer:~# kill 13635 (PID Number of mysql)
root@WebServer:~# /etc/init.d/mysqld start

lanjut di edisi TA ane wahaha
kali ini mau coba install mysql di openwrt. Step by Step sebenarnya udah ada di wiki. Ini cuma kopas dan hanya pelengkap blog :p
opkg update
opkg install libpthread libncurses libreadline mysql-server

sed -i 's,^datadir.*,datadir = /srv/mysql,g' /etc/my.cnf
sed -i 's,^tmpdir.*,tmpdir = /tmp,g' /etc/my.cnf
mkdir -p /srv/mysql
mysql_install_db --force
/etc/init.d/mysqld start
/etc/init.d/mysqld enable
mysqladmin -u root password 'new-password'
untuk menjalankan mysql dengan php
opkg update
opkg install php5-mod-mysql
ed -i 's,;extension=mysql.so,extension=mysql.so,g' /etc/php.ini

*note
ketika mencoba untuk melakukan koneksi antara php dan mysql, muncul error
Can’t connect to local MySQL server through socket ‘/tmp’ (146)
solusinya cuma ganti nama host dari locahost ke 127.0.0.1


================ TAMBAHAN ===============

OpenWrt Mysql-Server Install

opkg update
opkg install mysql-server
/usr/bin/mysqld –skip-grant-tables&
mysql -uroot
SET PASSWORD FOR root@’localhost’ = PASSWORD(‘password’);
UPDATE mysql.user SET Password=PASSWORD(‘newpwd’) WHERE User=’root’;
FLUSH PRIVILEGES;
exit
ps |grep mysqld
kill PIDNUMBEROFMYSQL
/etc/init.d/mysqld start
Share:

[OpenWRT] Print Server

Sepanjang liburan kemarin punya rencana ingin mencoba menggunakan router yang sudah saya flash dengan OpenWRT yang saya beri nama WhiteBox untuk membuat sebuah printer server, dimana dapat memudahkan saya untuk melakukan printing dari jarak jauh tanpa saya harus bawa - bawa laptop atau harus disalin ke removable media terlebih dahulu.

Sore hari tadi baru ada waktu untuk mencoba hal tersebut, walaupun sedikit malas namun karena "selo" tetep saya coba saja, entah apa hasilnya. Langkah umumnya dapat anda lihat disini p910nd Printer. Karena saya memang lagi malas, saya hanya melakukan langkah - langkah garis besarnya saja.

Install USB driver


opkg update
opkg install kmod-usb-printer
Lakukan pengecekan dengan mengetikan "dmesg" atau "logread" cek apakah usb sudah terdeteksi. "lsusb -v" untuk lebih lengkapnya.
Lakukan pemasangan p910nd
opkg update
opkg install luci-app-p910nd (file p910nd sudah include didalamnya)
 (* Kalau terlanjur install p910nd sebelum luci-app-p910nd, silahkan hapus dulu p910nd serta  luci-app-p910nd. lalu hapus folder p910nd-opkg dengan perintah rm -f /etc/config/p910nd-opkg).

Saya lebih suka konfigurasi lewat LuCI sih, lebih mudah saja konfigurasi lewat GUI. Jika anda menginginkanya juga, silahkan pasang "luci-app-p910nd" pada LuCI anda. Setelah terpasang, menu printer akan muncul pada tab Services. Jika belum keluar silahkan restart router.

Coba anda cek pada folder /dev apakah ada port lp0 terbuka? Jika tidak, cek apakah ada folder usb dan didalamnya terdapat lp0? Jika ya, maka pada menu LuCI silahkan targetkan interface ke /dev/usb/lp0. Bidirectional Mode pada Printer Canon iP2770 akan membuat printer macet, silahkan hilangkan centangnya.

Konfigurasi pada Server sudah selesai. Sekarang waktunya konfigurasi pada Client.

Perhatikan langkah berikut yang saya ambil dari situs resmi OpenWRT :


Windows 7
  1. Click on the Start button and select Devices and Printers.
  2. Click on "Add a printer."
  3. In the Add Printer dialog select "Add a local printer."
  4. Select "Create a new port:" and set the type of port to "Standard TCP/IP Port". Then click Next.
  5. In the "Hostname or IP address:" field enter the IP address of your router.
  6. The "Port name:" field may be set to something you like.
  7. De-select "Query the printer and automatically select the driver to use," then click next.
  8. The computer will then attempt to detect the TCP/IP port. This will take some time and will most likely fail. Failing this step is not a problem.
  9. On the "Additional port information required" page set the device type to Custom and click "Settings…"
  10. Verify the Printer Name or IP Address. The Protocol should be set to "Raw" and the Raw Settings Port Number should be 9100. Leave LPR Settings and SNMP Status Enabled empty or de-selected. Then click OK.
  11. Select the correct printer driver and click next. You may need to install drivers if they are not already available.
  12. Finish the remaining printer installation wizard steps as needed. The printer should now be installed and working!

Silahkan dicek dengan mencoba print halaman test page default printer. Kemudian ketik "logread" pada routernya untuk melihat responya. Gambar dibawah ini adalah hasil yang saya dapat ketika berhasil melakukan print. 


Jika anda sudah berhasil ngeprint, silahkan coba beberapa kali print terlebih dahulu untuk mengetahui apakah masih ada error atau bug - bug yang muncul. Finally, inilah curhatan dan hasil karya tadi sore :)
Share:

Visitor

Popular Posts

Labels

Recent Posts

sponsor

MitraTIK menangani perbaikan Komputer, Printer, Installasi Jaringan, Installasi CCTV dan Pembuatan Aplikasi Berbasis Web. Untuk jasa perbaikan dan installasi panggilan, kami melayani panggilan ke rumah, kantor, dan sekolah anda yang berada di area Banjarbaru, Martapura dan sekitarnya.

Popular Post