Link to home
Start Free TrialLog in
Avatar of movieprodw
movieprodw

asked on

Apache Symbolic Links

Hello,

I am going to install magento on a Added domain and I need to add these symbolic links:

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

If adding these creates a problem with the current site I would like to know how to remove them quickly.

What would the shell command be to 'undo' these?

Thank you for your help,
Matt
ASKER CERTIFIED SOLUTION
Avatar of sakman
sakman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To clarify, you want to delete the links in the directory they reside.   My example above is misleading because I was listing the files in public_html.

You would want to whatever directory you have the links (app, errors, etc).

If there are only links there you could just remove them all.  Or if you want to loop over mixed files and links, you could run a for loop as above, but first CD into the directory with the links and then `ls -1`
Avatar of movieprodw
movieprodw

ASKER

Okay so I can use shell and enter:

cd folder_name/
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

to create and

cd folder_name/
rm -s ../public_html/app ./app
rm -s ../public_html/errors ./errors
rm -s ../public_html/includes ./includes
rm -s ../public_html/js ./js
rm -s ../public_html/lib ./lib
rm -s ../public_html/media ./media
rm -s ../public_html/skin ./skin
rm -s ../public_html/var ./var

to remove?
Nope.

Just cd into the folder that has the links and remove them:
rm app errors include js ....

You can use ls -l to see that they are links.

The "for" loop in my example was only if you had a bunch of other files in that directory.
thanks