lampTermux icon indicating copy to clipboard operation
lampTermux copied to clipboard

Creating local domains.

Open matveyb9 opened this issue 1 year ago • 3 comments

Hello, dear developers. Please tell me how to create a local domain, for example site.local.

matveyb9 avatar Aug 21 '24 04:08 matveyb9

You need to have a DNS and then create a Virtual Host on the web server. For example, I'm using Laragon in my Windows operating system. They work with creating a domain name at /etc/hosts (this is a local domain on your system)

image

and then creating a Virtual Host that mapping the local domain to the correct php location (in this I'm using a Nginx web server)

image

NOTE: Here an example if creating a Virtual Host using Apache as Web Server image

But now the problem is how android / termux can edit the /etc/hosts. I don't know what if you make a DNS Server and then create an A record that pointing to the IP Address of your phone, then create a Virtual Host at the web server for the mapping to the correct php location

armandwipangestu avatar Aug 21 '24 04:08 armandwipangestu

Please tell me how to create a virtual domain in Termux

matveyb9 avatar Aug 21 '24 08:08 matveyb9

Bro, mobile phones are locked, you can't edit the hosts file there.

you can only do it if you have rooted your phone

mondij avatar Dec 23 '24 09:12 mondij