Hosting & Domaining Forum

Hosting Discussion => Specialty Hosting and Markets => Topic started by: CreativeDreamrz on Aug 21, 2022, 07:08 AM

Title: Set Up a Web Server on Your Phone using Nginx and Termux
Post by: CreativeDreamrz on Aug 21, 2022, 07:08 AM
Sometimes your smartphone becomes outdated or unusable, like when the screen breaks or it slows down. However, the phone still has valuable hardware that can be repurposed for household use.

(https://www.businessinsider.in/photo/84549556/Heres-how-to-know-if-your-phone-is-h%D0%B0cked.jpg)

 For instance, even an old phone has 4-8 cores, 2-4 GB RAM, and a battery backup unit- all comparable to some computers. One option is to install a Linux environment on the phone with software that performs useful tasks in the background. This can include setting up a file storage or backup server using Syncthing, which syncs files across multiple devices in real-time without requiring a central server.

Alternatively, a more serious solution is to use UrBackup, which constantly monitors folders to back up and is preferable when managing backups on a network of computers. Installation of UrBackup requires a Linux environment, which can be installed via Linux Deploy or Termux. A rooted phone is necessary for this process. With these options, you can easily repurpose your old smartphone for household use.

Additional thoughts: It's important to consider repurposing electronics instead of throwing them away when they no longer suit their original purpose. Not only does this reduce waste and contribute to environmental sustainability, but it can also save money by finding new ways to use existing technology.

Connecting HDD/SSD to smartphones can be done directly via USB cable, but it increases the risk of I/O errors during copying. To increase reliability and stability, it's better to use a USB hub with an Ethernet adapter, which provides higher speed and allows for a cable connection instead of WiFi. To mount an HDD to a phone, make it available to the operating system as a logical drive rather than a physical device to avoid name changes after a reboot. You can do this on a rooted phone using Linux Deploy and BusyBox APK files, selecting the Linux distribution, architecture, installation path, image size, file system, and setting login and password.

Alternatively, Termux is a free console emulator and Linux environment for Android that installs like a regular app without requiring root access. It includes many Linux operating system packages and can run almost any Linux program. For instance, you can install a file server or backup server like UrBackup or Nginx using the apt package manager.
Title: Re: Android smartphone into a web server
Post by: Zora2012 on Aug 21, 2022, 07:45 AM
Many people keep old smartphones or tablets that are still functional but no longer suitable for their intended purpose. Rather than throwing them away, they can be repurposed for other uses. For example, if the screen is broken or the battery doesn't hold charge, the device can still be used as a second camera or for other non-intensive tasks.
One idea is to use such devices to display advertisements and earn money from ad impressions. However, finding an application that serves solely for displaying ads on the screen can be challenging. It can be an interesting project to create an app that allows users to earn money from displaying ads on their old devices, similar to a "mining screen" concept where ad networks pay for impressions.
Title: Re: Android smartphone into a web server
Post by: HarshMehra on Aug 21, 2022, 07:54 AM
Old smartphones can be repurposed for video surveillance, but they may not have enough power to handle other tasks. The devices can overheat when streaming video over wifi. The primary issue with old devices is that they are often irreparable and require makeshift solutions. For instance, batteries can swell up and no longer fit into the phone, requiring alternate solutions such as starting the device from USB power.

Additionally, the built-in storage may also degrade over time, causing the system response time to increase and resulting in ANR errors. It would be easy for manufacturers to solve these issues, but they choose not to. Repurposing old devices can be a great way to reduce waste, but it's important to consider their limitations and potential drawbacks before relying on them.
Title: Re: Android smartphone into a web server
Post by: vietnamstyle89 on Oct 21, 2022, 02:23 AM
Setting up old devices for various projects can be time-consuming and require extensive knowledge of software and hardware. It can be challenging to find compatible firmware and drivers, especially for older models without up-to-date package lists. Additionally, diagnosing problems with custom-built devices can also be complicated.

As a solution, it may be more practical to purchase an old nettop or mini PC for a reasonable price. These devices typically have standard BIOS and bootloader settings, come with reliable storage options like SATA 2.5, and can run a full-fledged Linux operating system with all necessary updates. Selling old smartphones for their intended use may also be a simpler and more practical solution. By considering the pros and cons of repurposing old devices, it's possible to find the best approach for each individual circumstance.
Title: Re: Set Up a Web Server on Your Phone using Nginx and Termux
Post by: jina on Jan 28, 2024, 09:33 AM
If you're thinking of turning your smartphone into a portable web server, this task requires a step-by-step approach.
Firstly, you need to install the Termux app on your Android device, which provides a Linux environment. Once installed, you can use the built-in package manager to install Nginx, a powerful web server known for its performance and stability. After Nginx is installed, you can configure it to serve web content from your phone.

Next, you'll need to set up port forwarding on your router to allow external traffic to reach your phone. This involves configuring your router to forward incoming requests on a specific port to your phone's local IP address. This step is crucial for making your web server accessible from the internet.

Once the port forwarding is set up, you can start serving web pages, applications, or files directly from your phone. You may also want to consider securing your web server by obtaining an SSL certificate and configuring HTTPS to encrypt the traffic between your server and its clients.

It's important to note that hosting a web server on your phone can have limitations, such as power consumption and network connectivity issues. However, it can also be a useful tool for development, testing, or sharing content in environments where traditional web hosting may not be available.
Setting up a web server on your phone using Nginx and Termux can be a creative and educational endeavor, offering a unique way to explore web development and server management.
Title: Re: Set Up a Web Server on Your Phone using Nginx and Termux
Post by: VasancityAcadamey on Mar 08, 2024, 02:00 AM
To set up a web server on your phone using Nginx and Termux:

1. Install Termux from the app store.
2. Use Termux to install the Nginx package by running 'pkg install nginx'.
3. Start the Nginx server with 'nginx' and verify its status.
4. Place your website files in the '/data/data/com.termux/files/usr/share/nginx/html/' directory.
5. Access your phone's IP address on a browser to view your hosted website.
Title: Re: Set Up a Web Server on Your Phone using Nginx and Termux
Post by: alexcray on Mar 27, 2024, 10:22 PM
Quote from: Zora2012 on Aug 21, 2022, 07:45 AMMany people keep old smartphones or tablets that are still functional but no longer suitable for their intended purpose. Rather than throwing them away, they can be repurposed for other uses. For example, if the screen is broken or the battery doesn't hold charge, the device can still be used as a second camera or for other non-intensive tasks.
One idea is to use such devices to display advertisements and earn money from ad impressions. However, finding an application that serves solely for displaying ads on the screen can be challenging. It can be an interesting project to create an app that allows users to earn money from displaying ads on their old devices, similar to a "mining screen" concept where ad networks pay for impressions.

Consider working with a developer or exploring low-code app creation platforms if you don't have coding experience.
Title: Re: Set Up a Web Server on Your Phone using Nginx and Termux
Post by: alexcray on Apr 04, 2024, 10:52 AM
Quote from: CreativeDreamrz on Aug 21, 2022, 07:08 AMSometimes your smartphone becomes outdated or unusable, like when the screen breaks or it slows down. However, the phone still has valuable hardware that can be repurposed for household use.

(https://www.businessinsider.in/photo/84549556/Heres-how-to-know-if-your-phone-is-h%D0%B0cked.jpg)

 For instance, even an old phone has 4-8 cores, 2-4 GB RAM, and a battery backup unit- all comparable to some computers. One option is to install a Linux environment on the phone with software that performs useful tasks in the background. This can include setting up a file storage or backup server using Syncthing, which syncs files across multiple devices in real-time without requiring a central server.

Alternatively, a more serious solution is to use UrBackup, which constantly monitors folders to back up and is preferable when managing backups on a network of computers. Installation of UrBackup requires a Linux environment, which can be installed via Linux Deploy or Termux. A rooted phone is necessary for this process. With these options, you can easily repurpose your old smartphone for household use.

Additional thoughts: It's important to consider repurposing electronics instead of throwing them away when they no longer suit their original purpose. Not only does this reduce waste and contribute to environmental sustainability, but it can also save money by finding new ways to use existing technology.

Connecting HDD/SSD to smartphones can be done directly via USB cable, but it increases the risk of I/O errors during copying. To increase reliability and stability, it's better to use a USB hub with an Ethernet adapter, which provides higher speed and allows for a cable connection instead of WiFi. To mount an HDD to a phone, make it available to the operating system as a logical drive rather than a physical device to avoid name changes after a reboot. You can do this on a rooted phone using Linux Deploy and BusyBox APK files, selecting the Linux distribution, architecture, installation path, image size, file system, and setting login and password.

Alternatively, Termux is a free console emulator and Linux environment for Android that installs like a regular app without requiring root access. It includes many Linux operating system packages and can run almost any Linux program. For instance, you can install a file server or backup server like UrBackup or Nginx using the apt package manager.
Turn it into a dedicated music or podcast player.  Load it up with your favorite tunes and connect it to a Bluetooth speaker for a portable sound system.
Title: Re: Set Up a Web Server on Your Phone using Nginx and Termux
Post by: alexcray on Apr 15, 2024, 09:13 PM
Quote from: Zora2012 on Aug 21, 2022, 07:45 AMMany people keep old smartphones or tablets that are still functional but no longer suitable for their intended purpose. Rather than throwing them away, they can be repurposed for other uses. For example, if the screen is broken or the battery doesn't hold charge, the device can still be used as a second camera or for other non-intensive tasks.
One idea is to use such devices to display advertisements and earn money from ad impressions. However, finding an application that serves solely for displaying ads on the screen can be challenging. It can be an interesting project to create an app that allows users to earn money from displaying ads on their old devices, similar to a "mining screen" concept where ad networks pay for impressions.

A simple and user-friendly interface to configure ad display settings and track earnings.