Running Multi Store on Magento - magento

I'm running two stores in magento 1.7 ..
abc.example.com
xyz.example.com
abc.example.com is the main store and from where I'm using magento admin panel.
in xyz.example i change index file to
Mage::run($mageRunCode,$mageRunType);
to
Mage::run('xyz_code','xyz.example.com');
but from this I'm redirecting to 404 page. and when i keep first parameter empty like Mage::run('','xyz.example.com'); the web open abc.example.com
any idea what causing that?

Change index file to Mage::run($mageRunCode,$mageRunType); to Mage::run('xyz_code','xyz.example.com'). You need to create symbolic links to point to a few directories.
ln -s ../public_html/app ./app
ln -s ../public_html/errors ./errors
ln -s ../public_html/includes ./includes
ln -s ../public_html/js ./js
ln -s ../public_html/lib ./lib
ln -s ../public_html/media ./media
ln -s ../public_html/skin ./skin
ln -s ../public_html/var ./var
This might help you. http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/navigation/multiple-website-setup

Related

Running oracle queries through azure databricks

Hi I created a notebook in azure databricks to extract a table from an oracle database. I get the error DPI-1047 cannot locate a 64 bit oracle client library. I guess I have to have an oracle client library running on my cluster. I tried to research the issue and found many posts where people said I needed an init script for the oracle client. I couldnt find how to make that init script however. I also found on this website
https://medium.com/#srijansahay/connecting-sql-server-oracle-mysql-and-postgresql-from-azure-services-using-python-789e93d879b4
the following code:
%sh
mkdir -p /opt/oracle
cd /opt/oracle
wget https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-basic-linux.x64-19.3.0.0.0dbru.zip
unzip instantclient-basic-linux.x64–19.3.0.0.0dbru.zip
sudo sh -c “echo /opt/oracle/instantclient_19_3 > /etc/ld.so.conf.d/oracle-instantclient.conf”
sudo ldconfig
export LD_LIBRARY_PATH=/opt/oracle/instantclient_19_3:$LD_LIBRARY_PATH
This code is however for Linux. How do I modify it for windows? Here is what I have so far:
%sh
mkdir -p /opt/oracle
cd /opt/oracle
wget https://download.oracle.com/otn_software/nt/instantclient/19800/instantclient-basic-windows.x64-19.8.0.0.0dbru.zip
unzip instantclient-basic-windows.x64-19.8.0.0.0dbru.zip
sudo sh -c “echo /opt/oracle/instantclient_19_8 > /etc/ld.so.conf.d/oracle-instantclient.conf”
sudo ldconfig
export LD_LIBRARY_PATH=/opt/oracle/instantclient_19_8:$LD_LIBRARY_PATH
I think everything past the unzip is incorrect. Thanks for the help in advance I'm very new to databricks.
Since there are no library path and path Separation in Windows we need to use PATH for both instead. At the end of the script you place the python stuff.
Rem ic.cmd
C:
Set ORABAS = "\opt\oracle"
cd %ORABAS%
wget https://download.oracle.com/otn_software/nt/instantclient/19600/instantclient-basic-windows.x64-19.6.0.0.0dbru.zip
unzip instantclient-basic-windows.x64-19.6.0.0.0dbru.zip
set ORACLE_HOME=%ORABAS%\instantclient_19_3
set TNS_ADMIN=%ORACLE_HOME%
set PATH=%ORACLE_HOME%;%PATH%

osx: How to install a package into user's application support directory?

I need to install 2 audio plugins to the root Audio/Plug-Ins/VST & Components directories. My installer does that fine. But I also need to install a directory of preset files into /Users/$USER/Library/Application Support/MyCompany folder.
I've heard that an installer can't install to / and ~ in the same installer, but I really want it to be 1 install for the user. So it seems like a good idea would be to install the VST and Components first. Then install the preset folder in a temporary location (like /tmp or similar) and then run a post-install script to move the files to the user's Library...but I can't get that to work.
This is the script I'm trying to run:
#!/bin/bash
# movePresets.sh
# I want something like this...but it doesn't work because $USER is root in the installer I believe
/usr/bin/sudo -u $USER mkdir -p "/Users/$USER/Library/Application Support/MyCompany/Presets"
/usr/bin/sudo -u $USER mv -r "/tmp/Presets" "$USER/$USER/Library/Application Support/MyCompany"
exit 0
Obviously, I don't know the proper way to access a user's directory as root. Help please...thank you.
Have you tried saving off the user in a variable first?
#!/bin/bash
realuser=$USER
# or
#realuser=$(whoami)
/usr/bin/sudo -u $realuser mkdir -p "/Users/$realuser/Library/Application Support/MyCompany/Presets"
/usr/bin/sudo -u $realuser mv -r "/tmp/Presets" "$realuser/$realuser/Library/Application Support/MyCompany"

