Skip to content

MQ4L30NS/lampTermux

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xshin404/lampTermux

:octocat: Hi, i hope this repository useful for web developer but using android

Here are some details about last version i use

  • PHP 8.0.2
  • MariaDB 15.1 Distrib 10.5.8-MariaDB, for Android (armv7-a)
  • Apache 2.4.46 (Unix)
  • phpMyAdmin 5.0.4
PHP MariaDB Apache phpMyAdmin
PHP Version MariaDB Version Apache phpMyAdmin

Size

If you want to see size package installation, run ./package.sh

Package Size
Package Size

Information

  • URL Apache http://localhost:8080
  • Default Port Apache 8080
  • Default MariaDB User mysql -u $(whoami)
  • htdocs PATH $HOME/apache

Overview

Info Login Database
PHP Info phpMyAdmin Login phpMyAdmin

Installation

Termux (Android)
  • $ pkg update && pkg upgrade
  • $ pkg install ncurses-utils git
  • $ git clone https://github.com/xshin404/lampTermux
  • $ cd lampTermux
  • $ chmod +x install.sh
  • $ ./install.sh

⚠️ After installation Restart Termux so that the service-daemon is started and then on first boot type 'lamp' to start service..

Run

Service
  • Apache

Script PATH on /data/data/com.termux/files/usr/bin/lamp

Enable Apache Service Disable Apache Service
Enable Apache Service Disable Apache Service
  • MySQL
Enable MySQL Service Disable MySQL Service
Enable MySQL Service Disable MySQL Service
Web Server Status
  • Index Apache & phpMyAdmin

Script PATH on /data/data/com.termux/files/usr/bin/lamp-check

No Error Error 403 Forbidden
No Error Error 403 Forbidden

User Configuration

Apache
  • htdocs
Custom PATH 'htdocs'
Login Apache

Default PATH htdocs on

246 ...
247 ...
248 ...
249 DocumentRoot "/data/data/com.termux/files/usr/share/apache2/default-site/htdocs"
250 <Directory "/data/data/com.termux/files/usr/share/apache2/default-site/htdocs">
251 ...
252 ...
253 ...

my configuration

246 ...
247 ...
248 ...
249 DocumentRoot "/data/data/com.termux/files/home/apache"
250 <Directory "/data/data/com.termux/files/home/apache">
251 ...
252 ...
253 ...
  • Custom extension file that will be at loaded first
Custom extension file
Login Apache

Default extension file is

279 ...
280 ...
281 ...
282 <IfModule dir_module>
283     DirectoryIndex index.html
284 </IfModule>
285 ...
286 ...
287 ...

my configuration

279 ...
280 ...
281 ...
282 <IfModule dir_module>
283     DirectoryIndex index.php
284 </IfModule>
285 ...
286 ...
287 ...

If you want custom htdocs or extension file that will be at loaded first, change the configuration on file /data/data/com.termux/files/usr/etc/apache2/httpd.conf

Troubleshooting

Apache & PHP
  • PHP isn't loaded, just showing the code
Like This
Not Loaded

Open apache configuration on PATH /data/data/com.termux/files/usr/etc/apache2/httpd.conf

Give comment (#) this text

Comment Text
Login Apache
67 ...
68 ...
69 ...
70 LoadModule mpm_worker_module libexec/apache2/mod_mpm_worker.so
71 ...
72 ...
73 ...

Uncomment this text

Uncomment Text
Login Apache
66 ...
67 ...
68 ...
69 #LoadModule mpm_worker_module libexec/apache2/mod_mpm_worker.so
70 ...
71 ...
72 ...

Add module on last configuration

Add Module
Login Apache
536 ...
537 ...
538 ...
539 LoadModule php_module libexec/apache2/libphp.so
540 AddHandler php-script .php

This module for PHP Version 8

Now restart apache with killall httpd

PHP success loaded
Solved
MySQL
  • Can't login root user because the password didn't know

to fix this, Enable MySQL service

Enable MySQL Service
Enable MySQL Service

After enable MySQL Service, now login mysql with root user.

$ mysql -u $(whoami)

After login, type this on MySQL (To use database mysql)

MariaDB [(none)]> use mysql;

Database changed

MariaDB [(none)]>

To

MariaDB [(mysql)]>

Now setting your root password MySQL you want, with

MariaDB [(mysql)]> set password for 'root'@'localhost' = password('your_password_here');

After setting password for root login, type

MariaDB [(mysql)]> flush privileges;

Exit MySQL, type

MariaDB [(mysql)]> exit; # or quit;

Now your root password has been changed, to login type

$ mysql -u root -p

The password column filled with the newest password

Picture
Picture
phpMyAdmin
  • Access Denied 403 Forbidden
403 Forbidden lamp-check
403 Forbidden 403 Forbidden

If you get this error, change this text on apache configuration /data/data/com.termux/files/usr/etc/apache2/httpd.conf

Require all denied
Require all denied
229 ...
230 ...
231 ...
232 <Directory />
233       AllowOverride none
234       Require all denied
235 </Directory>
236 ...
237 ...
238 ...

To

Require all granted
Require all denied
229 ...
230 ...
231 ...
232 <Directory />
233       AllowOverride none
234       Require all granted
235 </Directory>
236 ...
237 ...
238 ...

Change Require all denied to Require all granted

Don't forget to restart apache with killall httpd

About

LAMP on Android

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%