Hi everyone!
I can not execute my CGI files in my virtual host, this is the configuration of my file: /etc/apache2/conf-available/serve-cgi-bin.conf
<IfModule mod_alias.c>
<IfModule mod_cgi.c>
Define ENABLE_USR_LIB_CGI_BIN
</IfModule>
<IfModule mod_cgid.c>
Define ENABLE_USR_LIB_CGI_BIN
</IfModule>
<IfDefine ENABLE_USR_LIB_CGI_BIN>
ScriptAlias "/cgi-bin/" "/var/www/814.pe/public_html/cgi-bin/"
#Modified by me - start
#<Directory "/var/www/814.pe/public_html/cgi-bin/">
# AllowOverride None
# Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
# AddHandler cgi-script .cgi .pl
# Require all granted
# SetHandler cgi-script
# </Directory>
#Modified by me - end
<Directory "/var/www/814.pe/public_html/cgi-bin/mt/">
Options +ExecCGI
AddHandler cgi-script .cgi .pl
</Directory>
and this is the conf of my domain in which I try to run the scripts: /etc/apache2/sites-available/814.pe.conf
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin daniel@814.pe
ServerName 814.pe
ServerAlias www.814.pe
DocumentRoot /var/www/814.pe/public_html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
# Include conf-available/serve-cgi-bin.conf
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.814.pe [OR]
RewriteCond %{SERVER_NAME} =814.pe
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
#Modified by me - start
#ScriptAlias /cgi-bin/ /var/www/814.pe/public_html/cgi-bin/
#<Directory "/var/www/814.pe/public_html/cgi-bin/">
# Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
# AddHandler cgi-script .cgi .pl
# AllowOverride None
# Require all granted
# </Directory>
#Modified by me - end
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
This is what i get in console apache error log: Browser say: “Internal Server Error” Console say: “[cgi:error] [pid 20550] [client 190.216.190.76:34913] End of script output before headers: test.cgi”
The problem gets worse if I decide to run the files in a folder inside my CGI-BIN folder: Browser say: Not Found" Console say: “script not found or unable to stat: /var/www/814.pe/public_html/cgi-bin/mt/test.cgi”
Whai i really need is make run this CGI files inside of a directory calls mt
Im using APACHE on Ubuntu 14.04.5 x64
Thnak you so much for oyur help guys.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
App this to cgi.test the script works chmod 755 /var/www/814.pe/public_html/cgi-bin/test.cgi
Is not the only CGI file in there, for example, to this cgi file: [cgi:error] [pid 20563] [client 190.216.190.76:56449] End of script output before headers: mt-wizard.cgi
For others files in there I get this: [cgi:error] [pid 20562] [client 190.216.190.76:52929] AH01215: (8)Exec format error: exec of ‘/var/www/814.pe/public_html/cgi-bin/index.html’ failed
I did, look like I need to install all those libraries
Can't locate MT/Bootstrap.pm in @INC (you may need to install the MT::Bootstrap module) (@INC contains: lib /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at /var/www/814.pe/public_html/cgi-bin/mt-wizard.cgi line 11.
BEGIN failed--compilation aborted at /var/www/814.pe/public_html/cgi-bin/mt-wizard.cgi line 11.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.