I am trying to host my cgi page in the Tomcat 7.0.70 webserver in linux box.
I have done the below steps and also I am unable to view my cgi page in the browser.
I have created a CGI script named as "test.pl".
#!/usr/bin/perl
print "Content-type: text/html\n\n";
foreach (sort keys %ENV)
{
print "<b>$_</b>: $ENV{$_}<br>\n";
}
I have created a dir "myprog" in ~/myweb/apache-tomcat-7.0.70/webapps/ path.
Then I have created a dir "WEB-INF" in ~/myweb/apache-tomcat-7.0.70/webapps/myprog/
Then I have created a "cgi" directory inside the "myprog/WEB-INF/" and placed the test.pl file.
Then I have removed the comments from web.xml for the below lines , which is located in ~/myweb/apache-tomcat-7.0.70/conf/
cgi
org.apache.catalina.servlets.CGIServlet
debug
0
cgiPathPrefix
WEB-INF/cgi
5
And, servlet-mapping area as well.
After that I have downloaded the servlets-cgi-4.1.36.jar and servlets-ssi-5.0.16.jar files into ~/myweb/apache-tomcat-7.0.70/lib/
Then, I tried to run the file from my windows machine from the web browser: http://devserver.com/myprog/ and it returns the message as
HTTP Status 404 - /myprog/
type Status report
message /myprog/
description The requested resource is not available.
Apache Tomcat/7.0.70
Please someone assist/suggest to get this resolved.
The server log excerpt that you posted indicates that your web application needs to be privileged to use CGIServlet. In /webapps/myprog/META-INF, add a file context.xml with
<Context privileged="true">
</Context>
Related
So I checked my spam folder today and had 122 messages send through the server stating:
PHP Warning: Module 'imagick' already loaded in Unknown on line 0
Non stop it keeps sending me this.
Googled it and still have no clue on how to fix it as I need a step by step answer.
Found a similar question on stack but it's too complicated for me to understand.
I'm on the latest Plesk Onyx and OS=Ubuntu 16.04.6 LTS‬.
As I'm running php 7.3 I hoped when I uninstalled php 7.0 in plesk it would go away but unfortunately it didn't.
It's send from here
Cron <root#server> [ -x /usr/lib/php/sessionclean ] && /usr/lib/php/sessionclean
And after php --ini (read about it on a forum) this was the result:
PHP Warning: Module 'imagick' already loaded in Unknown on line 0
Configuration File (php.ini) Path: /etc/php/7.0/cli
Loaded Configuration File: /etc/php/7.0/cli/php.ini
Scan for additional .ini files in: /etc/php/7.0/cli/conf.d
Additional .ini files parsed: /etc/php/7.0/cli/conf.d/00-ioncube-loader-7.0.ini,
/etc/php/7.0/cli/conf.d/10-mysqlnd.ini,
/etc/php/7.0/cli/conf.d/10-opcache.ini,
/etc/php/7.0/cli/conf.d/10-pdo.ini,
/etc/php/7.0/cli/conf.d/15-xml.ini,
/etc/php/7.0/cli/conf.d/20-calendar.ini,
/etc/php/7.0/cli/conf.d/20-ctype.ini,
/etc/php/7.0/cli/conf.d/20-curl.ini,
/etc/php/7.0/cli/conf.d/20-dom.ini,
/etc/php/7.0/cli/conf.d/20-exif.ini,
/etc/php/7.0/cli/conf.d/20-fileinfo.ini,
/etc/php/7.0/cli/conf.d/20-ftp.ini,
/etc/php/7.0/cli/conf.d/20-gd.ini,
/etc/php/7.0/cli/conf.d/20-gettext.ini,
/etc/php/7.0/cli/conf.d/20-iconv.ini,
/etc/php/7.0/cli/conf.d/20-imagick.ini,
/etc/php/7.0/cli/conf.d/20-imap.ini,
/etc/php/7.0/cli/conf.d/20-json.ini,
/etc/php/7.0/cli/conf.d/20-mbstring.ini,
/etc/php/7.0/cli/conf.d/20-mysqli.ini,
/etc/php/7.0/cli/conf.d/20-pdo_mysql.ini,
/etc/php/7.0/cli/conf.d/20-pdo_sqlite.ini,
/etc/php/7.0/cli/conf.d/20-phar.ini,
/etc/php/7.0/cli/conf.d/20-posix.ini,
/etc/php/7.0/cli/conf.d/20-readline.ini,
/etc/php/7.0/cli/conf.d/20-shmop.ini,
/etc/php/7.0/cli/conf.d/20-simplexml.ini,
/etc/php/7.0/cli/conf.d/20-sockets.ini,
/etc/php/7.0/cli/conf.d/20-sqlite3.ini,
/etc/php/7.0/cli/conf.d/20-sysvmsg.ini,
/etc/php/7.0/cli/conf.d/20-sysvsem.ini,
/etc/php/7.0/cli/conf.d/20-sysvshm.ini,
/etc/php/7.0/cli/conf.d/20-tokenizer.ini,
/etc/php/7.0/cli/conf.d/20-wddx.ini,
/etc/php/7.0/cli/conf.d/20-xmlreader.ini,
/etc/php/7.0/cli/conf.d/20-xmlwriter.ini,
/etc/php/7.0/cli/conf.d/20-xsl.ini,
/etc/php/7.0/cli/conf.d/20-zip.ini,
/etc/php/7.0/cli/conf.d/zend_extensions_psa.ini
I already know it's probably easily fixed when you know linux but I'm learning on the go and posses very little knowledge yet.
Could anyone assist me with the right commands?
Cheers
Locate where is your php.ini file by:
php -i | grep Configuration
Configuration File (php.ini) Path => /usr/local/etc/php/7.4
Loaded Configuration File => /usr/local/etc/php/7.4/php.ini
Open the php.ini file and remove the line:
extension=imagick.so
or change the line to a comment:
; extension=imagick.so
I installed Composer and a SDK for Mailgun's service. These are the steps i followed:
# current directory
cd ~
# Install Composer
curl -sS https://getcomposer.org/installer | php
# Add Mailgun as a dependency
php composer.phar require mailgun/mailgun-php:~1.7
According to the instructions, all I did after that was (index.php):
<?php
require 'vendor/autoload.php';
use Mailgun\Mailgun;
# First, instantiate the SDK with your API credentials and define your domain.
$mg = new Mailgun("key-my-key-goes-here-987654321");
$domain = "somedomain.com";
Then, I tried to get the list of bounced emails:
$data = $mg->get("$domain/bounces", array('limit' => 15, 'skip' => 0));
var_dump($data);
...and I'm getting this error:
Warning: require(vendor/autoload.php): failed to open stream: No such
file or directory in /var/www/html/index.php on line 2 Fatal error:
require(): Failed opening required 'vendor/autoload.php'
(include_path='.:/usr/share/pear:/usr/share/php') in
/var/www/html/index.php on line 2
So I'm guessing it has something to do with composer's installation/configuration perhaps? Thanks for any help...
The way you programmed it, you must have the following files all in the same directory:
composer.json
index.php (your test script)
And you must have run the composer require command while being inside this directory. This will also create a directory named vendor here, and add plenty of files, amongst them vendor/autoload.php.
If however your test script isn't in this location, the require call will not find the file where you tell PHP to find it. This isn't any failure of Composer, but simply the fact that you have to include that file according to your situation, not by copy&paste code. If you change the path of your test script, you have to change the path of the vendor directory as well.
I have installed Emacs elnode by Marmalade, and everything looks OK. And I have read the manual carefully.
Now elnode has started, and I can view the folder public_html under .emacs.d\elnode folder.
If I input url http://localhost:8000 in my Chrome, it will show following content:
/
.
..
default-webserver-image.png
test.html
But when I click the test.html file, chrome just can't get the response from elnode. I check my Emacs, the Message file provides two errors:
elnode-error: elnode--sentinel 'open from 127.0.0.1.' for process elnode-webserver-proc 127.0.0.1:2224 with buffer nil
elnode-error: Elnode status: elnode-webserver-proc 127.0.0.1:2224 open from 127.0.0.1
elnode-error: filter: calling handler on elnode-webserver-proc 127.0.0.1:2224
elnode-error: starting HTTP response on elnode-webserver-proc 127.0.0.1:2224
error in process filter: apply: Spawning child process: invalid argument
error in process filter: Spawning child process: invalid argument
I just don't know how to debug it. I also tried elnode-send-file function, it also doesn't work.
But If I run the Hello World example, it works:
(defun my-status-page (httpcon)
(elnode-http-start httpcon 200 '("Content-type" . "text/html"))
(elnode-http-return httpcon "<html><b>HELLO!</b></html>"))
(elnode-start 'my-status-page :port 8010)
The core problem is that Emacs can't send html page!
Is it necessary to do some basic configuration after installing elnode?
Thanks
Water Lin
The newest edition has solved the problem. If you meet the same problem as me, please download the newest edition.
My test environment is Windows7 & Emacs 24.2.1.
I was using this piece of php script in a application running under over XAMPP on my local machine:
$dom = new DomDocument();
$filename = "library.xml";
if (!$dom->load($filename))
die("Could not parse iTunes XML file: ".$filename);
Then i tried to move this application to a WampServer without success, with the following warning:
Warning: DOMDocument::load() [domdocument.load]: I/O warning : failed to load external entity "file:///C:/wamp/www/parser/library.xml" in C:\wamp\www\parser\includes\libs\itunes_xml_parser.lib.php on line 111
This line in the error is exactly the load line, which worked flawlessly in earlier versions of XAMPP and isn't working now on XAMPP 1.7.7
As per this why don't you try using an absolute path for your filepath.
Also i see that this php file is located at C:\wamp\www\parser\includes\libs and library.xml is being searched at C:/wamp/www/parser/. Is this correct?
It could also be possible that you had turned off warnings/errors in your earlier xampp installation.So check this also.
I'm trying to get Perl/FastCGI (FCGI) running with IIS 7.5. The version of C:\Windows\System32\inetsrv\iisfcgi.dll is 7.5.7601.17514. Here's my web.config and my Perl script:
D:\MiLu\Dev :: more /t1 web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<directoryBrowse enabled="true" />
<handlers>
<add name="FCGI" path="*.pl" verb="*"
modules="FastCgiModule"
scriptProcessor="C:\Opt\Cygwin\bin\perl.exe"
resourceType="Unspecified" requireAccess="Script" />
</handlers>
</system.webServer>
</configuration>
D:\MiLu\Dev :: more /t4 Perl\fcgi\count.pl
use strict;
use warnings;
use FCGI;
my $count = 0;
my $request = FCGI::Request();
while ( $request->Accept >= 0 ) {
print "Content-type: text/html\r\n\r\n", ++$count;
}
All I'm getting is a 500 with a generic error page from IIS stating "The FastCGI process exited unexpectedly" and listing possible error causes.
The script runs fine from the command line, printing its three lines and then exiting immediately, indicating that script and module installation are alright. (I copied it from the FCGI manual, by the way, so it should be okay.)
D:\MiLu\Dev :: C:\Opt\Cygwin\bin\perl.exe Perl\fcgi\count.pl
Content-type: text/html
1
There is an FCGI::IIS module, however, it appears to have worked only for IIS 5.1 and 6.0.
FastCGI and Perl - FastCGI with Perl on IIS 5.1, 6
IIS and FastCGI/Scripting languages/Perl
The fact that there is a dedicated FCGI module for IIS suggests that IIS 5.1 and 6.0 provided their own non-standard FCGI implementation. So if this were true, what about IIS 7.5 then? Quite a lot of uncertainties.
The author of FCGI::IIS seems to have tried to make his module work with IIS 7.0 (Getting Perl working on IIS7 with FastCGI - 2007), but given up.
Where can I find something more concrete as to what the error is? Is there a log file? What should I be looking for in the Windows event viewer (eventvwr)?
Is there some magic incantation for IIS that I'm missing?
There's not much information out there on this combination. But it might work, in the end. There is a FastCGI Application configuration reference page here, and someone has got Catalyst to work with FastCGI on IIS 7.0 (Catalyst+IIS 7.0 on MS Windows 2008/Vista).
I've not done this for a while, and never with Cygwin.
In order to test this could you please download and install the latest active state perl for your architecture and try installing/configuring as below:
http://legacy.websitepanel.net/kb/installing-and-running-active-perl-runtime-as-isapi-on-microsoft-iis-7.0
Another reference:
http://blogs.iis.net/wadeh/archive/2009/04/13/running-perl-on-iis-7.aspx
Good luck.
I've just come across this. A lot of the links you reference are mine. At the time I was writing those guide FastCGI for IIS was brand new, and the Vista version wasn't out yet. Unfortunately due to work I ended up on other projects and didn't get chance to continue with the guides once the Vista (IIS 7) version came out.
I've only just come to a project that needs this again, and in searching for a solution myself I came across your post. I've done some testing and managed to find a solution.
FastCGI works fundamentally differently on Windows to what it does on Linux. It's not just with the IIS version, but with the Apache version as well.
On Linux you can set FastCGI as the handler, and the shebang for the script will be enough to point it to Perl and do the right thing (as long as you've coded your script for FCGI or CGI::Fast).
On Windows you need to specify the FastCGI script you want to be invoked with the handler:
IIS 7:
IIS Manager -> Sites -> Web site -> Handler Mappings -> Add Module Mapping...
Request Path: test_script.fcgi
Module: FastCgiModule
Executable: c:\perl\bin\perl.exe|c:\inetpub\wwwroot\test_script.fcgi
Name: Test FCGI example
Click OK then select to add the FastCGI application. If you check the FastCGI settings for the server you'll need that the part after the | is set as the arguments to the executable (Perl).
Restart the server (not just the website). It should be working. Unfortunately, if you want to use this technique you'll need to add a mapping for each script. The FCGI::IIS module tried to work around this issue, but it has a lot of Caveats and isn't finished.
Apache
I tested this on WAMP by copying the mod_fcgid.so file to the appropriate directory, and updating httpd.conf:
<IfModule fcgid_module>
FcgidInitialEnv PATH "C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;C:/Perl/bin"
FcgidInitialEnv SystemRoot "C:/Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:/WINDOWS/Temp"
FcgidInitialEnv TMP "C:/WINDOWS/Temp"
FcgidInitialEnv windir "C:/WINDOWS"
FcgidIOTimeout 64
FcgidConnectTimeout 16
FcgidMaxRequestsPerProcess 1000
FcgidMaxProcesses 1
FcgidMaxRequestLen 8131072
<Files ~ "\test_script.fcgi$">
Options Indexes FollowSymLinks ExecCGI
AddHandler fcgid-script .fcgi
FcgidWrapper "C:/Perl/bin/perl.exe c:/wamp/www/test_script.fcgi" .fcgi
</Files>
</IfModule>
I hope that helps anyone facing the same issues as you.
Lyle