[OT] Sharing folders between web sites

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[OT] Sharing folders between web sites

Phil Kopp
Hi,

Here's a question for the web site admins out there:

I have a web site with the following folder structure:

\root
   \folder1
      \folder2
      \folder3

Most of my product and shopping content is in folder1. folder2 and folder3
contain product photos. The database has fields that refer to those photos
as 'folder2\part-number.jpg'. If there are more photos of that part-number
they are named in an organized manner such that I can use file_exist to see
if there are more than just the original. Works great.

I want to create a new website on this same server using the same product
database. I want folder2 and folder3 to appear on the new site in the same
relationship as they do on the original site so the database fields will
remain valid and I can use the same lasso code for managing photos. Also, I
don't want to have two copies of hundreds ( or thousands) of photos.

My Web Server admin has been able to create the logical links to these two
folders so they appear correctly in my new site folder, but I can not get
anything in those folders to display on the new site. Assume field:'photo'
contains 'folder2\partnumber.jpg'. If I create an image link '<img
src="[field:'photo']"> nothing shows on the page. I get the missing image
red x. file_exist always returns false, so a lot of that code isn't working
correctly either.

The new site is currently organized like this:

\root
   \folder2
   \folder3

In my FTP client, I can change permissions on folder2 and folder3 if I am
logged in to the original site. When logged in to the new site, I can't
change permissions. This makes me think this is a permissions problem, but
I'm not a web admin.

My sites are hosted on Mac servers.

Is this possible, or no? Can I recreate both sites in such a way that it is
possible? (shudder)

TIA very much,

--
Phil



------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Sharing folders between web sites

Phil Kopp
Hans de Wit:
>
><img src="[$website][field:'photo']">

That solves the image display problem, but not the file_exists issue.

Thanks!

Phil


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Sharing folders between web sites

Greg Willits-2
In reply to this post by Phil Kopp
On May 8, 2006, at 10:59 AM, Phil Kopp wrote:

> I have a web site with the following folder structure:
>
> \root
>    \folder1
>       \folder2
>       \folder3
>
> I want to create a new website on this same server using the same  
> product
> database. I want folder2 and folder3 to appear on the new site in  
> the same
> relationship as they do on the original site so the database fields  
> will
> remain valid and I can use the same lasso code for managing photos.  
> Also, I
> don't want to have two copies of hundreds ( or thousands) of photos.
>
> My Web Server admin has been able to create the logical links to  
> these two
> folders so they appear correctly in my new site folder, but I can  
> not get
> anything in those folders to display on the new site. Assume  
> field:'photo'
> contains 'folder2\partnumber.jpg'. If I create an image link '<img
> src="[field:'photo']"> nothing shows on the page. I get the missing  
> image
> red x. file_exist always returns false, so a lot of that code isn't  
> working
> correctly either.

The quick and dirty answer is to use symlinks.

\rootA
    \folder1
       \folder2     // is a symlink to /mstrFolder2/
       \folder3     // is a symlink to /mstrFolder3/

\rootB
    \folder1
       \folder2     // is a symlink to /mstrFolder2/
       \folder3     // is a symlink to /mstrFolder3/

/mstrFolder2/
/mstrFolder3/


-- gw



------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Sharing folders between web sites

Jussi Hirvi
In reply to this post by Phil Kopp
Greg Willits ([hidden email]) kirjoitteli (8.5.2006 21:15):
> The quick and dirty answer is to use symlinks.

Or:

\rootA
\folder1
   \folder2
   \folder3

\rootB
\folder1
   \folder2     // is a symlink to /rootA/Folder2/
   \folder3     // is a symlink to /rootA/Folder3/

Maybe you should check your Apache config: do you have FollowSymLinks
specified?? Just a shot in the dark.

- Jussi Hirvi

--
Jussi Hirvi * Green Spot
Topeliuksenkatu 15 C * 00250 Helsinki * Finland
Tel. & fax +358-9-493 981
Mobile +358-40-771 2098 (only text messages)
[hidden email] * http://www.greenspot.fi/


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Sharing folders between web sites

Steve Upton
In reply to this post by Phil Kopp
At 12:38 PM +0300 5/9/06, Jussi Hirvi wrote:

