Wrong website loaded when other requested
Nick the Gr33k
support at superhost.gr
Thu Jun 13 14:43:07 EDT 2013
On 13/6/2013 9:28 μμ, Joel Goldstick wrote:
>
>
>
> On Thu, Jun 13, 2013 at 2:10 PM, Nick the Gr33k <support at superhost.gr
> <mailto:support at superhost.gr>> wrote:
>
>
>
> Τη Πέμπτη, 13 Ιουνίου 2013 7:52:27 μ.μ. UTC+3, ο χρήστης Νικόλαος
> Κούρας έγραψε:
> > On 13/6/2013 6:35 μμ, Joel Goldstick wrote:
> >
> >> [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]
> >
> >>
> >
> >> DO YOU SEE THIS PART:
> >
> >> '/home/nikos/public_html//__home/dauwin/public_html/index.__html',
> >
> >> referer: http://superhost.gr/
> >
> >>
> >
> >> Do you see that it prepends your nikos path the your dauwin path and
> >
> >> file name. It isn't replacing one with the other. Somewhere in
> your
> >
> >> SFBI mess of code you perhaps have set the nikos path as the
> start of a
> >
> >> filename. Check that out
> >
> >
> >
> > yes i saw your post Joel,
> >
> >
> >
> > After research i am under the impression that i'am in need for
> UserDir
> >
> > directive as it essentially allows you to use User Home
> directories as
> >
> > web directories...
> >
> >
> >
> > So after reading this:
> >
> >
> http://centosforge.com/node/__how-get-userdir-user-specific-__publichtml-working-apache-__centos-6
> <http://centosforge.com/node/how-get-userdir-user-specific-publichtml-working-apache-centos-6>
> >
> > i did this:
> >
> >
> >
> >
> >
> > <IfModule !mod_ruid2.c>
> >
> > UserDir public_html
> >
> > </IfModule>
> >
> > <IfModule mod_ruid2.c>
> >
> > #UserDir disabled
> >
> > UserDir "enabled *"
> >
> > UserDir "disabled root"
> >
> > </IfModule>
> >
> >
> >
> >
> >
> >
> >
> > root at nikos [~]# chmod 711 /home
> >
> > root at nikos [~]# chmod 711 /home/nikos
> >
> > root at nikos [~]# chmod 755 /home/nikos/public_html/
> >
> > root at nikos [~]# chmod o+r /home/nikos/public_html/index.__html
> >
> > root at nikos [~]# chmod 711 /home/dauwin
> >
> > root at nikos [~]# chmod 755 /home/dauwin/public_html/
> >
> > root at nikos [~]# chmod o+r /home/dauwin/public_html/__index.html
> >
> > root at nikos [~]#
> >
> >
> >
> > setsebool -P httpd_enable_homedirs true
> >
> > chcon -R -t httpd_sys_content_t /home/testuser/public_html
> >
> > (the last one one failed though)
> >
> >
> >
> > the i restarted Apache but the problem is still there.
> >
> >
> >
> > ===================
> >
> > nikos at superhost.gr <mailto:nikos at superhost.gr> [~]# [Thu Jun 13
> 19:50:57 2013] [error] [client
> >
> > 79.103.41.173] Error in sys.excepthook:
> >
> > [Thu Jun 13 19:50:57 2013] [error] [client 79.103.41.173] ValueError:
> >
> > underlying buffer has been detached
> >
> > [Thu Jun 13 19:50:57 2013] [error] [client 79.103.41.173]
> >
> > [Thu Jun 13 19:50:57 2013] [error] [client 79.103.41.173] Original
> >
> > exception was:
> >
> > [Thu Jun 13 19:50:57 2013] [error] [client 79.103.41.173] Traceback
> >
> > (most recent call last):
> >
> > [Thu Jun 13 19:50:57 2013] [error] [client 79.103.41.173] File
>
> >
> > "/home/nikos/public_html/cgi-__bin/metrites.py", line 213, in
> <module>
> >
> > [Thu Jun 13 19:50:57 2013] [error] [client 79.103.41.173]
> with open(
>
> >
> > '/home/nikos/public_html/' + page, encoding='utf-8' ) as f:
> >
> > [Thu Jun 13 19:50:57 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'
>
>
> SECOND TIME:
>
> I'm not an apache wizard, and I'm too self important to really look
> through all of your code. i don't getting germs. But, once again:
>
> your code is not finding a file named this:
> '/home/nikos/public_html//home/dauwin/public_html/index.html'
>
> The first part of this file path is:'/home/nikos/public_html
>
> After that are TWO forward slashes which remind me of http:// and
> following that is the path you want. so, you need to put new batteries
> in your brain, look through your mess and figure out what creates the
> wrong file name for you
Well, since you think i'm idiot enough to use '/home/nikos' in a script
running under username 'dauwin' here are the proofs for you:
root at nikos [~]# cat /home/dauwin/www/cgi-bin/metrites.py | grep
"/home/nikos/"
root at nikos [~]# cat /home/dauwin/www/cgi-bin/metrites.py | grep
"/home/dauwin/"
page = file.replace( '/home/dauwin/public_html/', '' )
with open( '/home/dauwin/public_html/' + page,
encoding='utf-8' ) as f:
pypage = subprocess.check_output(
'/home/dauwin/public_html/cgi-bin/' + page )
root at nikos [~]#
I believe that no matter if i browse 'htt://superhost.gr' or
'http://superhost.gr/~dauwin'
somethign happens with the DocumentRoot of the domain and the web URL
translate to file '/home/nikos/public_html/cgi-bin/metrites.py' for any
http://superhost.gr/* request.
So, an Apache configuration is in order and not a python code alternation.
--
What is now proved was at first only imagined!
More information about the Python-list
mailing list