Table of Content


Hello all. I hope everyone that is reading this, is having a really good day.

I decide to share my ordinary log, about setting up LAMP stack which is very common.

With special customization

  • OpenRC instead of systemd

  • MariaDB instead of MySQL

  • Manjaro pacman instead of debian-based apt-get.



Before you read this, you might want to check the holy arch wiki.



$ sudo pacman -S apache mariadb php php-apache phpmyadmin apache-openrc mysql-openrc

$ sudo apachectl start

$ sudo rc-update add httpd default
 * service httpd added to runlevel default

$ sudo rc-update add mysql default
 * service mysql added to runlevel default

[browser: test]


Basic Apache Configuration

[editor: /etc/httpd/conf/httpd.conf]

# epsi!
LoadModule mpm_prefork_module modules/
LoadModule php5_module modules/

# comment out
#LoadModule mpm_event_module modules/

# uncomment
LoadModule rewrite_module modules/

# epsi!
ServerName localhost

<IfModule mime_module>
    # ...    
 # epsi !
 AddType application/x-httpd-php .php
 AddType application/x-httpd-php-source .phps

# epsi!
Include conf/extra/php5_module.conf

[editor: /usr/lib/tmpfiles.d/]

d /run/httpd 0755 http http -


$ sudo rc-service httpd restart

Localhost Test


$ sudo sh -c 'echo "<html><body>miauw</body><html>" > /srv/http/hello.html'
$ sudo sh -c 'echo "<html><body>miauw</body><html>" > /srv/http/hello.php'
$ sudo sh -c 'echo "<?php phpinfo(); ?>" > /srv/http/phpinfo.php'

[browser: test]

http://localhost/hello.html http://localhost/hello.php http://localhost/phpinfo.php


$ sudo /usr/bin/mysqld_safe --datadir='/var/lib/mysql'

[editor: /etc/mysql/my.cnf]

# The MariaDB server
port = 3306
socket = /run/mysqld/mysqld.sock

# epsi !
user        = mysql
basedir     = /usr
datadir     = /var/lib/mysql
pid-file    = /run/mysql/
$ sudo rc-service mysql restart
 * Checking mysqld configuration for mysql ...                    [ ok ]
 * Starting mysql ...
 * /run/mysql: creating directory
 * /run/mysql: correcting owner 
$ cd /media/Works/Backup.Temp/
$ mysql -u root < sf_book2.sql
$ mysql -u root < joomla30.sql




$ sudo touch ls /etc/httpd/conf/extra/phpmyadmin.conf

[editor: /etc/httpd/conf/extra/phpmyadmin.conf]

Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"
<Directory "/usr/share/webapps/phpMyAdmin">
    DirectoryIndex index.php
    AllowOverride All
    Options FollowSymlinks
    Require all granted

[editor: /etc/httpd/conf/httpd.conf]

# epsi!
# phpMyAdmin configuration
Include conf/extra/phpmyadmin.conf

[editor: /etc/php/php.ini]

# set
date.timezone = "Asia/Jakarta"

# uncomment

# add directory
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps/


$ cat /etc/webapps/phpmyadmin/ | less

$ sudo rc-service httpd restart

[browser: test]


Local Host

[editor: /etc/httpd/conf/httpd.conf]

<Directory "/srv/http">
    # change
    AllowOverride All


$ cd /srv/http
$ sudo ln -s /media/Works/Development/www/symfony2/book2/ book2
$ sudo ln -s /media/Works/Development/www/drupal/ drupal
$ sudo ln -s /media/Works/Development/www/sites/ sites

$ sudo rc-service httpd restart

Virtual Host


$ sudo mkdir /etc/httpd/conf/vhosts
$ sudo touch /etc/httpd/conf/vhosts/localhost.conf
$ sudo touch /etc/httpd/conf/vhosts/book2.conf

[editor: /etc/hosts]

#<ip-address>   <>   <hostname>       localhost       axioo       book2       localhost.localdomain   localhost
::1             localhost.localdomain   localhost

[editor: /etc/httpd/conf/vhosts/localhost.conf]

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot /srv/http

[editor: /etc/httpd/conf/vhosts/book2.conf]

<VirtualHost *:80>

    ServerName book2
    DocumentRoot /media/Works/Development/www/symfony2/book2/web
    DirectoryIndex app.php
    ErrorLog /var/log/httpd/book2.log
    CustomLog /var/log/httpd/book2.log common

    <Directory "/media/Works/Development/www/symfony2/book2/web">
        AllowOverride All
     Require all granted

[editor: /etc/httpd/conf/httpd.conf]

# epsi!
# Enabled Vhosts:
Include conf/vhosts/localhost.conf
Include conf/vhosts/book2.conf

[editor: /etc/php/php.ini]

# uncomment

# add folder
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps/:/media/Works/Development/www/


$ sudo rc-service httpd restart
$ httpd -S

LAMP Browser



Have a nice dream.