Showing posts with label webserver. Show all posts
Showing posts with label webserver. Show all posts

20 April 2013

Cara Download File Yang Tidak Bisa Wget

simpan file php di server yang akan mengambil file (download)

<?php
if ($_GET[xfer]) {
if ($_POST[from] == "") {
print "You forgot to enter a url.";
} else {
copy("$_POST[from]", "$_POST[to]");
$size = round((filesize($_POST[to])/1000000000000000), 3);
print "transfer complete.<br>
<a><a href=\"$_POST[from]\">$_POST[from]</a><br>
<a><a href=\"$_POST[to]\">$_POST[to]</a> : $size MB";
}
} else {
print "<form action=\"$PHP_SELF?xfer=true\" method=post>
from(http://): <input name=from><br>
to(filename): <input name=to><br>
<input type=submit value=\"transload\">";
}
?>


from(http://): isi file yang akan di download
to(filename): nama filenya

kemudian klik transload
ok.

7 March 2013

Cara mengaktifkan mod_rewrite apache

mod_rewrite sangat di perlukan untuk yang sering make .htacces
langsung saja

cari lokasi file mod_rewrite.so

locate mod_rewrite.so

dan letaknya di

/usr/lib/apache2/modules/mod_rewrite.so

selanjutnya masuk ke direktori mods-enabled

cd /etc/apache2/mods-enabled


buat file rewrite.load

nano rewrite.load

masukan code berikut


LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

selanjutnya edit file

/etc/apache2/sites-available/default 


nano /etc/apache2/sites-available/default

cari code None


Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

ubah menjadi all

Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all


simpan kemudian restart apache

/etc/init.d/apache2 restart

selesai..




source

24 January 2013

Memberi owner www-data pada file di /var/www

ketikan di terminal

sudo chown www-data:www-data /var/www -R

cd /var/www

sudo find . -type f -exec chmod 644 {} \;

sudo find . -type d -exec chmod 755 {} \;