[ W-Line @ 04.05.2011. 14:48 ] @
Pozdrav,

dali je neko imao problem sa cgi-bin direktorijama vezano za linux web-aplikacije ?
Ja imam problem sa tim sto dobijem poruku od servera da cgi-bin deirektorija ne moze da bude pronadjena...

Ovdje ispod je moj "virtualHost" konfig na apache serveru httpd.conf

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /home/mojadomena.com/public_html
ServerName mojadomena.com
ServerAlias www.mojadomena.com
ScriptAlias /cgi-bin/ "/home/mojadomena.com/cgi-bin"
DirectoryIndex index.php index.html index.htm index.shtml
<Directory "/home/mojadomena.com/public_html">
Options Indexes Includes FollowSymLinks MultiViews +ExecCGI
AddHandler cgi-script cgi pl
#AllowOverride AuthConfig
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "/home/mojadomena.com/cgi-bin">
Options Indexes Includes FollowSymLinks MultiViews +ExecCGI
AddHandler cgi-script cgi pl
#AllowOverride AuthConfig
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Zaista mi nije jasno zasto server ne moze da nadje cgi-bin, ovo je poruka koja izadje na mozilli:

Not Found

The requested URL /cgi-bin/install.cgi was not found on this server.

Nadam se da ce neki maher doci sa prijedlogom...

Pozdrav svima raja
[ Miroslav Strugarevic @ 04.05.2011. 15:21 ] @
Pogledas error log ili ga okacis ovde i videcemo :)
[ W-Line @ 04.05.2011. 15:33 ] @
hvala na javljanju, evo i da log okacim, iako nije narocito jasan:

[Wed May 04 09:31:12 2011] [error] [client 84.xx.xx.xx] script not found or unable to stat: /home/mojadomena.com/cgi-bininstall.cgi
[Wed May 04 09:31:15 2011] [error] [client 84.xx.xx.xx] script not found or unable to stat: /home/mojadomena.com/cgi-bininstall.cgi
[Wed May 04 09:31:18 2011] [error] [client 84.xx.xx.xx] script not found or unable to stat: /home/mojadomena.com/cgi-bininstall.cgi
[Wed May 04 09:31:45 2011] [error] [client 84.xx.xx.xx] script not found or unable to stat: /home/mojadomena.com/cgi-bininstall.cgi

ovaj log je ocitan sa CentOS-a verzija 5.6 64 Bitni

nano /var/log/httpd/error_log

[ Miroslav Strugarevic @ 04.05.2011. 15:37 ] @
Izmeni
ScriptAlias /cgi-bin/ "/home/mojadomena.com/cgi-bin"
u ovo
ScriptAlias /cgi-bin/ "/home/mojadomena.com/cgi-bin/"

[ W-Line @ 04.05.2011. 15:42 ] @
hvala puno ! proradi iz prve :), ali dali sada trebam dodat / i na Directory isto ili je dovoljno samo na ScripAlias ??


<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /home/mojadomena.com/public_html
ServerName mojadomena.com
ServerAlias www.mojadomena.com
ScriptAlias /cgi-bin/ "/home/mojadomena.com/cgi-bin/" <---------------- ovdje sam dodao /
DirectoryIndex index.php index.html index.htm index.shtml
<Directory "/home/mojadomena.com/public_html">
Options Indexes Includes FollowSymLinks MultiViews +ExecCGI
AddHandler cgi-script cgi pl
#AllowOverride AuthConfig
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "/home/mojadomena.com/cgi-bin"> <------------------------ treba li i ovdje da zakljucam u taj direktorij / ?
Options Indexes Includes FollowSymLinks MultiViews +ExecCGI
AddHandler cgi-script cgi pl
#AllowOverride AuthConfig
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

i Hvala puno jos jednom !!!

