MRatWork Forum by Mustafa Ramadhan - Seting .htaccess untuk multiphp dan rewrite url

Sponsor:
Server and Web Integrator
Link:
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:

MRatWork Forum | Please login or register. | 2017-11-07, 22:35:18

- MRatWork Forum by Mustafa Ramadhan »
- Language Specific Discussions »
- Indonesia Users »
- Seting .htaccess untuk multiphp dan rewrite url

« previous next »

- Print

Pages: [1] 2 Go Down

### Author Topic: Seting .htaccess untuk multiphp dan rewrite url (Read 2872 times)

0 Members and 1 Guest are viewing this topic.

#### ar1246

- Senior Member
- Posts: 234
- Karma: +0/-0
- Gender:

##### Seting .htaccess untuk multiphp dan rewrite url

« on: 2015-12-27, 11:51:03 »
pak saya udah coba multiphp nya
defaultnya php56
di salah satu domain saya coba alih ke versi php lain dg set handler
Code: [Select]

    <FilesMatch \.php$>
    #SetHandler x-httpd-php
    #SetHandler x-httpd-php52
    SetHandler x-httpd-php53
    #SetHandler x-httpd-php54
    #SetHandler x-httpd-php55
    #SetHandler x-httpd-php56
    </FilesMatch>

jalan lancar pake phpinfo juga
tapi pas d campurin sama rewrite url kok Error 500 - Internal Server Error
Code: [Select]

    <FilesMatch \.php$>
    #SetHandler x-httpd-php
    #SetHandler x-httpd-php52
    SetHandler x-httpd-php53
    #SetHandler x-httpd-php54
    #SetHandler x-httpd-php55
    #SetHandler x-httpd-php56
    </FilesMatch>
    ///
    RewriteEngine On
    RewriteBase /

    RewriteRule ^$ index.php [QSA,L]
    RewriteRule ^index.html$ index.php [QSA,L]
    RewriteRule ^pendaftaran.html$ register.php [QSA,L]
    RewriteRule ^cekdata.html$ register_verified.php [QSA,L]
    RewriteRule ^selesai.html$ register_send.php [QSA,L]
    RewriteRule ^cetak.html$ register_cetak.php [QSA,L]
    RewriteRule ^pendaftar.html$ register_list.php [QSA,L]
    RewriteRule ^cetakulang.html$ register_cetakulang.php [QSA,L]
    RewriteRule ^formulir.html$ register_cetakulang2.php [QSA,L]
    RewriteRule ^persyaratan.html$ persyaratan.php [QSA,L]
    RewriteRule ^jadwal.html$ jadwal.php [QSA,L]
    RewriteRule ^kontak.html$ kontak.php [QSA,L]
    RewriteRule ^sukses.html$ kirim.php [QSA,L]
    RewriteRule ^alur-pendaftaran.html$ alur.php [QSA,L]

    ###Start Kloxo PHP config Area

    ### begin content - please not remove this line

    ### MR -- using php version different with default php
    ### 1. Using suphp
    ### - Copy between '#<FilesMatch \.php$>' to '#</FilesMatch>' and
    ###   then remove '#' from '#<FilesMatch', '#</FilesMatch>' and one of '#SetHandler'

    #<FilesMatch \.php$>
    	#SetHandler x-httpd-php
    	#SetHandler x-httpd-php52
    	#SetHandler x-httpd-php53
    	#SetHandler x-httpd-php54
    	#SetHandler x-httpd-php55
    	#SetHandler x-httpd-php56
    #</FilesMatch>

    ### OR

    ### 2. Using fcgid
    ### - Copy from '#Options' to '#FCGIWrapper' and
    ###   then remove '#' for one of '#FCGIWrapper'

    #Options +ExecCGI
    #<FilesMatch \.php$>
    #	SetHandler fcgid-script
    #</FilesMatch>
    #FCGIWrapper /home/kloxo/client/php.fcgi .php
    #FCGIWrapper /home/kloxo/client/php52.fcgi .php
    #FCGIWrapper /home/kloxo/client/php53.fcgi .php
    #FCGIWrapper /home/kloxo/client/php54.fcgi .php
    #FCGIWrapper /home/kloxo/client/php55.fcgi .php
    #FCGIWrapper /home/kloxo/client/php56.fcgi .php

    ### end content - please not remove this line

    ###End Kloxo PHP config Area

Logged

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: Seting .htaccess untuk multiphp dan rewrite url

« Reply #1 on: 2015-12-27, 13:50:53 »
Kalau pakai yang fcgid daripada suphp untuk multiple-php di .htaccess bagaimana?.
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

#### ar1246

- Senior Member
- Posts: 234
- Karma: +0/-0
- Gender:

##### Re: Seting .htaccess untuk multiphp dan rewrite url

« Reply #2 on: 2016-01-03, 07:45:01 »
Lapor pak, pake yg fcgid lancar
multi PHP lancar
rewrite url lancar
Logged

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: Seting .htaccess untuk multiphp dan rewrite url

