🔒 Closed Apache2 WebServer Configuring with PHP and PhpMyAdmin in Termux

Status
Not open for further replies.

CPHR

Forum Guru

REQUIREMENTS ​
  • Vim
  • PHP
  • Apache2
  • Php-apache
  • Phpmyadmin
  • MariaDB

INSTALLATION
​
-> pkg update && pkg upgrade -y
-> termux-setup-storage
-> pkg install vim
-> pkg install php
-> pkg install apache2

-> pkg install php-apache
-> pkg install phpmyadmin
-> pkg install mariadb


HTTPD.CONF SET-UP ​

-> cd $PREFIX/etc/apache2
-> vim httpd.conf

// At line 66 add php_module​
Screenshot_2023-02-05-20-54-48-033_com.termux.png
LoadModule php_module libexec/apache2/libphp.so
// At line 67 uncomment mpm_prefork_module by removing # sign​
Screenshot_2023-02-05-20-55-05-421_com.termux.png
// At line 68 comment mpm_worker_module by putting # sign​
Screenshot_2023-02-05-20-55-20-236_com.termux.png
// At line 231, change DENIED to GRANTED ​
Screenshot_2023-02-05-17-27-13-257_com.termux.png
// Locate your internal storage folder to set as an Apache2 web directory​
Ex.
Screenshot_2023-02-05-21-00-06-023_bin.mt.plus.png
PS. Dito ka ilalagay ang mga source code mo
// At line 246 and 247 paste the path of your folder​
Screenshot_2023-02-05-17-30-13-093_com.termux.png
// At line 505 uncomment virtual hosts​
Screenshot_2023-02-05-17-36-35-366_com.termux.png
// At line 533 add handler to read PHP​
Screenshot_2023-02-05-17-40-25-477_com.termux.png
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
// At the bottom, line 541, include php_module config​
Screenshot_2023-02-05-17-41-59-738_com.termux.png
Include etc/apache2/extra/php_module.conf

Save



HTTPD-VHOSTS.CONF SET-UP
​
// I assume that you're still in this directory $PREFIX/etc/apache2​
-> cd extra
-> touch php_module.conf
-> vim httpd-vhosts.conf

For First Virtual Host
// At line 25, DocumentRoot. Paste the path of your Apache2 web directory​
// At line 26, ServerName. Set it as LOCALHOST
IMG_20230205_211641.jpg
For Second Virtual Host
// At line 34, DocumentRoot. Paste the path of PhpMyAdmin
Default Path:
/data/data/com.termux/files/usr/share/phpmyadmin

// At line 35, ServerName. Set it as 0.0.0.0
IMG_20230205_211705.jpg

Save


CONFIG.INC.PHP SET-UP
​
-> cd ~
-> cd $PREFIX/share/phpmyadmin
-> vim config.inc.php

// At line 16, set blowfish_secret
Screenshot_2023-02-05-18-37-59-573-edit_com.termux.jpg
To get blowfish secret: You do not have permission to view the full content of this post. Log in or register now.
// At line 30, Host. Set it as 127.0.0.1
Screenshot_2023-02-05-18-38-38-759_com.termux.png
// At line 148, SendErrorReports. Set it to NEVER
Screenshot_2023-02-05-19-02-27-812_com.termux.png

Save


CREATING PHPMYADMIN ACCOUNT ​

-> cd ~
-> clear
-> mysqld_safe -u root
-> ctrl + z to stop
-> mysql -u root

-> USE mysql;
-> CREATE USER 'You'reUserName'@'localhost' IDENTIFIED BY 'PasswordMo';
-> GRANT ALL ON ASTERISK.ASTERISK TO 'You'reUserName'@'localhost' WITH GRANT OPTION;

// Symbol ng ASTERISK ha🥰
-> flush privileges;
-> quit
-> clear


TO OPEN APACHE2 WEB​

-> httpd
// Now go to your browser and type
-> localhost:8080
// To stop Apache2
-> killall -9 httpd


TO OPEN PHPMYADMIN​

-> mysqld_safe -u YourUserName -p
// Now go to your browser and type
-> 0.0.0.0:8080
LOGIN YOUR ACCOUNT


// To stop PhpMyAdmin
-> killall -9 mysqld


BOOM SABOGGGGG CP MO🤣
Kidding 😏


Pag nakaabot kayo dito may isang error dyan, may solution nmn po hehe. Itanong nyo nlng kung HOW sa comment section.🥰🥰
 
Status
Not open for further replies.

About this Thread

  • 2
    Replies
  • 1K
    Views
  • 2
    Participants
Last reply from:
CPHR

Trending Topics

Online now

Members online
1,101
Guests online
2,423
Total visitors
3,524

Forum statistics

Threads
2,331,486
Posts
29,258,380
Members
1,149,615
Latest member
jboy123
Back
Top