>Greg Willits ([hidden email]) kirjoitteli (8.5.2006 21:15):
>> The quick and dirty answer is to use symlinks.
>
>Or:
>
>\rootA
>\folder1
>   \folder2
>   \folder3
>
>\rootB
>\folder1
>   \folder2     // is a symlink to /rootA/Folder2/
>   \folder3     // is a symlink to /rootA/Folder3/
>
>Maybe you should check your Apache config: do you have FollowSymLinks
>specified?? Just a shot in the dark.

There are two different kinds of symbolic links (I'm not an authority on this).. Soft links and hard links.

Think of soft links like an alias in OS X. It's small and points to the original file. A hard link makes you think a little more about how files are stored. A file on your disk is composed of the catalog entry and the actual storage area. A soft link points to the catalog entry that points to the actual file. A hard link actually creates a new catalog entry that points to the same storage area.

The reason I'm telling you this is that OS X thinks that a hard link is a normal file and Apache does too so it will happily serve it to the world. If you delete either of the original "files" (catalog entries), the file is not lost - unlike an alias where deleting the main catalog entry removes the file and the alias is dead. Only when all "files" for the actual file are deleted is the actual storage removed from the disk...

sorry for the rambling entry but it took a while for me to get my head around it and now I use it when I run into a sticky situation like this.

look up more information on symbolic links and try making a hard link.... very cool...

reason # 1001 why I'm happy Apple chose UNIX for Mac OS X

Regards,

Steve Upton


________________________________________________________________________
o  Steve Upton              CHROMiX        www.chromix.com
o   (hueman)                               866.CHROMiX
o    [hidden email]                     206.985.6837
o  ColorGear   ColorThink   ColorValet   ColorSmarts   ProfileCentral
________________________________________________________________________
--


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Sharing folders between web sites

Chris Wik
In reply to this post by Phil Kopp
Steve Upton wrote:
> There are two different kinds of symbolic links (I'm not an authority
> on this).. Soft links and hard links.
Well explained, just a semantic error which is important: a "soft link"
and a "symbolic link" are the same thing, a "hard link" is different,
therefore you have two kinds of links, not two kinds of symbolic links.

There is one other significant distinction between symbolic and hard
links, other than what you described: you can create a symbolic link of
a directory, but you cannot create a hard link of a directory.

--
Chris Wik <mailto:[hidden email]>
ANU Internet Services
http://www.anu.net/


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Sharing folders between web sites

Marc Vos-3
In reply to this post by Phil Kopp
The thing with UNIX is to regard any object on disk as a hard link to  
its data. The data exists as long as there is 1 valid hard link  
pointing to it. For example, create a file, say foo.txt in /tmp (cd /
tmp; echo This is a hard link test > foo.txt). Create a hard link  
with ln in directory /var/tmp and name it foo-hard.txt (cd /var/tmp;  
ln /tmp/foo.txt ./foo-hard.txt). Next, delete /tmp/foo.txt (cd /tmp;  
rm foo.txt; cd /var/tmp) and do a 'cat foo-hard.txt'. You'll see the  
contents of the orgiginally created foo.txt because foo and foo-hard  
are the same file with 2 hard links. When you deleted /tmp/foo.txt,  
only 1 hard link was left, so the data wasn't erased. When you now  
erase foo-hard.txt, UNIX sees that no hard links are left pointing to  
the data and erases the data as well.

A symbolic link is like an alias in the Finder or a shortcut in Windows.

Regards,
-Marc Vos

* * * * * * * * * * * * * * * * * * * * * * * *
Goodyear Dunlop Tires Germany GmbH
Private:  http://marc.vos.net/
iChat/AIM : mhevos
* * * * * * * * * * * * * * * * * * * * * * * *


On 9-mei-2006, at 21:03, Chris Wik wrote:

> Steve Upton wrote:
>> There are two different kinds of symbolic links (I'm not an  
>> authority on this).. Soft links and hard links.
> Well explained, just a semantic error which is important: a "soft  
> link" and a "symbolic link" are the same thing, a "hard link" is  
> different, therefore you have two kinds of links, not two kinds of  
> symbolic links.
>
> There is one other significant distinction between symbolic and  
> hard links, other than what you described: you can create a  
> symbolic link of a directory, but you cannot create a hard link of  
> a directory.
>
> --
> Chris Wik <mailto:[hidden email]>
> ANU Internet Services
> http://www.anu.net/
>
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:  http://www.listsearch.com/ 
> lassotalk.lasso?manage


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage