我想通过flask和lighttpd远程控制Raspberry Pi 3B+。
我想通过网络控制遥控车。
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-pip
sudo pip install flask
sudo apt-get install lighttpd
sudo apt autoremove
在上述命令之后,/var/www/html
文件夹被创建。另外,lighttpd.conf
创建于 /etc/lighttpd/
.但是,index.lighttpd.html
不是在 /var/www/html
中创建的.所以即使我在web上打开localhost,lighttpd也出不来。我已经尝试了很多东西。初始化sd卡后我又试了几次。我直接通过'git clone'收到了lighttpd文件,没有使用pip,但结果是一样的。
sudo apt-get install python3-flask
server.document-root = "/var/www/html"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/var/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
server.port = 80
我应该怎么办?
最佳答案
echo "<html><body>Hello World!</body></html>" > /var/www/html/index.html
它是您的 Web 服务器实例。您需要配置要提供的内容。我建议阅读 https://wiki.lighttpd.net/ 上的 lighttpd 文档
关于python - var/www/html 中没有 index.lighttpd.html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70206800/