Bash script to create symlinks

I am trying to create a script which would create symlinks from a folder 1 level up and i am using as follows:
symlinks.sh
ln -s '../config/environments' > 'environments'
ln -s '../config/init' > 'init'
environments is a folder and init is a file.
and when i go to the folder where symlinks.sh is and execute ./symlinks.sh, its creating 4 files which are:
environments
environments?
init
init?
I also tried:
ln -s '../config/environments' .
ln -s '../config/init' .
but with this one, init is created in the current folder and environments goes to folder ../config/environments/environments
Can someone help me please?
It's because you are redirecting the output ">". You don't need to do that with ln, it will automatically create a symlink in the current directory if you use:
ln -s "../config/environments"
ln -s "../config/init"

OpenShift Access DATA_DIR with url using symlink

I created a Maven project in OpenShift. I want to access file in data/uploads folder for this.
I created deploy in .openshift\action_hooks
ln -s ${OPENSHIFT_DATA_DIR}uploads ${OPENSHIFT_REPO_DIR}src/main/webapp
But it won't create symlink, and even if I create a symlink directly it still can't access with url. Any suggestions please?
My fault on the original answer. The uploads directory has to exist before you create the symlink to it:
if [ ! -d ${OPENSHIFT_DATA_DIR}uploads ]; then
mkdir ${OPENSHIFT_DATA_DIR}uploads
fi
ln -s ${OPENSHIFT_DATA_DIR}uploads ${OPENSHIFT_REPO_DIR}src/main/webapp

Installing RVM with space in $USER

So I've run into a bit of a problem. I've found many similar problems with spaces in $HOME, but the fixes do not apply to spaces in $USER - so I'm posting a question here.
Due to regulations at work my username for my workstation consists of +space+ (cannot be changed), for instance: John Doe
This is my $USER:
$ echo $USER
john doe
When I try to install rvm I get the following error:
It looks you are one of the happy *space* users(in home dir name),
RVM is not yet fully ready for it, use this trick to fix it:
sudo ln -s "/Users/john doe/.rvm/" /john doe.rvm
echo "export rvm_path=/john doe.rvm" >> "/Users/john doe/.rvmrc"
However, when I try to run the first command I get the following error:
ln: doe.rvm: No such file or directory
And if I attempt to run
sudo ln -s "/Users/john doe/.rvm/" "/john doe.rvm"
I get:
ln: /john doe.rvm: File exists
Any help would be tremendously appreciated :-)
Edit
sudo ln -s "/Users/john doe/.rvm/" /john\ doe.rvm
yields
ln: /john doe.rvm: File exists
Edit 2
Okay, thanks to platzhirsch I no longer get an error message when running the ln command. Now the problem is following:
When I run
echo "export rvm_path=/john\ doe.rvm" >> "/Users/john doe/.rvmrc"
or
echo "export rvm_path="/john doe.rvm"" >> "/Users/john doe/.rvmrc"
I get the following error when trying to re-install:
usage: dirname path
Edit 3
I've also tried manually editing the .rvmrc file. This is what it looks like:
export rvm_path="/john doe.rvm"
I've also tried
export rvm_path=/john\ doe.rvm
With no luck, I still get:
usage: dirname path
When I try to run
\curl -L https://get.rvm.io | bash -s stable --ruby
this message is fixed with https://github.com/wayneeseguin/rvm/issues/2140 - just start again and now it will propose the directory with _ (underscore) instead of (space)
why don't try to escape the white space ?!
sudo ln -s "/Users/john\ doe/.rvm/" "/john\ doe.rvm"
See this pst about escaping in linux shell. It is (almost) the same if you are using a terminal on a mac

Resources