« Reply #3 on: 2016-01-03, 08:07:03 »
Ini karena ada feature .htaccess yang di-tolak oleh suphp.
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

#### ar1246

- Senior Member
- Posts: 234
- Karma: +0/-0
- Gender:

##### Re: Seting .htaccess untuk multiphp dan rewrite url

« Reply #4 on: 2016-01-03, 08:12:04 »
Owh gitu pak
Bener bener mantap kloxo mr nya pak
Logged

#### Wibowo

- Master
- Posts: 391
- Karma: +0/-0
- Gender:

##### Re: Seting .htaccess untuk multiphp dan rewrite url

« Reply #5 on: 2016-01-06, 00:26:05 »
kalo pakai php-fpm gimana cara pakai multiphp nya?
Logged

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: Seting .htaccess untuk multiphp dan rewrite url

« Reply #6 on: 2016-01-06, 01:37:54 »
Quote from: Wibowo on 2016-01-06, 00:26:05

> kalo pakai php-fpm gimana cara pakai multiphp nya?

Belum bisa.
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

#### Wibowo

- Master
- Posts: 391
- Karma: +0/-0
- Gender:

##### Re: Seting .htaccess untuk multiphp dan rewrite url

« Reply #7 on: 2016-01-06, 02:39:59 »
Quote from: MRatWork on 2016-01-06, 01:37:54

> Quote from: Wibowo on 2016-01-06, 00:26:05

> > kalo pakai php-fpm gimana cara pakai multiphp nya?

> Belum bisa.

berarti harus pilih fcgi atau suphp ya pak?
mana yg lebih baik pak terutama dari sisi keamanan?
Logged

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: Seting .htaccess untuk multiphp dan rewrite url

« Reply #8 on: 2016-01-06, 02:54:29 »
Sekarang ini, hanya apache yang bisa untuk multiple php. Pilih 'php-fpm_event' pada 'php type'. Php versi lain bisa digunakan oleh website untuk setiap directory-nya.
Fcgid lebih cepat daripada suphp.
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

#### Wibowo

- Master
- Posts: 391
- Karma: +0/-0
- Gender:

##### Re: Seting .htaccess untuk multiphp dan rewrite url

« Reply #9 on: 2016-01-08, 14:54:56 »
Quote from: MRatWork on 2016-01-06, 02:54:29

> Sekarang ini, hanya apache yang bisa untuk multiple php. Pilih 'php-fpm_event' pada 'php type'. Php versi lain bisa digunakan oleh website untuk setiap directory-nya.
> Fcgid lebih cepat daripada suphp.

saya iseng2 coba php70 kloxomr pak
di htaccess folder, saya coba pakai ini
Code: [Select]

    <FilesMatch \.php$>
    	#SetHandler x-httpd-php
    	#SetHandler x-httpd-php52
    	#SetHandler x-httpd-php53
    	#SetHandler x-httpd-php54
    	#SetHandler x-httpd-php55
    	#SetHandler x-httpd-php56
    	SetHandler x-httpd-php70
    </FilesMatch>

Code: [Select]

    [root@aljazari script]# sh /script/sysinfo
    A. Kloxo-MR: 7.0.0.b-2016010501
       - Web: hiawatha-10.0.0-f.6.mr.el6.i686
       - PHP: php54s-5.4.45-2.w6 (cgi mode)
    B. Plateform:
       - OS: CentOS release 6.7 (Final) i686
       - Hostname: aljazari.hostmikro.com
    C. Services:
       1. MySQL: MariaDB-server-10.0.23-1.el6.i686
       2. PHP:
          - Branch: php55u-cli-5.5.30-1.ius.el6.i686
          - Multiple:
            * php55m-5.5.30-1.ius.el6
            * php56m-5.6.16-1.ius.el6
            * php70m-7.0.0-1.w6
          - Used: --Use PHP Branch--
       3. Httpd: httpd-2.2.31-1.mr.el6.i386
          - PHP Type: php-fpm_event
       4. Lighttpd: --uninstalled--
       5. Hiawatha: --unused--
       6. Nginx: nginx-1.9.9-1.el6.ngx.i386
       7. Cache: --uninstalled--
       8. Dns: bind-9.9.7-1.mr.el6.i386
       9. Qmail: qmail-toaster-1.03-1.3.55.mr.el6.i386
          - with: courier-imap-toaster-4.1.2-1.3.18.mr.el6.i386
    D. Memory:
                    total       used       free     shared    buffers     cached
       Mem:           498        437         61          1         19        229
       -/+ buffers/cache:        189        309
       Swap:            0          0          0
    E. Disk Space:
       Filesystem      Size  Used Avail Use% Mounted on
       /dev/vda1        20G  2.4G   17G  13% /

    *** Process Time: 00:00:00:03.3927 (dd:hh:mm:ss:xxxxxx) ***

    * Note: run 'sh /script/sysinfo -y' if you want run 'fix-service-list' also
            (importance after Kloxo-MR update)