[ Miroslav Strugarevic @ 04.05.2011. 16:08 ] @
Samo trebas izmeniti ScriptAlias posto on ukazuje na punu putanju do cgi foldera. Bez / na kraju Apache nije znao da je u pitanju folder i zato si imao one greske u error_log-u. Pozdrav!
[ W-Line @ 04.05.2011. 16:59 ] @
aha ok razumijem, sad mi je jasno...
jos jednom puno hvala !!

Pozdrav
[ W-Line @ 05.05.2011. 23:58 ] @
Pozdrav opet Miroslave,

imam jedan mali problem kad sam postavio perl-cgi na novom serveru, dakle konfiguracije je identicna kao na starom, samo na novom
mi se pojavio jedan problem oko "security" na apache.

Ovdje ispod je error koji sam dobio na apache ACCESS_LOG:

84.xx.xx.xx - - [06/May/2011:08:41:34 +0200] "GET /cgi-bin/install.cgi HTTP/1.1" 500 614
84.xx.xx.xx - - [06/May/2011:08:41:36 +0200] "GET /cgi-bin/install.cgi HTTP/1.1" 500 614
84.xx.xx.xx - - [06/May/2011:08:41:36 +0200] "GET /cgi-bin/install.cgi HTTP/1.1" 500 614
84.xx.xx.xx - - [06/May/2011:08:43:13 +0200] "GET /cgi-bin/install.cgi HTTP/1.1" 500 614
84.xx.xx.xx - - [06/May/2011:08:52:33 +0200] "GET /cgi-bin/install.cgi HTTP/1.1" 500 614
84.xx.xx.xx - - [06/May/2011:08:53:23 +0200] "GET /cgi-bin/install.cgi HTTP/1.1" 500 614




Ovdje ispod je error koji sam dobio na apache ERROR_LOG:

[Fri May 06 08:55:12 2011] [error] [client 84.xx.xx.xx] (13)Permission denied: exec of '/home/mojadomena.com/cgi-bin/install.cgi' failed
[Fri May 06 08:55:12 2011] [error] [client 84.xx.xx.xx] Premature end of script headers: install.cgi
[Fri May 06 08:08:02 2011] [error] [client 84.xx.xx.xx] Directory index forbidden by Options directive: /home/mojadomena.com/public_html/
[Fri May 06 08:08:04 2011] [error] [client 84.xx.xx.xx] Directory index forbidden by Options directive: /home/mojadomena.com/public_html/




a ovdje ispod je VirtualHost konfiguracija:

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /home/mojadomena.com/public_html
ServerName mojadomena.com
ServerAlias www.mojadomena.com
ScriptAlias /cgi-bin/ "/home/mojadomena.com/cgi-bin/"
DirectoryIndex index.php index.html index.htm index.shtml
<Directory "/home/mojadomena.com/public_html">
Options Indexes Includes FollowSymLinks MultiViews +ExecCGI <---------- apache kaze da je ovdje problem al ne kontam sto ? radi na drugom serveru
AddHandler cgi-script cgi pl
#AllowOverride AuthConfig
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "/home/mojadomena.com/cgi-bin">
Options Indexes Includes FollowSymLinks MultiViews +ExecCGI <---------- apache kaze da je ovdje problem al ne kontam sto ? radi na drugom serveru
AddHandler cgi-script cgi pl
#AllowOverride AuthConfig
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Puno zahvaljujem !!

Pozdrav
[ W-Line @ 06.05.2011. 00:02 ] @
PS: jer sto je najcudnije od svega recimo direktorija phpmyadmin radi ok npr:

http://mojadomena.com/phpmyadmin ovo radi bez problema...... samo kad probam otvorit perl (cgi) onda zapne...

