> For the complete documentation index, see [llms.txt](https://benhurott.gitbook.io/appsecben/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://benhurott.gitbook.io/appsecben/tools/local-web-server.md).

# Local web server

How to start a simple web server

Python

```bash
python -m http.server $PORT
# ex: python -m http.server 8040
```

PHP

```bash
php -S localhost:$PORT -t $DIR
# ex: php -S localhost:8000 -t /var/lib/www
```

RUBY

```bash
ruby -run -e httpd . -p $PORT
# ex: ruby -run -e httpd . -p 8080
```

NC

```bash
while true ; do nc -l 80 <$HTMLFILE ; done 
# while true ; do nc -l 80 <index.html ; done 
```
