Setelah pindah agama ke Arch Linux, install web server rada-rada manual dan gak serba otomatis kayak di ubuntu. Tapi ya tetep harus jalan :D

Siapin dulu si pacman

Ini si pacman harus ada dalam keadaan prima, cek, update repository, kalau perlu update system :D

$ sudo pacman -Syu

Setelah semua selesai, lanjut ke tahap selanjutnya.

Install apache

Apache itu . . . . web server, udah gitu aja...

$ sudo pacman -S apache

Selanjutnya setting apache

$ sudo nano /etc/httpd/conf/httpd.conf

Nah, ini rada ribet.... kudu teliti dan ikuti satu per satu.

  1. Comment baris LoadModule unique_id_module modules/mod_unique_id.so contoh:
    #LoadModule unique_id_module modules/mod_unique_id.so
  2. Restart apache
    $ sudo systemctl restart httpd
  3. Terus buka localhost di browser, kalau gak ada tampilan error, ya berarti berhasil.

Install mysql

Satu-satunya cara install mysql (gak satu-satunya sih) yaitu:

$ sudo pacman -S mysql

Terus start mysql service

$ sudo systemctl start mysqld

Setelah selesai, selesaikan proses installasi mysql

sudo mysql_secure_installation

Nah, nanti akan muncul beberapa pertanyaan wawancara kerja dari mysql, ikuti pola di bawah ini aja:

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y                                            
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

Install PHP

Caranya?

$ sudo pacman -S php php-apache

Kalau udah selesai, kenalin ini PHP ke apache, buka file httpd.conf terus tambah beberapa baris konfigurasi.

$ sudo nano /etc/httpd/conf/httpd.conf

Copy paste aja nih

# Use for PHP 5.x:
LoadModule php5_module       modules/libphp5.so
AddHandler php5-script php
Include conf/extra/php5_module.conf

Tahap akhir, restart lagi httpd / apache

$ sudo systemctl restart httpd

Selesai :D

Disclaimer: tulisan ini dibuat dalam keadaan mengantuk. Sekian.