Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #47968
| From | Νικόλαος Κούρας <support@superhost.gr> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Wrong website loaded when other requested |
| Date | 2013-06-13 17:23 +0300 |
| Organization | National Technical University of Athens, Greece |
| Message-ID | <kpckku$28k2$2@news.ntua.gr> (permalink) |
| References | <kpabcm$275g$6@news.ntua.gr> <mailman.3131.1371069364.3114.python-list@python.org> <kpbpj9$qvk$4@news.ntua.gr> |
On 13/6/2013 9:41 πμ, Νικόλαος Κούρας wrote:
> On 12/6/2013 11:35 μμ, Joel Goldstick wrote:
>>
>>
>>
>> On Wed, Jun 12, 2013 at 1:33 PM, Νικόλαος Κούρας <support@superhost.gr
>> <mailto:support@superhost.gr>> wrote:
>>
>> ======================
>> RewriteEngine On
>> RewriteCond %{REQUEST_FILENAME} -f
>> RewriteRule ^/?(.+\.html)
>> /cgi-bin/metrites.py?file=%{__REQUEST_FILENAME} [L,PT,QSA]
>> ======================
>>
>> [code]
>> file = form.getvalue('file')
>> page = form.getvalue('page')
>>
>> if not page and os.path.exists( file ):
>> # it is an html template
>> page = file.replace( '/home/dauwin/public_html/', '' )
>> elif page or form.getvalue('show'):
>> # it is a python script
>> page = page..replace(
>> '/home/dauwin/public_html/cgi-__bin/', '' )
>> else:
>> #when everything else fails fallback
>> page = "index.html"
>>
>> ....
>> ....
>>
>> if page.endswith('.html'):
>> with open( '/home/dauwin/public_html/' + page,
>> encoding='utf-8' ) as f:
>> htmlpage = f.read()
>> htmlpage = htmlpage % (quote, music)
>> template = htmlpage + counter
>> elif page.endswith('.py'):
>> pypage = subprocess.check_output(
>> '/home/dauwin/public_html/cgi-__bin/' + page )
>> pypage = pypage.decode('utf-8').__replace(
>> 'Content-type: text/html; charset=utf-8', '' )
>> template = pypage + counter
>>
>> print( template )
>> [/code]
>>
>> Everything as you see point to 'dauwin' username, yet the error
>> still says:
>>
>> [code]
>> [Tue Jun 11 21:59:31 2013] [error] [client 79.103.41.173] File
>> "/home/nikos/public_html/cgi-__bin/metrites.py", line 219, in
>> <module>, referer: http://superhost.gr/
>> [Tue Jun 11 21:59:31 2013] [error] [client 79.103.41.173] with
>> open( '/home/nikos/public_html/' + page, encoding='utf-8' ) as f:,
>> referer: http://superhost.gr/
>> [Tue Jun 11 21:59:31 2013] [error] [client 79.103.41.173]
>> FileNotFoundError: [Errno 2] \\u0394\\u03b5\\u03bd
>> \\u03c5\\u03c0\\u03ac\\u03c1\\__u03c7\\u03b5\\u03b9
>> \\u03c4\\u03ad\\u03c4\\u03bf\\__u03b9\\u03bf
>> \\u03b1\\u03c1\\u03c7\\u03b5\\__u03af\\u03bf \\u03ae
>> \\u03ba\\u03b1\\u03c4\\u03ac\\__u03bb\\u03bf\\u03b3\\u03bf\\__u03c2:
>> '/home/nikos/public_html//__home/dauwin/public_html/index.__html',
>> referer: http://superhost.gr/
>> [/code]
>>
>>
>> Notice that you have the file path you want concatenated to your
>> /home/nikos/... stuff in the line above. Look in your code to find out
>> why. Fix that. Lather, rinse, repeat
>
> In my source code as seen above i mention nowhere for '/home/nikos/' but
> instead for '/home/dauwin/'
>
> That error message makes me come to conclusion that metrites.py script
> is running from user's nikos' cgi-bin:
>
> /home/nikos/public_html/cgi-bin/metrites.py
>
> instead of:
>
> /home/dauwin/public_html/cgi-bin/metrites.py
>
> I wonder why.
> I mean iam sayign it clearly
>
> with open( '/home/dauwin/public_html/' + page,
>
> and the error says:
>
> [Tue Jun 11 21:59:31 2013] [error] [client 79.103.41.173] with
> > open( '/home/nikos/public_html/' + page, encoding='utf-8' ) as f:,
> > referer: http://superhost.gr/
>
> What happens when i give http://superhost.gr/~dauwin
>
> Why home/nikos/public_html/cgi-bin/metrites.py seems to be the scritp
> that always run?
>
> That should have run when i browser: 'http://superhost.gr' and not when
> i browse 'http://superhost.gr/~dauwin'
>
> Please help. A client wanst to utilize my metrites.py script because he
> lieks the way that has a seperate counter for each html page and the way
> the log is presented in an html table like form.
> Of course i will give it it to him for free.
Please suggest something of why this happnes.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Wrong website loaded when other requested Νικόλαος Κούρας <support@superhost.gr> - 2013-06-12 20:33 +0300
Re: Wrong website loaded when other requested Νικόλαος Κούρας <support@superhost.gr> - 2013-06-12 23:03 +0300
Re: Wrong website loaded when other requested Nick the Gr33k <support@superhost.gr> - 2013-06-13 21:10 +0300
Re: Wrong website loaded when other requested Joel Goldstick <joel.goldstick@gmail.com> - 2013-06-13 14:28 -0400
Re: Wrong website loaded when other requested Nick the Gr33k <support@superhost.gr> - 2013-06-13 21:43 +0300
Re: Wrong website loaded when other requested Nick the Gr33k <support@superhost.gr> - 2013-06-14 10:40 +0300
Re: Wrong website loaded when other requested Andreas Perstinger <andipersti@gmail.com> - 2013-06-13 20:37 +0200
Re: Wrong website loaded when other requested Nick the Gr33k <support@superhost.gr> - 2013-06-13 21:47 +0300
Re: Wrong website loaded when other requested Grant Edwards <invalid@invalid.invalid> - 2013-06-13 19:31 +0000
Re: Wrong website loaded when other requested Nick the Gr33k <support@superhost.gr> - 2013-06-14 09:14 +0300
Re: Wrong website loaded when other requested Chris Angelico <rosuav@gmail.com> - 2013-06-14 17:24 +1000
Re: Wrong website loaded when other requested Grant Edwards <invalid@invalid.invalid> - 2013-06-14 14:44 +0000
Re: Wrong website loaded when other requested Chris Angelico <rosuav@gmail.com> - 2013-06-13 06:19 +1000
Re: Wrong website loaded when other requested Joel Goldstick <joel.goldstick@gmail.com> - 2013-06-12 16:35 -0400
Re: Wrong website loaded when other requested Νικόλαος Κούρας <support@superhost.gr> - 2013-06-13 09:41 +0300
Re: Wrong website loaded when other requested Νικόλαος Κούρας <support@superhost.gr> - 2013-06-13 17:23 +0300
Re: Wrong website loaded when other requested Chris Angelico <rosuav@gmail.com> - 2013-06-14 00:28 +1000
Re: Wrong website loaded when other requested rusi <rustompmody@gmail.com> - 2013-06-13 09:47 -0700
Re: Wrong website loaded when other requested Thomas Murphy <thomasmurphymusic@gmail.com> - 2013-06-13 10:48 -0400
Re: Wrong website loaded when other requested Andreas Perstinger <andipersti@gmail.com> - 2013-06-13 16:54 +0200
Re: Wrong website loaded when other requested Νικόλαος Κούρας <support@superhost.gr> - 2013-06-13 19:23 +0300
Re: Wrong website loaded when other requested Chris Angelico <rosuav@gmail.com> - 2013-06-14 02:28 +1000
Re: Wrong website loaded when other requested Νικόλαος Κούρας <support@superhost.gr> - 2013-06-13 20:03 +0300
Re: Wrong website loaded when other requested Chris Angelico <rosuav@gmail.com> - 2013-06-14 01:11 +1000
Re: Wrong website loaded when other requested Νικόλαος Κούρας <support@superhost.gr> - 2013-06-13 19:24 +0300
RFD: rename comp.lang.python to comp.support.superhost alex23 <wuwei23@gmail.com> - 2013-06-13 20:25 -0700
Re: RFD: rename comp.lang.python to comp.support.superhost Fábio Santos <fabiosantosart@gmail.com> - 2013-06-14 09:41 +0100
Re: RFD: rename comp.lang.python to comp.support.superhost Roy Smith <roy@panix.com> - 2013-06-14 08:06 -0400
Re: RFD: rename comp.lang.python to comp.support.superhost Gene Heskett <gheskett@wdtv.com> - 2013-06-14 08:47 -0400
Re: RFD: rename comp.lang.python to comp.support.superhost Zero Piraeus <schesis@gmail.com> - 2013-06-14 09:06 -0400
Re: RFD: rename comp.lang.python to comp.support.superhost Ben Finney <ben+python@benfinney.id.au> - 2013-06-15 10:26 +1000
Re: RFD: rename comp.lang.python to comp.support.superhost Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2013-06-15 19:11 +0200
Re: RFD: rename comp.lang.python to comp.support.superhost Nick the Gr33k <support@superhost.gr> - 2013-06-15 20:29 +0300
Re: RFD: rename comp.lang.python to comp.support.superhost rusi <rustompmody@gmail.com> - 2013-06-15 10:39 -0700
Re: RFD: rename comp.lang.python to comp.support.superhost Fábio Santos <fabiosantosart@gmail.com> - 2013-06-15 18:43 +0100
Re: RFD: rename comp.lang.python to comp.support.superhost Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-06-15 18:43 +0100
Re: RFD: rename comp.lang.python to comp.support.superhost Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-15 17:51 +0000
Re: RFD: rename comp.lang.python to comp.support.superhost Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-06-15 19:26 +0100
Re: RFD: rename comp.lang.python to comp.support.superhost Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-06-16 20:47 +0200
Re: RFD: rename comp.lang.python to comp.support.superhost Alister <alister.ware@ntlworld.com> - 2013-06-15 17:52 +0000
Re: RFD: rename comp.lang.python to comp.support.superhost Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2013-06-15 20:07 +0200
Re: RFD: rename comp.lang.python to comp.support.superhost Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2013-06-15 19:55 +0200
Re: Wrong website loaded when other requested Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-06-14 10:56 +0100
Re: Wrong website loaded when other requested Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-06-13 14:04 +0100
Re: Wrong website loaded when other requested Joel Goldstick <joel.goldstick@gmail.com> - 2013-06-13 11:35 -0400
Re: Wrong website loaded when other requested Νικόλαος Κούρας <support@superhost.gr> - 2013-06-13 19:52 +0300
Re: Wrong website loaded when other requested Νικόλαος Κούρας <nikos.gr33k@gmail.com> - 2013-06-13 11:04 -0700
Re: Wrong website loaded when other requested Nick the Gr33k <support@superhost.gr> - 2013-06-14 18:37 +0300
Re: Wrong website loaded when other requested rusi <rustompmody@gmail.com> - 2013-06-14 08:45 -0700
Re: Wrong website loaded when other requested Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-14 16:15 +0000
Re: Wrong website loaded when other requested Nick the Gr33k <support@superhost.gr> - 2013-06-14 19:22 +0300
Re: Wrong website loaded when other requested Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-06-14 17:46 +0100
Re: Wrong website loaded when other requested Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-06-14 19:45 +0100
Re: Wrong website loaded when other requested Nick the Gr33k <support@superhost.gr> - 2013-06-15 09:48 +0300
csiph-web