Turn a $20 Android TV Box Into a Cheap Web Server

  1. Run the following commands in terminal to install Apache HTTPD web server:
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install apache2
  2. Once the installation completes, open a web browser and navigate to http://DNSorIP/ to verify Apache is up and running
  3. Run the following command in terminal to install MySQL/MariaDB
    sudo apt-get install mariadb-server
    sudo mysql_secure_installation
  4. Follow the prompts to change passwords and fix some potential security issues
  5. Once the installation completes, run the following command in terminal to log into MySQL/MariaDB
    sudo su
    mysql -u root -p
    [enter the root password created earlier]
    show databases;
    exit
    exit
  6. Run the following commands in terminal to install PHP
    sudo apt-get install php libapache2-mod-php php-mysql
  7. Once the installation completes, create a file called info.php in /var/html/www and add the following code:
        phpinfo();
    ?>
  8. Open a web browser and navigate to http://DNSorIP/info.php to verify Apache is up and running with PHP support
  9. Run the following commands in terminal to install phpMyAdmin
    sudo apt-get install phpmyadmin
    sudo systemctl restart apache2
  10. Once the installation completes, open a web browser and navigate to http://DNSorIP/phpmyadmin
  11. Run the following commands in terminal to cleanup downloaded packages
    sudo apt-get clean