Networking Forums

Networking Forums > Computer Networking > Linux Networking > weird behaviour of Sessions directory on MediaTemple (dv) host

Reply
Thread Tools Display Modes

weird behaviour of Sessions directory on MediaTemple (dv) host

 
 
internet@jalab.net
Guest
Posts: n/a

 
      11-29-2007, 04:48 PM
i just migrated my Oscommerce based site from mediatemple GS plan (a
shared hosting) to a DV plan (virtual private/dedicated)

the new url is: http://72.47.210.90/
the new server installs CentOS 4.4 (more specs here
http://kb.mediatemple.net/article.php?id=239)

the server's FS looks like this:
* drwxrwxrwx --- tmp
* ....
* drwxr-xr-x --- usr
* drwxr-xr-x --- var
o tmp
o ...
o www
+ html
+ ...
+ vhosts
# ...and so on...
+ ...
o db
o ...
o lib
and so on.....

at first, I saw the session was not working properly, and i was
getting warnings from the application (Warning: The sessions directory
does not exist)

I then tried to create TMP folders everwhere (www, vhost,
domainname.com, httpdocs ), always giving chmod 777, right owner, and
eventually changing the session.save_path accordingly, but always with
same error.

Later i did more test, and i realized the session files are actually
created in the right folder when the pages load, but:

the main problem is:
1. a new session file is created on every page reload, so the session
information are not kept between one page an another

plus, other strange details which are not creating problems directly,
but may be related:
2. is_dir() function doesnt see the session folder path
[is_dir('/var/www/vhosts/mydomain.com/tmp') returns FALSE]

3. for testing, i tried to printout the dir structure from within php:
while (false !== ($file = readdir('./'))) {
if ($file != "." && $file != "..") {
echo "$file\n";
}
}

on other servers it will return the folder content, eg:
html
cgi-bin
..htaccess

while on this server i get nothing, just like i was on the root of the
server!

mediatemple is not answering on this, and i am lost!
could anyone enlighten me?
 
Reply With Quote
 
 
 
 
internet@jalab.net
Guest
Posts: n/a

 
      11-30-2007, 05:09 PM
ok, as i didnt receive any reply, i will answer myself, as i finally
found the solution:

my application (oscommerce) check in php (using is_dir function) the
existence of the session directory in order to work.

But PHP doesnt see '/' as the server's FS root (the actual '/' ) but
as '/var/www/vhosts/mydomain.com/tmp'

therefore, in the original settings of the server, php could not find
either '/tmp' , '/var/lib/php/session/' nor '/var/www/vhosts/
mydomain.com/tmp' as it just couldnt read from the root.

I then followed the instruction at http://kb.mediatemple.net/article.php?id=652,
and created the '/var/www/vhosts/mydomain.com/tmp' folder, but
is_dir('/var/www/vhosts/mydomain.com/tmp') was still returning false.

finally, i changed the PHP session settings back to the orginal '/tmp'
value;
is_dir('/tmp') now doesnt check the actual FS '/tmp', but '/var/www/
vhosts/mydomain.com/tmp';
but now i've created it, so it will now return TRUE.



On Nov 30, 1:48 am, inter...@jalab.net wrote:
> i just migrated my Oscommerce based site from mediatemple GS plan (a
> shared hosting) to a DV plan (virtual private/dedicated)
>
> the new url is:http://72.47.210.90/
> the new server installs CentOS 4.4 (more specs herehttp://kb.mediatemple.net/article.php?id=239)
>
> the server's FS looks like this:
> * drwxrwxrwx --- tmp
> * ....
> * drwxr-xr-x --- usr
> * drwxr-xr-x --- var
> o tmp
> o ...
> o www
> + html
> + ...
> + vhosts
> # ...and so on...
> + ...
> o db
> o ...
> o lib
> and so on.....
>
> at first, I saw the session was not working properly, and i was
> getting warnings from the application (Warning: The sessions directory
> does not exist)
>
> I then tried to create TMP folders everwhere (www, vhost,
> domainname.com, httpdocs ), always giving chmod 777, right owner, and
> eventually changing the session.save_path accordingly, but always with
> same error.
>
> Later i did more test, and i realized the session files are actually
> created in the right folder when the pages load, but:
>
> the main problem is:
> 1. a new session file is created on every page reload, so the session
> information are not kept between one page an another
>
> plus, other strange details which are not creating problems directly,
> but may be related:
> 2. is_dir() function doesnt see the session folder path
> [is_dir('/var/www/vhosts/mydomain.com/tmp') returns FALSE]
>
> 3. for testing, i tried to printout the dir structure from within php:
> while (false !== ($file = readdir('./'))) {
> if ($file != "." && $file != "..") {
> echo "$file\n";
> }
>
> }
>
> on other servers it will return the folder content, eg:
> html
> cgi-bin
> .htaccess
>
> while on this server i get nothing, just like i was on the root of the
> server!
>
> mediatemple is not answering on this, and i am lost!
> could anyone enlighten me?


 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
weird behaviour with slackware 11, wrong arp-requests axel fehrs Linux Networking 3 02-05-2007 08:37 AM
weird iptables behaviour Fabio Linux Networking 6 11-25-2006 10:38 PM
weird adsl behaviour neal Broadband 19 12-20-2005 02:57 PM
Weird ping behaviour using 3Com OfficeConnect Wireless-G access point Martin G Wireless Internet 0 01-11-2005 08:31 PM
Access to public host from private host through Linux router Santanu Chatterjee Linux Networking 5 11-14-2003 11:57 PM



1 2 3 4 5 6 7 8 9 10 11