[ Miroslav Strugarevic @ 06.05.2011. 00:07 ] @
Koji je Linux u pitanju? Mirise mi da je selinux ukljucen ako je redhat/centos/fedora u pitanju...
[ W-Line @ 06.05.2011. 00:08 ] @
CentOS 5.6 64 bitna verzija isti kao i prosla verzija....
[ Miroslav Strugarevic @ 06.05.2011. 00:09 ] @
Komanda sestatus kao root sta izbacuje...
[ W-Line @ 06.05.2011. 00:09 ] @
ukljucen je "iptables" firewall ali je otvoren port 80 i 22 (ssh) ... jedino ako to nije problem...
znaci iptables na CentOS 5.6
[ W-Line @ 06.05.2011. 00:09 ] @
[[email protected] ~]# sestatus
SELinux status: disabled
[ W-Line @ 06.05.2011. 00:11 ] @
ovo je sadrzaj iptables fajla kojeg sam konfigurisao:


# Generated by iptables-save v1.3.5 on Fri May 6 07:33:34 2011
*filter
:INPUT DROP [8:384]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [358:68600]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m multiport --dports 80,22 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
COMMIT
# Completed on Fri May 6 07:33:34 2011
[ Miroslav Strugarevic @ 06.05.2011. 00:12 ] @
Ok to nije. Idemo dalje..

Izlistaj mi dozvole tog cgi skripta pomocu ls -lh skript.cgi
Takodje bih voleo da vidim nekoliko pocetnih linija u toj cgi skripti
p.s. Takodje jedan

ls -lhd /home/mojadomena.com/cgi-bin/
[ W-Line @ 06.05.2011. 00:19 ] @
dozvola install.cgi skripta:

[[email protected] cgi-bin]# ls -lh install.cgi
-rw-r--r-- 1 root root 8.9K Mar 18 19:55 install.cgi




pocetne linije fajla install.cgi

#!/usr/bin/perl
use strict;
use CGI::Carp qw(fatalsToBrowser);
use lib '.';
use DBI;
use XFileConfig;
my $ok = "<br><b style='background:#1a1;color:#fff;padding:2px;'>OK</b>";

eval {require Session;};
if([email protected])
{
if(-e "Modules/auto/WSD/Filter/Filter_64.so")
[ Miroslav Strugarevic @ 06.05.2011. 00:20 ] @
Aha. chmod +x skript.cgi pa onda probaj.
[ W-Line @ 06.05.2011. 00:23 ] @
SVAKA CAS CARE ! proradi ;)

puno zahvaljujem !!
Bas nije da se svaki dan dozivi da neko respondira ovako brzo i ujedno ovako kasno :)

hvala puno jos jednom !!

Zivio !
[ Miroslav Strugarevic @ 06.05.2011. 00:25 ] @
Tako je to kad ti je dosadno i nemas posao :)) hehe.. chmod +x moras obavezno staviti za cgi skripte kako bih mogle da se pokrecu/izvrsavaju..

Ako nesto treba vici!
[ W-Line @ 06.05.2011. 00:28 ] @
hehe e tu nisi jedini, ja isto nocima sjedim spremam CCIE lab Cisco, polozen written pa sad oko LAB-a, pa mi linux dodje kao rasterecenje :)
postavljam fileshare portal na jakom serveru, ukoliko zelis i potreban ti je file sharing samo kazi.. cim sve podignem imas pristup i to ne ogranicen!

[ Miroslav Strugarevic @ 06.05.2011. 00:30 ] @
Hvala druze :) Pretpostavio sam da to radis (sibsoft) bas me interesuje koliko je dobra ta aplikacija.

srecno sa lab-om!
[ W-Line @ 06.05.2011. 00:37 ] @
hvala puno, za CCIE ti treba izmedjuostalog i srece :)

aplikacija je zesca sto jest jest ja sam je vec testirao, vidjeces kad sve zavrsim...
necu postavljati nikakve ads, radi brzine ucitavanja.... i svu cu grafiku sklonit kako bi je jos vise optimizirao itd...

posalji mi mail na [email protected] pa ti mogu odgovorit kad zavrsim...

ukoliko treba cisco asistencije R&S ili Security samo kazi ....

Pozdrav, vrijeme je da malo pogledam u kapke, sutra posao u 07:00 :)

Zivio