Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-05-15, 05:51:36

Author Topic: [ASK] Convert Apache URL mod_rewrite to Hiawatha  (Read 6195 times)

0 Members and 1 Guest are viewing this topic.

Offline GentZu

  • Senior Member
  • *
  • Posts: 323
  • Karma: +0/-0
  • Gender: Male
  • yare yare...
    • View Profile
[ASK] Convert Apache URL mod_rewrite to Hiawatha
« on: 2014-10-07, 18:13:54 »
saya ingin test ubah webserver jadi hiawatha only, soalnya saya pakek hiawathaproxy rasanya kok lemot ya...
padahal HDD SSD Chaced, KVM, 8 core, 3GB memory...
tapi masalahnya saya tidak tahu cara mod_expires, setting url mod_rewrite seperti di httaccess apache, block IP dll....
jika htaccessnya seperti di bawah ini rubah url rewrite rule ke hiawtha bagaimana? terus settingnya dimana?

Code: [Select]
Options -Indexes

<IfModule mod_rewrite.c>
RewriteEngine on

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L]

RewriteRule ^p/(.*).html$ pages.php?p=$1 [L]
RewriteRule ^feed/$ feed.php [L]
RewriteRule ^cat/(.*)/([0-9]+).html$ cat.php?id=$1&p=$2 [L]

