Isnin, 17 Mac 2014

3837. Bagaimana untuk membolehkan mod_rewrite untuk Apache web server.

بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيمِ  , الْحَمْدُ لِلَّهِ رَبِّ الْعَالَمِينَ , الرَّحْمَنِ الرَّحِيمِ ,  مَالِكِ يَوْمِ الدِّينِ , إِيَّاكَ نَعْبُدُ وَإِيَّاكَ نَسْتَعِينُ , اهْدِنَا الصِّرَاطَ المُسْتَقِيمَ  , صِرَاطَ الَّذِينَ أَنْعَمْتَ عَلَيْهِمْ , غَيْرِ المَغْضُوبِ عَلَيْهِمْ وَلاَ الضَّالِّينَ.


Assalamualaikum w.b.t/السَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُه

Meja www.peceq.blogspot.com 

How to enable mod_rewrite for Apache web server

I've installed two Content Management Systems on my Debian wheezy system - WordPress and Drupal. The web server deployed is the venerable Apache. Common to the 2 deployments is the issue of how to enable the mod_rewrite module for the Apache web server.
The rewrite module maps obscure URLs - computer gibberish - to 'clean' URLs. The default URLs, for both WordPress and Drupal, are something like http://localhost/wordpress/?p=248.
You can configure the URLs to be rewritten to resemble the post titles: http://localhost/wordpress/a-board-game/. However, the change won't take effect unless the mod_rewrite module is enabled.

QUERY MODULE STATUS

To check if mod_rewrite is currently enabled:
  1. Create a PHP script to list the enabled Apache modules, and place it in the Document Root directory (by default:/var/www):
    $ cat > /var/www/testmod.php
    <?php
    print_r(apache_get_modules());
    ?>
    
  2. Run the script by entering http://localhost/testmod.php into a browser.
If the mod_rewrite module is enabled, you will find it in the output of the PHP script.

ENABLE REWRITE

To enable:
  1. Enable mod_rewrite module.
    $ a2enmod rewrite
    Enabling module rewrite.
    To activate the new configuration, you need to run:
      service apache2 restart
    
  2. Set AllowOverride to All in Apache configuration files.Apache configuration files contain directives to control web server behavior. The configuration directive we're interested in is AllowOverride. For Debian wheezy, look for the directive in /etc/apache2/sites-available/default.
    $ more /etc/apache2/sites-available/default
        ..snipped..
     <?Directory /var/www/>
      Options Indexes FollowSymLinks MultiViews
      AllowOverride None
      Order allow,deny
      allow from all
     <?/Directory>
        ..snipped..
    
    When the AllowOverride directive is set to None for a directory, then Apache ignores all .htaccess files in that directory and in its sub-directories.
    The .htaccess files are 'directory-level' Apache configuration files. Web applications such as WordPress and Drupal have a.htaccess file in their respective web directories.
    In the above example, AllowOverride is set to None for/var/wwww, the Document Root directory. Therefore, all.htaccess files are ignored in the entire web hierarchy.
    Modify AllowOverride to have value All.
     <?Directory /var/www/>
      Options Indexes FollowSymLinks MultiViews
      AllowOverride All
      Order allow,deny
      allow from all
     <?/Directory>
    
  3. Restart Apache.
    $ service apache2 restart
    [ ok ] Restarting web server: apache2 ... waiting .
    

DISABLE REWRITE

To disable:
$ a2dismod rewrite
Module rewrite disabled.
To activate the new configuration, you need to run:
  service apache2 restart
$ service apache2 restart
[ ok ] Restarting web server: apache2 ... waiting .
Sumber: (http://linuxcommando.blogspot.com/2014/03/how-to-enable-modrewrite-for-apache-web.html

Meh kita tengok...
Sesungguhnya kerajaan tidak pernah belajar diatas kesilapan masa lalu.....
Huh...sungguh cilaka bumi ini mempunyai mereka yg tidak memikirkan rakyat.....

GEMPAR DAN LAGI MRNGEMPARKAN............
BUNG MOKHTAR DEDAH KEMATIAN DI FESTIVAL FUTURE MUSIC BUKAN KALI PERTAMA.....
APA YG KEMENTERIAN FIKIRKAN......OWH MALAYSIA KU MASIH AMAN DAN SEJAHTERA......
BELIA BEBAS TANPA DADAH......HAK PUI.....
Pencuri pasport bebas kuar masuk malaysia itu fakta.....
Suka ·  · 



Ikuti
Yang mana satu agaknya
Suka ·  · 


MH370: Amerika Syarikat kaitkan dengan serangan 11 September..??

Orang ni at Orang ni - 9 hours ago
WASHINGTON - Bekas Timbalan Setiausaha Negara Amerika Syarikat, Strobe Talbott mendakwa kehilangan pesawat MH370 yang disyaki angkara pengganas mungkin akan untuk melakukan serangan menyerupai 9 September di India. Berikut adalah dakwaannya menerusi Twitter, semalam: ‘Misteri pesawat Malaysia: Faktor arah, kapasiti minyak menjurus kepada rampasan pesawat, perampas mungkin merancang melakukan serangan menyerupai 9 September di India’. Beliau berkata, pesawat itu mungkin terhempas seperti rampasan pesawat UA 93 pada 2001. Terdahulu, beliau menjelaskan menerusi tweet bahaw... more »

Lupakan sebentar MH370,Najib Rosmah ke Pavilion ,beli-belah.

mantaro at SISI BUKIT - 9 hours ago
While everyone is worry about MH370, this was what our Prime Minister doing~shopping with family at Pavillion!; Seluruh dunia risau tentang MH370, Perdana Menteri kita sibuk membeli-belah bersama keluarga di Pavillion!; 全世界担心着MH370, 我们的首相忙著购物!

How to enable mod_rewrite for Apache web server

Peter Leung at Linux Commando - 10 hours ago
I've installed two Content Management Systemson my Debian wheezy system - WordPress and Drupal. The web server deployed is the venerable Apache. Common to the 2 deployments is the issue of how to enable the *mod_rewrite*module for the Apache web server. The rewrite module maps obscure URLs - computer gibberish - to 'clean' URLs. The default URLs, for both WordPress and Drupal, are something like *http://localhost/wordpress/?p=248*. You can configure the URLs to be rewritten to resemble the post titles: *http://localhost/wordpress/a-board-game/*. However, the change won't take e... more »
Blogger Home. 
s3v3n

s3v3n
copyright©

Tiada ulasan: