Freesco, NND, CDN, EOS

http://www.freesco.pl
Dzisiaj jest niedziela, 22 czerwca 2025, 19:48

Strefa czasowa UTC+2godz.




Nowy temat Odpowiedz w temacie  [ Posty: 4 ] 
Autor Wiadomość
 Tytuł: apache i cgi
Post: piątek, 23 marca 2007, 17:45 
Offline
Użytkownik

Rejestracja: piątek, 8 kwietnia 2005, 05:28
Posty: 190
Lokalizacja: Olsztyn
mam sobie skrypcik w cgi co mi ma wysyłac poczte przez strone, ale skrypty cgi sie nie odpalają, po przejściu do skryptu z html poprostu czyta mi cgi i wywala na strone

a jak wpisuje
http://192.168.0.1/cgi-bin/
to wywala mi takie coś

You don't have permission to access /cgi-bin/ on this server.

do tego niewiem jaką scieżkę ustawić w pliku html żeby mi na polecenie action=email.cgi przeszedł do skryptu
ma być
/cgi-bin/email.cgi
./cgi-bin/email.cgi
../cgi-bin/email.cgi
email.cgi

nie kumam


ooki do czegoś doszedłem, ale jak zrobić aby ścieżke czytał od katalogu głównego??

_________________
Processor Pentium 4 XEON 1,8GHz 512MB Ram (bind,mrtg,apache,php4,exim,radius-testing) 40 hostów


Na górę
 Wyświetl profil  
 
Post: piątek, 23 marca 2007, 18:09 
Offline
Honorowy Admin

Rejestracja: piątek, 5 lipca 2002, 17:30
Posty: 7800
Lokalizacja: Słupsk
Sadek pisze:
a jak wpisuje
http://192.168.0.1/cgi-bin/
to wywala mi takie coś

You don't have permission to access /cgi-bin/ on this server.

Normalne, katalog cgi nie powinien być listowany. Musisz mieć odwołanie do konkretnego pliku. Plik powinien mieć prawa 755 i być własnością nobody.

_________________
Obrazek Belfer.one.PL
Obrazek Audio Cafe


Na górę
 Wyświetl profil  
 
 Tytuł:
Post: sobota, 24 marca 2007, 11:35 
Offline
Użytkownik

Rejestracja: niedziela, 23 stycznia 2005, 12:00
Posty: 480
Jesli plik *.html masz w kat HTML apache'a to "../cgi-bin/skrypt.cgi"


Na górę
 Wyświetl profil  
 
 Tytuł:
Post: sobota, 24 marca 2007, 15:14 
Offline
Użytkownik

Rejestracja: piątek, 8 kwietnia 2005, 05:28
Posty: 190
Lokalizacja: Olsztyn
oooki już opanowałem, skrypt sobie działa, ale jako że apache odpala sie jako nobody to ja dostaje maile od "nobody", a chciałbym aby było inaczej, na przykałd od: "marchewkowe pole" , może bedzie łatwiej jak wkleje tutaj ten skrypcik
: [/] [] ()
#!/usr/bin/perl

# A simple Perl-based CGI email handler.
#
# Copyright 2004 Boutell.Com, Inc. Compatible with our earlier C program.
#
# Released under the same license terms as Perl 5 itself.
#
# We ask, but do not require, that you link to
# http://www.boutell.com/email/ when using this script or a
# variation of it.

use CGI;

my $sendmail = "/usr/sbin/sendmail";

# A text file containing a list of valid email recipients and the web pages to
# which the user should be redirected after email is sent to each, on
# alternating lines.  This allows one copy of the script to serve multiple
# purposes without the risk that the script will be abused to send spam.
# YOU MUST CREATE SUCH A TEXT FILE AND CHANGE THE NEXT LINE TO ITS
# LOCATION ON THE SERVER.

my $emailConfPath = "/home/httpd/html/stocznia/mail/email.conf";

# Parse any submitted form fields and return an object we can use
# to retrieve them
my $query = new CGI;

my $name = &veryclean($query->param('name'));
my $email = &veryclean($query->param('email'));
my $recipient = &veryclean($query->param('recipient'));
my $subject = &veryclean($query->param('subject'));
#newlines allowed
my $content = &clean($query->param('content'));

#Note: subject is not mandatory, but you can easily change that
if (($name eq "") || ($email eq "") || ($content eq "") || ($recipient eq ""))
{
   &error("Email Rejected",
      "Please fill out all fields provided. Back up to the " .
      "previous page to try again.");
}

if (!open(IN, "$emailConfPath")) {
   &error("Configuration Error",
      "The file $emailConfPath does not exist or cannot be " .
      "opened. Please read the documentation before installing " .
      "email.cgi.");
}

my $returnpage;

my $ok = 0;
while (1) {
   my $recipientc = <IN>;
   $recipientc =~ s/\s+$//;
   if ($recipientc eq "") {
      last;
   }
   my $returnpagec = <IN>;
   $returnpagec =~ s/\s+$//;
   if ($returnpagec eq "") {
      last;
   }
   if ($recipientc eq $recipient) {
      $ok = 1;
      $returnpage = $returnpagec;
      last;
   }
}
close(IN);
if (!$ok) {
   &error("Email Rejected",
      "The requested destination address is not one of " .
      "the permitted email recipients. Please read the " .
      "documentation before installing email.cgi.");
}

# Open a pipe to the sendmail program
open(OUT, "|$sendmail -t");
# Use the highly convenient <<EOM notation to include the message
# in this script more or less as it will actually appear
print OUT <<EOM
To: $recipient
Subject: $subject
Reply-To: $email
Supposedly-From: $name
[Wiadomosc wyslana z serwera, ktos sie wkurzyl?.]

$content
EOM
;
close(OUT);
# Now redirect to the appropriate "landing" page for this recipient.
print $query->redirect($returnpage);

exit 0;

sub clean
{
   # Clean up any leading and trailing whitespace
   # using regular expressions.
   my $s = shift @_;
   $s =~ s/^\s+//;
   $s =~ s/\s+$//;
   return $s;
}

sub veryclean
{
   # Also forbid newlines by folding all internal whitespace to
   # single spaces. This prevents faking extra headers to cc
   # extra people.
   my $s = shift @_;
   $s = &clean($s);
   $s =~ s/\s+$/ /g;
   return $s;
}

sub error
{
   # Output a valid HTML page as an error message
   my($title, $content) = @_;
   print $query->header;
   print <<EOM
<html>
<head>
<title>$title</title>
</head>
<body>
<h1 align="center">$title</h1>
<p>
$content
</p>
EOM
;
   exit 0;
}



w pliku email.conf jest tylko adres na jaki sie wysyła i strona naktóra ma przejsc po wysłaniu

_________________
Processor Pentium 4 XEON 1,8GHz 512MB Ram (bind,mrtg,apache,php4,exim,radius-testing) 40 hostów


Na górę
 Wyświetl profil  
 
Wyświetl posty nie starsze niż:  Sortuj wg  
Nowy temat Odpowiedz w temacie  [ Posty: 4 ] 

Strefa czasowa UTC+2godz.


Kto jest online

Użytkownicy przeglądający to forum: Obecnie na forum nie ma żadnego zarejestrowanego użytkownika i 25 gości


Nie możesz tworzyć nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz dodawać załączników

Szukaj:
Przejdź do:  
Technologię dostarcza phpBB® Forum Software © phpBB Group
Hosting: Compus-Net
RobertKonik.pl