如何在docker中运行CGI文件

如何在docker中运行CGI文件

.yml

  apache:
    build: apache/
    links:
      - php:phpfpm
    devices:
      - "/dev/ttyUSB0:/dev/ttyUSB0"
    volumes:
      - ./public:/var/www
      - ./apache/hosts:/etc/apache2/sites-enabled
      - ./log:/var/log/apache2
    ports:
      - 8181:80

虚拟主机

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        ScriptAlias /cgi-bin /var/www/reader_cgi.git/cgi-bin/
        <Directory /var/www/reader_cgi.git/cgi-bin/>
                Header set Access-Control-Allow-Origin "*"
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

索引文件

#!/usr/bin/perl
print "Content-Type: text/html\n\n";
print "Hello World";

错误日志

    [Thu Nov 28 10:14:04.040274 2019] [cgid:error] [pid 9:tid 140520978339584] [client 172.24.0.1:35584] End of script output before headers: index.cgi

相关内容