Initialisation
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
====== Fournir un service http en Python ======
|
||||
|
||||
{{ informatique:langage:python:do_web_python.png?500|}}
|
||||
Le bout de code suivant permet d’exécuter temporairement un service http (80/tcp) en **Python**.
|
||||
|
||||
Le dossier où vous vous trouvez devient le "BaseHTTP", c'est-à-dire la racine du site accessible en http. Dans l'exemple, il s'agit du dossier ''/tmp/certbot/public_html''.
|
||||
|
||||
Si vous avez déjà un service httpd comme Apache qui fonctionne et occupe déjà le port 80, il faudra veiller à l'arrêter avant.
|
||||
|
||||
<WRAP clear/>
|
||||
|
||||
|
||||
<code python [enable_line_numbers="true"]>
|
||||
mkdir -p /tmp/certbot/public_html/.well-known/acme-challenge
|
||||
|
||||
cd /tmp/certbot/public_html
|
||||
|
||||
printf "%s" asFY_-_9W8N-Z4zPKwXvu5_pBv1kMAC4j3ag7VWFAko.Rj9bJx4j8slMw-Pxkq47MKU3TybtCD4ohJxc6kafaX0 > .well-known/acme-challenge/asFY_-_9W8N-Z4zPKwXvu5_pBv1kMAC4j3ag7VWFAko
|
||||
|
||||
sudo $(command -v python2 || command -v python2.7 || command -v python2.6) -c "import BaseHTTPServer, SimpleHTTPServer; \
|
||||
s = BaseHTTPServer.HTTPServer(('', 80), SimpleHTTPServer.SimpleHTTPRequestHandler); \
|
||||
s.serve_forever()"
|
||||
</code>
|
||||
|
||||
20
data/pages/informatique/langage/python/index.txt
Normal file
20
data/pages/informatique/langage/python/index.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
====== Python ======
|
||||
|
||||
{{ informatique:langage:python:python_sh-600x600.png?300x|Python}}
|
||||
|
||||
|
||||
===== Les pages =====
|
||||
|
||||
<nav stacked="true" fade="true">
|
||||
<nspages . -h1 -nbCol=1 -textNS=" " -textPages=" " -simpleList -exclude:cookie: -exclude:user: -exclude:playground: -exclude:[sidebar index start rightsidebar navbar topheader header help pageheader pagefooter legal-notices footer 404]>
|
||||
</nav>
|
||||
|
||||
===== Les sous-catégories =====
|
||||
|
||||
<nav stacked="true" fade="true">
|
||||
<nspages . -h1 -nbCol=1 -noPages -subns -textNS=" " -textPages=" " -simpleList -exclude:cookie: -exclude:user: -exclude:playground: -exclude:[sidebar index start rightsidebar navbar topheader header help pageheader pagefooter legal-notices footer 404]>
|
||||
</nav>
|
||||
|
||||
|
||||
~~NOTOC~~
|
||||
~~NOCACHE~~
|
||||
Reference in New Issue
Block a user