We help IT Professionals succeed at work.

Symbolic links

movieprodw
movieprodw asked
on
Hello,

I have two domains, two ip addresses and one server.

I am trying to make a magento store work with one installation.

I had it setup as an addon domain and it was just pointing from one folder to another and that was fine but since I moved it to two ip addresses it is broken.

Is there a way to make symbolic links between the domains?

This is how I made them before when they were in the same folder:
ln -s ../public_html/var ./var

so I tried
ln -s /var/www/vhosts/magentodomain.com/var ./var

but when I check the link it does not work.

Thanks for any help,
Matt
Comment
Watch Question

Top Expert 2011
Commented:
What doesn't work?

Pasting actual commands and their output is helpful.  Give 'ls -l' output of the files/directories involved as well.

Not sure if you are addressing the issue properly in general.  Have you read through http://www.magentocommerce.com/knowledge-base/entry/tutorial-multi-site-multi-domain-setup ?

Author

Commented:
Aren't these the commands?

This is how I made them before when they were in the same folder:
ln -s ../public_html/var ./var

so I tried
ln -s /var/www/vhosts/magentodomain.com/var ./var

When I click on the alias folder in my ftp program it says 'not found'

Author

Commented:
I was not trying to sound mean... sorry if I did.

I have a static page up that is their current site, and I want to build the site in the background but if I follow their instructions then it will point that domain to the site and I do not want that yet, so I thought if I could point the site like I was using the symbolic links I could keep working on it as I was.

Matt
Top Expert 2011

Commented:
I didn't know you were using an FTP program, I was hoping for some command line output.

If you want to keep the new store completely separate from the production one, then I suggest copying the directory structure to a new DocumentRoot as opposed to using symlinks.
Top Expert 2011

Commented:
I should add that I have no experience with Magento -- just giving advice from a general Apache admin point of view.

Author

Commented:
I am using a command line to create them but I was going to my ftp program and clicking on them to see if they worked.

I can just build it off the main server but figured it was safer to do it this way as that is how it will be running when I finish.

Matt
Top Expert 2011

Commented:
If the content you are trying to copy is static and not site-specific, then copying to a new directory for your testing will be fine.  If the content is dynamic, then it's probably configured against your production domain, which could cause havoc with your testing domain.

Generally speaking, keep dev/testing completely separate from production.

Author

Commented:
Hello Papertrip,

I have found that the issue is with openbase_dir.

If you read the last part of this page you can see that I still need to make the symbolic links to get the https working.
http://www.crucialwebhost.com/blog/how-to-setup-multiple-magento-stores/

I found this:
http://kb.parallels.com/432

but is there a way to just turn it off for that domain?

Thanks,
Matt

Author

Commented:
Here is what I did:

logged into ssh

created file:
/var/www/vhosts/mydomain.com/conf/vhost.conf

added to file:
<Directory /var/www/vhosts/mydomain.com>
php_admin_value open_basedir none
</Directory>

ran command
/usr/local/psa/admin/sbin/httpdmng --reconfigure-all

but the symbolic links still do not work, is there a way to test if it is on or do I need to do this to both domains or just the one I want access to?

Are you setting it up on cpanel?

If so I have done this and can probably provide you some instructions.
CERTIFIED EXPERT

Commented:
You need to tell Apache to allow the following of symlinks - it is disable by default.

Find the Directory section for your DocumentRoot and add this:

Options FollowSymLinks
If you are running from one install you can do it much easier than this.
You just set the document root to be the same. no symlink needed.

Author

Commented:
I am using Plesk.

I will try your idea xterm
Ok, well with WHM/Cpanel you can just use "add-on" and set the document root for the add-on domain to the same as the main domain. then it uses the same webroot and does not need symlinks(which seems to be the issue.)

Author

Commented:
Yeah, can I still use an SSL for each domain?
Yes, but on cpanel it required a manual edit to get the add-on domain to be on a separate Ip address(which is required to use 2 ssl's).

For each add-on domain I had to edit a file in the following file structure:

/var/cpanel/userdata/$USER/$SUBDOMAIN.$DOMAIN


Where $USER is the cpanel account and $SUBDOMAIN.$DOMAIN is how the addon domain is named.
In this file i just changed the ip address for the addon domain to a different ip and restarted apache. Then I can install ssl for each domain.

Depending on your situation, you may want to look at finding a magento hosting company to use, and ask them if they have directions to set up a multiSite Installation.

Author

Commented:
Okay, I am using plesk not cPanel though
Correct, so you will probably need to do something similar(not exactly the same).

That is also why I suggested that you think about using a hosting provider that can provide documentation for setting up magento this way.

Author

Commented:
Thanks for your help.

It was an issue with open base dir

Explore More ContentExplore courses, solutions, and other research materials related to this topic.