Configure your apache2 Web server ,for termux
When you install apache2 in termux,you need to configure it, to make it work properly
Install.sh is modified by HiFiiDev He created a more beautiful script than me.
git clone https://github.com/thelearn-tech/Apache-configure
cd Apache-configure
chmod +x install.sh
./install.sh
Just follow the steps--
nano /data/data/com.termux/files/user/etc/apache2/httpd.conf
now scroll down to Listen 8080
(Use ctrl+f to move cursor forward and ctrl+b to backwards) (Use arrow keys ,if you have , like I do)
And change Listen 8080 to Listen 0.0.0.0:8080
Now changed index.html to htdocs
then y
And enter
So configuration is done
To put your own stuff ,move that file or folder with mv
So mv (folder/file) /data/data/com.termux/files/usr/share/apache2/default-site/htdocs
So your server at 127.0.0.1:8080 or localhost:8080
Default directory is /data/data/com.termux/files/usr/share/apache2/default-site/htdocs You can change in httpd.conf file
cd /data/data/com.termux/files/usr/etc/apache2
nano httpd.conf
Scroll down to
Change DocumentRoot to your like ,as I have
And Directory to same as DocumentRoot
When Apache server is running you can go to http://localhost:8080 or http://127.0.0.1:8080
Or you can use your public IP address for example http://168.198.0.1:8080
Type ifconfig in you termux to get your IP or go to you settings
If you copy don't forget to give me credit