H29KF

            How I Learned to Stop Worrying and Love PHP.
            
            inspired by some blog on robotics and
            Stanley Kubrick movie, 1964 

Setting up Websites with Webmin
-------------------------------

First, prepare virtual machine with Arch-Anywhere (easy way) connected to a VirtualBox Nat network (10.0.2.4 in my case).

  $ ip addr show
  ...
  2: enp0s3:..
      inet 10.0.2.4/24..

Install LAMPP on Arch-Anywhere [1]

1. Update/upgrade pacman

  # pacman -Syyu

2. Apache

  $ sudo pacman -S apache
  $ sudo vi /etc/httpd/conf/httpd.conf
  # Comment out
  # LoadModule unique_id_module modules/mod_unique_id.so
  $ sudo systemctl restart httpd
  # vi /etc/hosts
  127.0.0.1       localhost.localdomain   localhost   myhost
  # systemctl restart httpd
  # vi /srv/http/index.html
  <html><title>Test</title>
  <body><h2>Apache on Arch..</h2></body>
  </html>

On some other Nat networked machine locate "myhost" with nmap

  $ nmap -sP 10.0.2.0/24
  
then test apache as http://10.0.2.4

3. MySQL

  # pacman -S mysql
  # mysql_install_db --user=mysql --basedir=/usr --ldata=/var/lib/mysql/
  # systemctl start mysqld
  # systemctl status mysqld
  
4. PHP

  # pacman -S php php-fpm php-apache
  # systemctl start php-fpm.service
  # systemctl status php-fpm.service

insert some rows into /etc/httpd/conf/httpd.conf

  LoadModule php7_module       modules/libphp7.so
  AddHandler php7-script php
  Include conf/extra/php7_module.conf
  
also

  #LoadModule mpm_event_module modules/mod_mpm_event.so
  LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

then:

  systemctl restart httpd
  systemctl status httpd
  
Create test page for PHP

  # vi /srv/http/info.php
  <?php
      phpinfo();
  ?> 

On client (10.0.2.15, Linux-Mint 18.1 inmy case) add to /etc/hosts

  10.0.2.4  myhost
  
and restart networking (or reboot)

5. Make it permanent

  # sudo systemctl enable mysqld httpd
  Created symlink 
    /etc/systemd/system/multi-user.target.wants/mariadb.service ->
    /usr/lib/systemd/system/mariadb.service.
  Created symlink 
    /etc/systemd/system/multi-user.target.wants/httpd.service ->
    /usr/lib/systemd/system/httpd.service.

6. Install webmin

  # pacman -Sy perl perl-net-ssleay 
  # wget -c http://prdownloads.sourceforge.net/webadmin/webmin-1.831.tar.gz
  # tar xf webmin-1.831.tar.gz
  # cd webmin-1.831
  # ./setup.sh # all default, user:password admin:nimda
  
7. Test stuff on client:

  http://myhost/info.php
  https://myhost:10000
  
8. Create and test some virtual hosts using Webmin. Read this:

  https://www.serverpronto.com/kb
  /page.php?id=Setting+up+Websites+with+Webmin
  https://www.serverpronto.com/kb
  /page.php?id=Setting+Up+DNS+Using+Webmin
  https://myhost:10000/
  https://www.serverpronto.com/kb
  /page.php?id=Setting+FTP+access+using+Webmin+%26+SSH

Notes
-----

Networking on arch
http://www.mylinuxguide.com/apache-is-running-a-threaded-mpm-but-your-php-module-is-not-compiled-to-be-threadsafe/
  systemctl restart systemd-networkd

Links
-----

[1]. https://www.digitalocean.com/community/tutorials
     /how-to-install-linux-apache-mysql-php-lamp-stack-on-arch-linux
     
[2]. /etc/hosts on Arch
     http://www.faqs.org/docs/securing/chap9sec95.html
     
[3]. http://www.mylinuxguide.com/apache-is-running-a-threaded-mpm-but-
     your-php-module-is-not-compiled-to-be-threadsafe/