<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- hanimaulisya_main_Blog1_1x1_as --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-8462904462266240" data-ad-slot="1837331217" data-ad-format="auto"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>

Merubah Folder/Lokasi Default Webserver dan Pengaturan Htaccess Apache di Linux Ubuntu Via Terminal (Document Root)

Menggunakan Ubuntu, Linux, Apache, Nano

Buka terminal

sudo nano /etc/apache2/sites-available/000-default.conf


Ubah script /var/www/html sesuai kebutuhan

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html


misalkan


        ServerAdmin webmaster@localhost
        DocumentRoot /var/www

karena saya ingin agar webserver menindeks seluruh isi folder www


Periksa di atas tulisan </VirtualHost>

apakah sudah ada script ini ? ini untuk htaccess

<Directory "/var/www/html">
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all

</Directory>
Jika belum, tambahkan..
sesuaikan

 <Directory "/var/www/html"> sesuai dengan DocumentRoot yang sudah diubah (DocumentRoot terbaru)

Simpan Perubahan


Ctrl+X

Y

Enter

Lalu restart apachenya dengan

sudo /etc/init.d/apache2 restart
Masukkan perintah untuk rewrite dan mengaktifkan htaccess

sudo a2enmod rewrite

Problem Solved, cara ini bekerja dengan baik...

Previous
Next Post »

Adsense