Test Block Top

The Blog...
Articles, Tips & Trick and Other Interesting Information...

09 Februari 2012

Website Tidak Bisa Dibuka Meskipun Modul mod_rewrite On

Beberapa hari yang lalu saya coba installkan blog wordpress teman pada vps. Setting permalink saya set ke "Custom Structure → /%category%/%postname%/", file .htaccess baru sudah otomatis tersetup namun ketika test buka halaman posting website error (Not Found).

Berikut Solusinya:

Cek dulu apakah modul mod_rewrite sudah aktif pada webserver apache, login ssh & ketikkan command:

apachectl -M

[bash highlight="6"]
[root@victor ~]# apachectl -M
Loaded Modules:
...
...
alias_module (shared)
rewrite_module (shared)
...
...
cgi_module (shared)
version_module (shared)
...
...
python_module (shared)
ssl_module (shared)
Syntax OK
[/bash]

Jika modul rewrite sudah aktif (rewrite_module (shared))baris ke-6 pada code di atas, kemungkinan AllowOverride pada file konfigurasi apache (httpd.conf) masih di set ke "None" (AllowOverride None).

Edit value "AllowOverride None" ke "AllowOverride All" pada file httpd.conf (/etc/httpd/conf/httpd.conf) untuk semua dokumen root direktori (biasanya "/var/www/html") → lihat baris ke-17 pada code di bawah.

[apache highlight="17"]
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/html"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
[/apache]

Restart apache daemon:

[bash collapse="false"]
[root@victor ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@victor ~]#
[/bash]

Selesai, refresh halaman yang tadinya tidak bisa di buka (Not Found).

Tidak ada komentar:

Posting Komentar

Loncat ke Atas ↑