Search notes:

Script: websrv

websrv starts a webserver whose content root directory is the current directory. This script comes as Shell script, batch file and PowerShell script.

Shell script

port=${1:-80}

if [ $port -lt 1024 ]; then
  sudo=sudo
else
  local sudo=""
fi

$sudo python3 -m http.server $port
Github repository scripts-and-utilities, path: /websrv

Batch file

@rem  --------------------------------------------------------------------------------------
@rem  --- U  n  i  f  o  r  m    S  e  r  v  e  r                                        ---
@rem  --- Command line arguments for Uniform Server:                                     ---
@rem  --- http://www.uniformserver.com/ZeroXI_documentation/command_line_parameters.html ---
@rem  ---                                                                                ---
@start    c:\tools\UniServerZ\UniController.exe start_both
@rem  --------------------------------------------------------------------------------------


@rem  --------------------------------------------------------------------------------------
@rem  --- HTTP::Server::Simple::CGI                                                      ---
@rem  @%github_root%PerlModules\HTTP\Server\Simple\CGI\webserver.pl
@rem  --------------------------------------------------------------------------------------
Github repository scripts-and-utilities, path: /websrv.bat

PowerShell script

 # python -m http.server 80
 py -m http.server 80
Github repository scripts-and-utilities, path: /websrv.ps1
Update 2022-07-12: call with py rather than python.

See also

The Perl Module HTTP::Server::Simple::CGI
Scripts

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758206517, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/tools/scripts/personal/websrv(84): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78