You are here: Re: Run PHP scripts outside of the web directory « PHP Programming Language « IT news, forums, messages
Re: Run PHP scripts outside of the web directory

Posted by Toby A Inkster on 02/13/07 15:58

Aggelos wrote:

> Is it possible to run a script that will be used from all the websites
> on the server outside of the web dir ?

I'm not 100% sure what you're asking for, but it sounds to me like
symbolic links might be the answer.

Say you have three sites hosted on a server, example.com, example.org
and... you guessed it... example.net. These are hosted in the following
directories on the server:

/var/www/vhosts/example.com/
/var/www/vhosts/example.org/
/var/www/vhosts/example.net/

Now, you install some flashy-super-web-based-app into, say:

/var/www/apps/FSWBA/

and you want to make this available as:

http://example.com/FSWBA/
http://example.org/flashy/
http://example.net/flashy-app/

Then all you need to do is create three symbolic links, using the
following commands at the command line:

ln -s /var/www/apps/FSWBA/ /var/www/vhosts/example.com/FSWBA/
ln -s /var/www/apps/FSWBA/ /var/www/vhosts/example.org/flashy/
ln -s /var/www/apps/FSWBA/ /var/www/vhosts/example.net/flashy-app/

And you're done. (Note: you may need to configure Apache to be able to
follow symbolic links, as this ability is often disabled for security
reasons.)

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация