【问题标题】:Can't run a c++ cgi on Kubuntu 10. Checked all apache configurations+exec+cgi-bin+api无法在 Kubuntu 10 上运行 c++ cgi。检查了所有 apache 配置+exec+cgi-bin+api
【发布时间】:2012-11-20 19:21:45
【问题描述】:

我正在尝试使用 Apache2 在 kubuntu 10 上编译我的第一个 c++ cgi 程序,但没有。

我已经把它放到 cgi-bin 文件夹中检查了配置文件,在命令上运行程序,将权限更改为可执行,但什么也没有。 Rekonq 说“没有服务可以处理这个文件”

我已经安装了 apache2。也重启了。坚果

现在已经一整天了,绝望了。如果你有任何想法,会救我

我的 cgi-bin 位于 etc/apache2/。 我的配置文件@etc/apache2/sites-enabled/000-default 对于另一个答案,这些是 Kub10-12 的作者

您可以在此屏幕截图中查看所有配置和执行。也复制到这里 http://img832.imageshack.us/img832/1659/cgiv.jpg

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

【问题讨论】:

    标签: c++ apache2 cgi ubuntu-10.10


    【解决方案1】:

    问题是您正试图通过文件系统(使用file:// URL)直接访问您的 CGI 程序,这意味着 Apache 没有为您的请求提供服务。

    改为使用 URL http://localhost/cgi-bin/cplusplus.cgi 连接到在 localhost 上运行的 Apache。

    【讨论】:

    • 天哪,它有效!当然,就像使用 PhP 脚本一样,多么愚蠢和愚蠢!非常感谢您打扰这么愚蠢的问题,再次感谢您打扰回复!!!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-04
    • 1970-01-01
    • 1970-01-01
    • 2015-05-11
    • 2013-09-25
    相关资源
    最近更新 更多