# Abuse Agent Blocking
RewriteCond %{HTTP_USER_AGENT} ^Zeus [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus\.*Webster [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ZyBorg [NC]
RewriteRule ^.* - [F,L]
# Abuse bot blocking rule end
</IfModule>

<FilesMatch "config.php|include.php">
Order allow,deny
Deny from all
</FilesMatch>

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 5 days"
</IfModule>
## EXPIRES CACHING ##


# BEGIN W3TC Browser Cache
<IfModule mod_deflate.c>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
<IfModule mod_mime.c>
# DEFLATE by extension
AddOutputFilter DEFLATE js css htm html xml
</IfModule>
</IfModule>
# END W3TC Browser Cache

thanks

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: [ASK] Convert Apache URL mod_rewrite to Hiawatha
« Reply #1 on: 2014-10-07, 19:02:26 »
SIlahkan baca 'https://www.hiawatha-webserver.org/manpages' terkait 'UrlToolkit'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline GentZu

  • Senior Member
  • *
  • Posts: 323
  • Karma: +0/-0
  • Gender: Male
  • yare yare...
    • View Profile
Re: [ASK] Convert Apache URL mod_rewrite to Hiawatha
« Reply #2 on: 2014-11-24, 03:27:35 »
nah misal saya sudah punya config sperti ini

Code: [Select]
UrlToolkit {
  Header User-Agent BlackWidow DenyAccess
  Header User-Agent Bolt DenyAccess
  Header ZyBorg DenyAccess

  Match ^/p/(.*).html$ Rewrite /p.php?pages=$1
  Match ^/search/([0-9]+)/(.*)/mp3.html$ Rewrite /s.php?type=a&p=$1&q=$2
  Match ^/search/(.*)/mp3.html$ Rewrite /s.php?type=a&q=$1

  Match ^/(.*)index.php$ Rewrite /$1
}

misalkan itu khusus untuk domaina.com
itu ditaruh di /opt/configs/hiawatha/tpl/custom.domains.conf.tpl kan?
apakah penusan untuk pathnya (Rewrite /p.php?pages=$1) sudah benar? dan otomatis di terapkan pada domaina.com?

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: [ASK] Convert Apache URL mod_rewrite to Hiawatha
« Reply #3 on: 2014-11-24, 03:49:21 »
Letakkan di '/opt/hiawatha/conf/toolkits/genzu1.conf menjadi:
Code: [Select]
UrlToolkit {
  ToolkitID = genzu1
  Header User-Agent BlackWidow DenyAccess
  Header User-Agent Bolt DenyAccess
  Header ZyBorg DenyAccess

  Match ^/p/(.*).html$ Rewrite /p.php?pages=$1
  Match ^/search/([0-9]+)/(.*)/mp3.html$ Rewrite /s.php?type=a&p=$1&q=$2
  Match ^/search/(.*)/mp3.html$ Rewrite /s.php?type=a&q=$1

  Match ^/(.*)index.php$ Rewrite /$1
}

kemudian buat file /home/<user>/<domain.com/.hiawatha dengan isi:
Code: [Select]
useToolkit = genzu1
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: [ASK] Convert Apache URL mod_rewrite to Hiawatha
« Reply #4 on: 2014-11-24, 04:05:12 »
Bisa juga anda install dengan 'yum install hiawatha-addons -y; cp -f /opt/hiawatha/urltoolkit/*.conf /opt/configs/hiawatha/conf/toolkits/*.conf' maka beberapa 'contoh' urltoolkit akan di-copy-kan dan siap dipakai.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline GentZu

  • Senior Member
  • *
  • Posts: 323
  • Karma: +0/-0
  • Gender: Male
  • yare yare...
    • View Profile
Re: [ASK] Convert Apache URL mod_rewrite to Hiawatha
« Reply #5 on: 2014-11-24, 04:15:31 »
ini dia yg saya cari, udah pingin move on ke hiawatha only tp msih bingung di modrewrite sama setting ssl...
kalau untuk setting ssl sendiri di letakkan pada .conf yang mana?

untuk codenya seperti ini kah?

Binding {
Port = 443
SSLcertFile = /path/to/ssl.pem
}

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: [ASK] Convert Apache URL mod_rewrite to Hiawatha
« Reply #6 on: 2014-11-24, 04:26:59 »
Ada masalah apa dengan SSL?. Apa tidak bisa melalui panel. Di Kloxo-MR 7, ssl bisa dibuat per-domains tanpa perlu IP tersendiri. Jadi, share IP tapi beda-beda ssl.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline GentZu

  • Senior Member
  • *
  • Posts: 323
  • Karma: +0/-0
  • Gender: Male
  • yare yare...
    • View Profile
Re: [ASK] Convert Apache URL mod_rewrite to Hiawatha
« Reply #7 on: 2014-11-24, 04:55:10 »
ya saya tidak bisa pakek ssl jika di set ke hiawathaproxy ataupun hiawatha only...
untuk selain hiawtha masih bisa walaupun ada sedikit masalah seperti halnya disini http://forum.mratwork.com/kloxo-mr-technical-helps/comodo-ssl-problem-with-nginxproxy/msg38775/#msg38775

Offline GentZu

  • Senior Member
  • *
  • Posts: 323
  • Karma: +0/-0
  • Gender: Male
  • yare yare...
    • View Profile
Re: [ASK] Convert Apache URL mod_rewrite to Hiawatha
« Reply #8 on: 2014-11-24, 06:28:50 »
ehhh kenapa ya setiap saya masukkan file .hiawatha di atas selalu 500 Internal Server Error, sudah saya celanup bahkan reboot...

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: [ASK] Convert Apache URL mod_rewrite to Hiawatha
« Reply #9 on: 2014-11-24, 06:32:14 »
Bisa jadi URLToolkit anda salah. Coba saja isikan 'useToolkit = wordpress'. Ingat, .hiawatha hanya berisi 'useToolkit = wordpress' saja.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline GentZu

  • Senior Member
  • *
  • Posts: 323
  • Karma: +0/-0
  • Gender: Male
  • yare yare...
    • View Profile
Re: [ASK] Convert Apache URL mod_rewrite to Hiawatha
« Reply #10 on: 2014-11-24, 06:39:47 »
hasilnya sama internal server error

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: [ASK] Convert Apache URL mod_rewrite to Hiawatha
« Reply #11 on: 2014-11-24, 06:43:44 »
Informasikan 'dir -l /opt/hiawatha/conf/toolkits'
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline GentZu

  • Senior Member
  • *
  • Posts: 323
  • Karma: +0/-0
  • Gender: Male
  • yare yare...
    • View Profile
Re: [ASK] Convert Apache URL mod_rewrite to Hiawatha
« Reply #12 on: 2014-11-24, 06:48:20 »
dir: cannot access /opt/hiawatha/conf/toolkits: No such file or directory

lho kok malah  /opt/hiawatha/conf/toolkits ?

ternyata saya salah masukkan folder ke  /opt/configs/hiawatha/conf/toolkits, tp setelah saya masukan yg benar ttp internal 500
« Last Edit: 2014-11-24, 06:53:30 by GentZu »

Offline GentZu

  • Senior Member
  • *
  • Posts: 323
  • Karma: +0/-0
  • Gender: Male
  • yare yare...
    • View Profile
Re: [ASK] Convert Apache URL mod_rewrite to Hiawatha
« Reply #13 on: 2014-11-24, 06:54:25 »
# dir -l /opt/hiawatha/conf/toolkits
total 4
-rw-r--r-- 1 root root 1538 Nov 24  2014 seourl.conf


Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: [ASK] Convert Apache URL mod_rewrite to Hiawatha
« Reply #14 on: 2014-11-24, 07:02:28 »
Maaf, yang benar adalah ' /opt/configs/hiawatha/conf/toolkits'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

 


Top 10 Social Networking:    Facebook    Twitter    LinkedIn    Pinterest    Google Plus    Tumblr    Instagram    VK    Flickr    Vine
Click Here

Page created in 0.026 seconds with 22 queries.

web stats analysis