Two VHosts Use Same DocumentRoot, PHP Not Working on Second VHost

Posted by thegrip on Server Fault See other posts from Server Fault or by thegrip
Published on 2011-03-30T17:53:40Z Indexed on 2012/11/18 11:10 UTC
Read the original article Hit count: 270

Filed under:

I'm helping maintain an e-commerce site that is run on Magento. This site is an outlet for our wholesale customers. We have recently decided to open a second store to reach out to our Retail customers. We decided to set up another website inside of our magento store so that we can share the products across both stores.

I'm in the process of setting up this new site on the server, but have run into an issue. I've set up the second vhost for the new retail site, and I've made the DocumentRoot for this vhost the same as for the wholesale site, so we can use one magento application for both sites. This is where the error occurs.

When I browse to the new store it triggers a download of the index.php file. So I know the DocumentRoot directive is working, but it seems like PHP is being broken in the process.

I'm using plesk to manage the server. I've made sure that PHP is turned on in both vhosts and still get the same issue.

Does this sound like a problem of PHP breaking, or is it possible my vhost.conf file is set up incorrectly? (Although the vhost is managed by plesk and appears correct)

Any help will be much appreciated.

EDIT:

Here's the vhost configs (generated by plesk):

<VirtualHost IPADDRESS:80>
ServerName   domain.com:80
ServerAdmin  "[email protected]"
DocumentRoot /var/www/vhosts/domain.com/subdomains/tk/httpdocs
CustomLog  /var/www/vhosts/domain.com/statistics/logs/access_log plesklog
ErrorLog  /var/www/vhosts/domain.com/statistics/logs/error_log
<IfModule mod_ssl.c>
    SSLEngine off
</IfModule>
<Directory  /var/www/vhosts/domain.com/subdomains/tk/httpdocs>
<IfModule mod_php4.c>
    php_admin_flag engine on
    php_admin_flag safe_mode off
    php_admin_value open_basedir "/var/www/vhosts/domain.com/subdomains/tk/httpdocs:/tmp"
</IfModule>
<IfModule mod_php5.c>
    php_admin_flag engine on
    php_admin_flag safe_mode off
    php_admin_value open_basedir "/var/www/vhosts/mkdesigngroup.com/subdomains/tk/httpdocs:/tmp"
</IfModule>
    Options -Includes -ExecCGI
</Directory>
Include /var/www/vhosts/domain.com/subdomains/tk/conf/vhost.conf

And here's what I've added in vhost.conf (which is included by plesk):

DocumentRoot /var/www/vhosts/domain.com/subdomains/dev/httpdocs

-grip

© Server Fault or respective owner

Related posts about magento