We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
try, try but perl script no working
try, try but perl script no working
Hi, i want use Vesta, but i cant do working perl script. why?
Server is centos 7, vesta working fine.
My script is 755, under /cgi-bin directory), the error is : internal server error:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
foreach my $key (keys %ENV) {
print "$key --> $ENV{$key}<br>";
}
MY HTTPD.CONF. IS:
------
ServerRoot "/etc/httpd"
Include conf.modules.d/*.conf
User apache
Group apache
ServerAdmin root@localhost
<Directory />
AllowOverride none
</Directory>
DocumentRoot "/var/www/html"
<Directory "/var/www">
AllowOverride None
Require all granted
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Require all granted
</Directory>
DirectoryIndex index.php index.html
<Files ".ht*">
Require all denied
</Files>
ErrorLog "logs/error_log"
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%b" bytes
CustomLog "logs/access_log" combined
TypesConfig /etc/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AddHandler cgi-script .cgi .pl
AddDefaultCharset UTF-8
<IfModule mime_magic_module>
MIMEMagicFile conf/magic
</IfModule>
EnableSendfile on
<IfModule remoteip_module>
RemoteIPHeader X-Real-IP
LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%a %l %u %t \"%r\" %>s %b" common
</IfModule>
IncludeOptional conf.d/*.conf
HELP ME PLEASE.
Server is centos 7, vesta working fine.
My script is 755, under /cgi-bin directory), the error is : internal server error:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
foreach my $key (keys %ENV) {
print "$key --> $ENV{$key}<br>";
}
MY HTTPD.CONF. IS:
------
ServerRoot "/etc/httpd"
Include conf.modules.d/*.conf
User apache
Group apache
ServerAdmin root@localhost
<Directory />
AllowOverride none
</Directory>
DocumentRoot "/var/www/html"
<Directory "/var/www">
AllowOverride None
Require all granted
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Require all granted
</Directory>
DirectoryIndex index.php index.html
<Files ".ht*">
Require all denied
</Files>
ErrorLog "logs/error_log"
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%b" bytes
CustomLog "logs/access_log" combined
TypesConfig /etc/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AddHandler cgi-script .cgi .pl
AddDefaultCharset UTF-8
<IfModule mime_magic_module>
MIMEMagicFile conf/magic
</IfModule>
EnableSendfile on
<IfModule remoteip_module>
RemoteIPHeader X-Real-IP
LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%a %l %u %t \"%r\" %>s %b" common
</IfModule>
IncludeOptional conf.d/*.conf
HELP ME PLEASE.
Re: try, try but perl script no working
Hi,
I've spent a lot of time getting this right on my server :) You probably want to run these first:
Also, why are you editing httpd.conf ?You should be setting it up in the /etc/apache2/sites-available. An example .conf file I'm using is:
Hope that helps.
Cheers
Andy
I've spent a lot of time getting this right on my server :) You probably want to run these first:
Code: Select all
# Some basic bits.
sudo apt-get update
apt -y install cpanminus
apt-get -y install apache2 libapache2-mod-fastcgi libxml-parser-perl
apt-get -y install libimage-magick-perl perlmagick libgdbm-dev
cpanm Apache::DBI
cpanm WebService::Linode
cpanm ModPerl::Registry
cpanm DateTime
sudo apt-get -y install linode-cli libapache2-mod-ruid2 libgd-gd2-perl libapache2-mod-perl2 build-essential libdbd-mysql-perl
# setup some bits in Apache
a2enmod authz_groupfile
a2dismod mpm_event
a2enmod mpm_prefork
a2enmod cgi
a2enmod actions
a2enmod remoteip
service apache2 restart
Code: Select all
<VirtualHost *:80>
CustomLog /home/%USER%/web/%DOMAIN%/logs/%DOMAIN%.apache.log combined
ErrorLog /home/%USER%/web/%DOMAIN%/logs/%DOMAIN%.apache.error.log
LogLevel debug
RemoteIPHeader X-Forwarded-For
ServerName %DOMAIN%
ServerAlias www.%DOMAIN%
ServerAdmin info@%DOMAIN%
DocumentRoot /home/%USER%/web/%DOMAIN%/public_html
ScriptAlias /cgi-bin/ /home/%USER%/web/%DOMAIN%/public_html/cgi-bin/
Alias /vstats/ /home/%USER%/web/%DOMAIN%/stats/
Alias /error/ /home/%USER%/web/%DOMAIN%/document_errors/
<Directory "/home/%USER%/web/%DOMAIN%/*">
Options +ExecCGI +FollowSymLinks +MultiViews
AllowOverride AuthConfig
Require all granted
AddHandler cgi-script .cgi .pl
</Directory>
# This is good if you want to password protect a folder
# <Directory "/home/%USER%/web/%DOMAIN%/public_html/cgi-bin/admin">
# AuthType Basic
# AuthName "Authorized Users Only"
# AuthBasicProvider file
# AuthUserFile /home/%USER%/web/%DOMAIN%/.htpasswd
# <RequireAny>
# Require valid-user
# Require ip 81.174.134.133
# </RequireAny>
# </Directory>
<Directory /home/%USER%/web/%DOMAIN%/stats>
AllowOverride All
Require all granted
</Directory>
<IfModule mod_ruid2.c>
RMode config
RUidGid %USER% %USER%
RGroups www-data
</IfModule>
<IfModule itk.c>
AssignUserID %USER% %USER%
</IfModule>
IncludeOptional /home/%USER%/conf/web/apache2.%DOMAIN%.conf*
</VirtualHost>
Hope that helps.
Cheers
Andy
Re: try, try but perl script no working
Thanks Andy, but... i can't find /etc/apache2/sites-available in my server. My server is centos 7 and i installed vesta default install.youradds wrote:Hi,
I've spent a lot of time getting this right on my server :) You probably want to run these first:
Also, why are you editing httpd.conf ?You should be setting it up in the /etc/apache2/sites-available. An example .conf file I'm using is:Code: Select all
# Some basic bits. sudo apt-get update apt -y install cpanminus apt-get -y install apache2 libapache2-mod-fastcgi libxml-parser-perl apt-get -y install libimage-magick-perl perlmagick libgdbm-dev cpanm Apache::DBI cpanm WebService::Linode cpanm ModPerl::Registry cpanm DateTime sudo apt-get -y install linode-cli libapache2-mod-ruid2 libgd-gd2-perl libapache2-mod-perl2 build-essential libdbd-mysql-perl # setup some bits in Apache a2enmod authz_groupfile a2dismod mpm_event a2enmod mpm_prefork a2enmod cgi a2enmod actions a2enmod remoteip service apache2 restart
Code: Select all
<VirtualHost *:80> CustomLog /home/%USER%/web/%DOMAIN%/logs/%DOMAIN%.apache.log combined ErrorLog /home/%USER%/web/%DOMAIN%/logs/%DOMAIN%.apache.error.log LogLevel debug RemoteIPHeader X-Forwarded-For ServerName %DOMAIN% ServerAlias www.%DOMAIN% ServerAdmin info@%DOMAIN% DocumentRoot /home/%USER%/web/%DOMAIN%/public_html ScriptAlias /cgi-bin/ /home/%USER%/web/%DOMAIN%/public_html/cgi-bin/ Alias /vstats/ /home/%USER%/web/%DOMAIN%/stats/ Alias /error/ /home/%USER%/web/%DOMAIN%/document_errors/ <Directory "/home/%USER%/web/%DOMAIN%/*"> Options +ExecCGI +FollowSymLinks +MultiViews AllowOverride AuthConfig Require all granted AddHandler cgi-script .cgi .pl </Directory> # This is good if you want to password protect a folder # <Directory "/home/%USER%/web/%DOMAIN%/public_html/cgi-bin/admin"> # AuthType Basic # AuthName "Authorized Users Only" # AuthBasicProvider file # AuthUserFile /home/%USER%/web/%DOMAIN%/.htpasswd # <RequireAny> # Require valid-user # Require ip 81.174.134.133 # </RequireAny> # </Directory> <Directory /home/%USER%/web/%DOMAIN%/stats> AllowOverride All Require all granted </Directory> <IfModule mod_ruid2.c> RMode config RUidGid %USER% %USER% RGroups www-data </IfModule> <IfModule itk.c> AssignUserID %USER% %USER% </IfModule> IncludeOptional /home/%USER%/conf/web/apache2.%DOMAIN%.conf* </VirtualHost>
Hope that helps.
Cheers
Andy
Re: try, try but perl script no working
Hi,
I *think* it may be /etc/httpd/sites-available on your OS (I've not used it, but I've read they name it differently on some OS's for some reason!). Hope that helps.
Cheers
Andy
I *think* it may be /etc/httpd/sites-available on your OS (I've not used it, but I've read they name it differently on some OS's for some reason!). Hope that helps.
Cheers
Andy
Re: try, try but perl script no working
Thanks Andy, i finally can use perl script. the trick was "-w"youradds wrote:Hi,
I *think* it may be /etc/httpd/sites-available on your OS (I've not used it, but I've read they name it differently on some OS's for some reason!). Hope that helps.
Cheers
Andy
#!/usr/bin/perl -w
Re: try, try but perl script no working
Hi
Cool - but that does seem a bit weird! -w just turns on script debugging and warnings in error logs, so shouldn't have any effect on if they run
Cheers
Andy
Cool - but that does seem a bit weird! -w just turns on script debugging and warnings in error logs, so shouldn't have any effect on if they run
Cheers
Andy