K.MIURA@OUC

The special secret of making dreams come true can be summarized in four C’s. They are Curiosity, Confidence, Courage, and Constancy. –Walt Disney

nginxと連携してPythonを動かす

[基本環境]
  • Ubuntu 18.04
  • nginx 1.14
[注意]
  • PythonでCGIは…と思う人にはお勧めしません
[nginxとfcgiwrapのインストール]
  1. sudo apt update
  2. sudo atp upgrade
  3. sudo apt install python3 nginx-full fcgiwrap vim
  4. sudo vi /etc/nginx/fcgiwrap.conf
  5. cd /var/www
  6. sudo mkdir cgi-bin
  7. sudo chmod 755 cgi-bin
  8. sudo vi /etc/nginx/sites-availabel/default
    server{…}の中に、include fcgiwrap.conf; を追加する
  9. sudo service nginx restart
  10. sudo service fcgiwrap restart
  11. cd cgi-bin
  12. sudo vi test.py
  13. sudo chmod 755 test.py
[CGIの動作確認]
  1. http://IPアドレス/cgi-bin/test.py

Share