4 ms·
python3 -m http.server
by Cyphase 6y ago
python3 -m http.server
- MaxBarraclough 6y agoTo specify the port number explicitly: python3 -m http.server 8080 (Listening on port 80 may require more privileges.)
- vault 6y agoDefault is 8000
- catswithtail 6y agothe default one is port 8000 so permission should be no problem.
- otachack 6y agoCan also tack on an optional `-d directory_name` to be specific on where to serve from. It's my go to when developing my blog which consists of just HTML+CSS.
- Cyphase 6y ago(To answer the various questions, here's the --help. Also the docs are at https://docs.python.org/3/library/http.server.html#http-server-cli https://docs.python.org/3/library/http.server.html#http-serv...) --- $ python3.7 -m http.server --help usage: server.py [-h] [--cgi] [--bind ADDRESS] [--directory DIRECTORY] [port] positional arguments: port Specify alternate port [default: 8000] optional arguments: -h, --help show this help message and exit --cgi Run as CGI Server --bind ADDRESS, -b ADDRESS Specify alternate bind address [default: all interfaces] --directory DIRECTORY, -d DIRECTORY Specify alternative directory [default:current directory]