waktu eksekusi file php, kok malah di display sebagai plaintext ya pak?
tapi kalo saya pakai SetHandler x-httpd-php55 atau SetHandler x-httpd-php56 file php bisa di eksekusi normal
Logged

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: Seting .htaccess untuk multiphp dan rewrite url

« Reply #10 on: 2016-01-08, 15:29:10 »
Anda harus install dulu php70m. Pakai saja 'sh /script/phpm-all-install'.
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

#### Wibowo

- Master
- Posts: 391
- Karma: +0/-0
- Gender:

##### Re: Seting .htaccess untuk multiphp dan rewrite url

« Reply #11 on: 2016-01-08, 15:51:15 »
Quote from: MRatWork on 2016-01-08, 15:29:10

> Anda harus install dulu php70m. Pakai saja 'sh /script/phpm-all-install'.

saya sudah install pak
dengan directive ini di .htaccess
Code: [Select]

    <FilesMatch \.php$>
    	SetHandler x-httpd-php70
    <FilesMatch \.php$>

masih tidak bisa eksekusi php
ditampilkan di browser berupa teks
sedangkan dengan
Code: [Select]

    Options +ExecCGI
    <FilesMatch \.php$>
    SetHandler fcgid-script
    </FilesMatch>
    FCGIWrapper /home/kloxo/client/php70.fcgi .php

sudah bisa pak
dan ternyata file /home/kloxo/client/php70.fcgi missing
saya buat manual, isinya sama seperti file phpXY.fcgi
Code: [Select]

    #!/bin/sh

    php_rc='/opt/php70m/custom/php.ini'
    php_scan='/opt/php70m/etc/php.d'
    php_prog='/opt/php70m/usr/bin/php-cgi'

    #export PHPRC=$php_rc
    export PHP_INI_SCAN_DIR=$php_scan
    export PHP_FCGI_CHILDREN=6
    export PHP_FCGI_MAX_REQUESTS=1000

    exec $php_prog -c $php_rc $*

satu lagi masalahnya pak
kalo di .htaccess ada directive switch php, maka script php tidak bisa tulis ke folder
misal kalo wordpress
tidak bisa menulis ke wp-content/ jika ada directive untuk switch php
« Last Edit: 2016-01-08, 16:10:13 by Wibowo »
Logged

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: Seting .htaccess untuk multiphp dan rewrite url

« Reply #12 on: 2016-01-08, 16:21:15 »
Apa tidak bisa tulis berlaku untuk suphp dan fcgid atau cuma salahsatunya saja?.
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

#### Wibowo

- Master
- Posts: 391
- Karma: +0/-0
- Gender:

##### Re: Seting .htaccess untuk multiphp dan rewrite url

« Reply #13 on: 2016-01-08, 17:44:58 »
Quote from: MRatWork on 2016-01-08, 16:21:15

> Apa tidak bisa tulis berlaku untuk suphp dan fcgid atau cuma salahsatunya saja?.

jadi gini pak pertama saya coba pake suphp
terus di htacces saya tambah
Code: [Select]

    <FilesMatch \.php$>
    	SetHandler x-httpd-php70
    <FilesMatch \.php$>

hasilnya php gak dieksekusi, yg keluar plain text (baris coding phpnya)
kemudian gantian saya coba pake fcgid (switch ke fcgid event/worker)
di htaccess saya tambah
Code: [Select]

    Options +ExecCGI
    <FilesMatch \.php$>
    SetHandler fcgid-script
    </FilesMatch>
    FCGIWrapper /home/kloxo/client/php70.fcgi .php

hasilnya php jalan, tapi semua folder jadi 'unwriteable'
misal di wordpress, gak bisa upload gambar dan template karena gak bisa nulis ke folder wp-content
permission harus 777 baru bisa write
kalo gak pake switching apapun
(berarti versi php mengikuti 'used php' kan?)
php bisa jalan, dan bisa tulis ke folder wp-content
permission file 644 folder 755 bisa write
itu error dimana ya pak?
Logged

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: Seting .htaccess untuk multiphp dan rewrite url

« Reply #14 on: 2016-01-08, 18:45:25 »
Apa semuanya ('php used', suphp dan fcgid) sama versi phpnya?.
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

- Print

Pages: [1] 2 Go Up
« previous next »

- MRatWork Forum by Mustafa Ramadhan »
- Language Specific Discussions »
- Indonesia Users »
- Seting .htaccess untuk multiphp dan rewrite url

MRatWork Affiliates: BIGRAF(R) Inc. House of LMAR EFARgrafix

..:: Monetize your Website or Blog with BidVertiser ::.. ..:: Sell your ad space with BidVertiser ::..

- Design By SMFSimple.com
- SMF 2.0.14 | SMF © 2017, Simple Machines

Page created in 0.039 seconds with 17 queries.

Mirror created by MasterkinG32.CoM