From: Alexander Bokovoy <ab@avilink.net>
To: mandrake-russian@altlinux.ru
Subject: Re: [mdk-re] offtopic: troubles with python programming
Date: Mon Apr 9 16:50:01 2001
Message-ID: <20010409154827.D27466@avilink.net> (raw)
In-Reply-To: <3AD16150.54252BCB@zmail.ru>; from cornet@zmail.ru on Mon, Apr 09, 2001 at 11:14:24AM +0400
On Mon, Apr 09, 2001 at 11:14:24AM +0400, cornet wrote:
> Pavel Marakhovsky wrote:
> >
> > Привет!
> >
> > Сразу сорри за оффтопик, но спросить не у кого...
> >
> > Из книжки "Язык прграммирования Питон" списан пример веб сервера с возможность выполнения cgi
> > скриптов:
> >
> > #hins.py
> > #!/usr/bin/python
> > from BaseHTTPServer import HTTPServer
> > from CGIHTTPServer import CGIHTTPRequestHandler
> > import os
> >
> > os.chdir("/home/unatine/hins/html")
> > serv=HTTPServer(('',80),CGIHTTPRequestHandler)
> >
> > serv.serve_forever()
> >
> > в /home/unatine/hins/html лежит index.html и есть каталог cgi-bin в котором лежит скрипт:
> >
> > unatine@localhost ~/hins $ ls -l ./*/*
> > -rw-r--r-- 1 unatine unatine 314 Апр 8 16:44 ./html/index.html
> >
> > ./html/cgi-bin:
> > итого 4
> > -rwxr-xr-x 1 unatine unatine 764 Апр 8 16:26 dict_cgi.py
> >
> > Ну то что сервер должен запускаться от рута это в принципе понятно (иначе ошибка создания сокета)
> > index.html грузится, скрипт даже пытается выполниться, но говорит:
> >
> > localhost - - [08/Apr/2001 21:36:39] "POST /cgi-bin/dict_cgi.py HTTP/1.0" 200 -
> > Traceback (most recent call last):
> > File "/usr/lib/python2.0/CGIHTTPServer.py", line 211, in run_cgi
> > os.execve(scriptfile, args, env)
> > OSError: [Errno 13] Permission denied
> >
> > Какие права должны быть у скрипта и сервера, что бы нормально все выполнилось?
> >
> > Сейчас у сервера права:
> > -rwxr-xr-x 1 unatine unatine 220 Апр 8 16:41 hins.py
> >
> > Людии.... помогите.... а то я уже совсем запутался...
> > И еще... в книге написано что скрипты запускаются от nobody, но в python-docs по этому поводу ничего
> > нет.
>
> Приветствую!
> В целях безопасности Апач работает с правами nobody, и соответственно
> CGI с указанными Вами правами выполнять не имеет права :-), если только
> nobody не является еще и членом группы unatine.
Точнее, группа apache. У нас Apache работает под пользователем apache из группы apache.
> Так что лучше всего, ИМХО, для вашего CGI'шника поставить:
> права -rwxr-xr--
> оунер "любое_удобное_Вам_имя"
> группа nobody
apache
--
Sincerely yours, Alexander Bokovoy
The Midgard Project | ALT Linux Team | Minsk Linux Users Group
www.midgard-project.org | www.altlinux.ru | www.minsk-lug.net
-- Try to be the best of whatever you are, even if what you are is no good.
next prev parent reply other threads:[~2001-04-09 16:50 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-08 22:12 Pavel Marakhovsky
2001-04-08 23:46 ` Ivan Zakharyaschev
2001-04-09 6:20 ` Pavel Marakhovsky
2001-04-09 11:14 ` cornet
2001-04-09 16:50 ` Alexander Bokovoy [this message]
2001-04-09 19:36 ` Pavel Marakhovsky
2001-04-09 22:24 ` Ivan Zakharyaschev
2001-04-09 22:24 ` Ivan Zakharyaschev
2001-04-19 18:01 ` Pavel Marakhovsky
2001-04-10 9:40 ` cornet
2001-04-10 19:05 ` Pavel Marakhovsky
2001-04-10 19:54 ` Ivan Zakharyaschev
2001-04-11 6:26 ` Pavel Marakhovsky
2001-04-10 19:06 ` Pavel Marakhovsky
2001-04-10 19:42 ` Sergey Vlasov
2001-04-11 6:25 ` Pavel Marakhovsky
2001-04-11 9:37 ` cornet
2001-04-11 18:56 ` Pavel Marakhovsky
2001-04-11 11:19 ` Sergey Vlasov
2001-04-11 18:56 ` Pavel Marakhovsky
2001-04-16 8:37 ` Mikhail Zabaluev
2001-04-16 20:02 ` Pavel Marakhovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20010409154827.D27466@avilink.net \
--to=ab@avilink.net \
--cc=mandrake-russian@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git