Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, I'm hosting some sites on a dedicated server. All these sites make use of the same codebase (couple of directories with php and javascript files). Because I want to ...
  1. #1
    Just Joined!
    Join Date
    Mar 2010
    Posts
    3

    [SOLVED] Share codebase via symlinks?

    Hi,
    I'm hosting some sites on a dedicated server. All these sites make use of the same codebase (couple of directories with php and javascript files).
    Because I want to manage this codebase on only one location, I was trying to share it via symlinks. When looking at commandline, everything seemed to work fine. However, when browsing to the sites that use the codebase, problems occur. It seems as if php cannot find the files.

    Can someone tell me whether this is a correct setup or what I should do to fix this?

    Thanks!

  2. #2
    Linux Engineer Freston's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    1,047
    Welcome to the forums!

    Just a couple of questions...
    Did you use relative paths or absolute paths for the symlinks? It could go wrong there.
    Does the inability to find files leave traces in the logs? That might give a clue.
    Can't tell an OS by it's GUI

  3. #3
    Just Joined!
    Join Date
    Mar 2010
    Posts
    3
    I created the symlink like this, so absolute:

    ln -s /var/www/vhosts/[sourcedomain.com]/httpdocs/core/ /var/www/vhosts/[domain.com]/httpdocs/core


    The error log shows this warning for example

    PHP Warning: include(core/functions.php) [<a href='function.include'>function.include</a>]: failed to open stream: Operation not permitted in /var/www/vhosts/[domain.com]/httpdocs/config.php on line 8

  4. #4
    Just Joined!
    Join Date
    Mar 2010
    Posts
    3
    Problem solved.

    I created a vhost.conf file with:

    Code:
    <Directory /var/www/vhosts/domein.com/httpdocs>
    Options FollowSymLinks
    php_admin_value open_basedir /var/www/vhosts/domein.com/httpdocs:/tmp:/
    </Directory>
    After apache was restarted everything worked.

    Thanks for your help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...