### Install MyServer on Ubuntu/Linux Source: https://context7.com/rajkumardusad/myserver/llms.txt This snippet outlines the steps to install MyServer on Ubuntu and Debian-based Linux distributions. It includes updating package lists, installing git, cloning the repository, navigating to the directory, making the install script executable, running the installer, and verifying the installation. ```bash # Update package lists sudo apt update # Install git sudo apt install git # Clone the repository git clone https://github.com/rajkumardusad/MyServer.git # Navigate to directory cd MyServer # Make install script executable chmod +x install # Run installer (requires root) sudo sh install # Verify installation myserver --help ``` -------------------------------- ### Start PHP Server (Bash) Source: https://context7.com/rajkumardusad/myserver/llms.txt Launches PHP's built-in development server. If PHP is not installed, MyServer will prompt to install it automatically. It can bind to a specified IP address and port, serving files from a given document root. ```bash # Start PHP server on localhost:8080 with document root at /home/www myserver -s -php localhost 8080 /home/www # Example with custom IP binding for network access myserver -s -php 0.0.0.0 3000 /var/www/mysite # The server outputs: # Starting Server ...... # Press Ctrl+C to stop ``` -------------------------------- ### Install MyServer on Termux (Bash) Source: https://context7.com/rajkumardusad/myserver/llms.txt Provides the steps to install MyServer on Android devices using the Termux terminal emulator. It involves updating package lists, installing git, cloning the repository, and running the installation script. ```bash # Update package lists apt update # Install git apt install git # Clone the repository git clone https://github.com/rajkumardusad/MyServer.git # Navigate to directory cd MyServer # Make install script executable chmod +x install # Run installer sh install # or ./install # After installation, start MyServer: myserver start ``` -------------------------------- ### Launch Interactive Menu (Bash) Source: https://context7.com/rajkumardusad/myserver/llms.txt Starts the interactive menu-driven interface for accessing all MyServer features, including starting servers, hosting, database management, updates, and settings. ```bash # Start MyServer interactive menu myserver start # Menu options: # Type 1 : to start your localhost web server. # Type 2 : to access your website from internet. # Type 3 : to start MySQL Database server. # Type 4 : to manual localhost server. # Type 5 : to manual host. # Type 6 : to update MyServer. # Type 7 : for server setting. # Type 8 : to about us. # Type x : to exit. ``` -------------------------------- ### Manage MySQL Database Server (Bash) Source: https://context7.com/rajkumardusad/myserver/llms.txt Manages the MySQL/MariaDB database server. On Termux, it installs MariaDB, while on Ubuntu/Linux, it installs `mysql-server`. Commands include starting and stopping the server. ```bash # Start MySQL server myserver -db start # Stop MySQL server myserver -db stop # Output when starting: # Starting Server ...... # MySQL Server is running.. ``` -------------------------------- ### Start Nginx Server (Bash) Source: https://context7.com/rajkumardusad/myserver/llms.txt Starts the Nginx web server with custom configuration. MyServer automatically generates nginx.conf based on provided parameters, including IP address, port, and document root. ```bash # Start Nginx server myserver -s -ng localhost 80 /var/www/html # Custom port and document root myserver -s -ng 127.0.0.1 8080 /home/www # Server status output: # Nginx web server is running ..... # Your Server URL is :- http://localhost:8080/ # Press 0 to stop server >> ``` -------------------------------- ### Start Apache Server (Bash) Source: https://context7.com/rajkumardusad/myserver/llms.txt Starts the Apache2 web server using system service commands. It utilizes `apachectl` on Termux and `systemctl` or `service` on Ubuntu/Debian-based Linux distributions. ```bash # Start Apache web server myserver -s apache # Output: # Apache web server is running ..... # Press 0 to stop server >> ``` -------------------------------- ### Start Default Localhost Server (Bash) Source: https://context7.com/rajkumardusad/myserver/llms.txt Starts a localhost server using PHP or Python's built-in HTTP server. It serves files from a specified document root and can bind to a specific IP address. An index.html file is created if none exists. ```bash # Start a localhost server on port 8080 serving files from /home/www myserver -s localhost 8080 /home/www # Start on a specific IP address myserver -s 192.168.1.100 8080 /var/www/html # Start previously configured server (uses saved settings) myserver -s ``` -------------------------------- ### Start Python HTTP Server (Bash) Source: https://context7.com/rajkumardusad/myserver/llms.txt Uses Python 3's built-in http.server module to serve static files. No additional dependencies are required beyond Python 3. It can serve files from a specified directory and bind to all interfaces for LAN access. ```bash # Start Python HTTP server myserver -s -py localhost 8000 /home/www # Bind to all interfaces for LAN access myserver -s -py 0.0.0.0 8000 /home/public_html # Output example: # Starting Server ...... # Your Server URL is :- http://localhost:8000/ ``` -------------------------------- ### Host Server on Internet via SSH Tunnel (Bash) Source: https://context7.com/rajkumardusad/myserver/llms.txt Exposes your localhost server to the internet using SSH tunneling through the `localhost.run` service. Requires OpenSSH to be installed. You can specify a custom domain, local port, and public port. ```bash # Expose localhost:8080 to internet on port 80 myserver -h yourdomain 8080 80 # Example with custom subdomain myserver -h mysite 3000 443 # Resume previous hosting configuration myserver -h # This creates an SSH tunnel: # ssh -R 80:localhost:8080 yourdomain@localhost.run ``` -------------------------------- ### System Detection API in Python Source: https://context7.com/rajkumardusad/myserver/llms.txt The system module in `core/system.py` automatically detects the operating system and sets relevant paths and package manager commands. It provides variables like `pac`, `bpath`, `spath`, and `system` based on the detected environment (e.g., Termux, Ubuntu, Debian). The `exit()` function provides styled output. ```python # System detection variables available after import from core.system import * # On Termux: # pac = "pkg" # bpath = "/data/data/com.termux/files/usr/bin/" # spath = "/data/data/com.termux/files/usr/share/" # system = "termux" # On Ubuntu with sudo: # pac = "sudo apt-get" # bpath = "/usr/bin/" # spath = "/usr/share/" # system = "ubuntu" # On Debian without sudo: # pac = "apt-get" # bpath = "/usr/bin/" # spath = "/usr/share/" # system = "debian" # Exit function with styled output exit() # Displays "Exiting..." and "G00D By..." messages ``` -------------------------------- ### Uninstall MyServer (Bash) Source: https://context7.com/rajkumardusad/myserver/llms.txt Completely removes MyServer from the system, including all associated configuration files. ```bash # Uninstall MyServer myserver rm -t ``` -------------------------------- ### Update MyServer (Bash) Source: https://context7.com/rajkumardusad/myserver/llms.txt Updates the MyServer tool to the latest version available from its repository. ```bash # Update MyServer myserver update ``` -------------------------------- ### Nginx Configuration Generator in Python Source: https://context7.com/rajkumardusad/myserver/llms.txt The `core/nginx.py` module generates Nginx configuration files programmatically. It allows users to specify port, document root, and hostname. The `ngi` function generates `nginx.conf` for Termux, while the `default` function creates a default site configuration for Ubuntu/Linux. ```python from core.nginx import ngi, default # Generate nginx.conf for Termux # Creates nginx.conf file in current directory ngi(port="8080", path="/home/www", host="localhost") # Generated config includes: # - worker_processes: 1 # - worker_connections: 1024 # - Custom server block with specified port, root, and server_name # - Error page handling for 500, 502, 503, 504 # Generate default site config for Ubuntu/Linux # Creates 'default' file for /etc/nginx/sites-available/ default(por="80", path="/var/www/html") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.