0

In case 1, I cannot see the cgi script executed output in browser and see source code instead. However, in case 2, with similar configuration i can see the cgi script executed output in browser.

Case 1: Ubuntu Version : Ubuntu 14.04 LTS Apache Version : Server version: Apache/2.4.7 (Ubuntu) Server built: Apr 3 2014 12:20:28

PHP Version : PHP 5.5.9-1ubuntu4.3 (cli) (built: Jul 7 2014 16:36:58) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by
Zend Technologies

I dont not have httpd installed on this machine. Hence, no httpd.conf

Case 2: I have a similar machine configuration where the cgi-script works perfectly fine: Ubuntu Version : Ubuntu 14.04.2 LTS Apache Version : Server version: Apache/2.4.7 (Ubuntu) Server built: Jul 24 2015 17:25:11 PHP Version : PHP 5.5.9-1ubuntu4.9 (cli) (built: Apr 17 2015 11:44:57) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies

Here, cgi script works as expected. Even though no httpd.

Please let me know what am I missing and how to resolve this issue.

7
  • can you grep http process? no httpd.conf does not mean httpd is not running. Oct 14, 2015 at 6:07
  • also do netstat -ntulp | grep 80 and share the output. Oct 14, 2015 at 6:12
  • Case 1: tcp6 0 0 :::8085 :::* LISTEN 1249/apache2 tcp6 0 0 :::80 :::* LISTEN 1131/jsvc.exec tcp6 0 0 :::8080 :::* LISTEN 1249/apache2 tcp6 0 0 :::8081 :::* LISTEN 1249/apache2 udp6 0 0 fe80::250:56ff:fe93:123 :::* 1443/ntpd
    – Tanvi
    Oct 14, 2015 at 6:17
  • Case 2: tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 1480/postgres tcp6 0 0 :::80 :::* LISTEN 2049/apache2
    – Tanvi
    Oct 14, 2015 at 6:17
  • there is apache(httpd) running on port 80. your httpd is not configured correctly on the directory where you only see CGI as the source code, hence the CGI is not being executed. Oct 14, 2015 at 6:18

1 Answer 1

1

Didnt need to make any configuration changes.

Following commands worked for me:

sudo a2enmod cgi

sudo service apache2 restart

1
  • that the problem you did not activate CGI module. actually you made the configuration change by running a2enmod. Oct 14, 2015 at 11:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .