Hey dudes.i am having this problem while symlinking. I have successfully deployed a ruby on rails application on server and all the migrations are done. It is deployed with phusion passenger. The application is in /home/username/rails_apps/myapp
. I want to symlink it to a subdomain in my site. the path to subdomain is /home/username/public_html/subdom
. So i used this command to symlink it.
ln -s '/home/username/rails_apps/myapp/public/' '/home/username/public_html/subdom'
when it is done, it creates http://subdom.maxsy.net/public
but it is supposed to be accessible by http://subdom.maxsy.net/
anybody have a sensible explanation for this problem? thanks
If
/home/username/public_html/subdom
already exists as a directory, the symlink does not replace the directory: instead, you get/home/username/public_html/subdom/public
as a symlink pointing to/home/username/rails_app/myapp
.Since it appears that you really do want to replace
/home/username/public_html/subdom
by the symlink, you must first remove the/home/username/public_html/subdom
directory before runningln -s /home/username/rails_app/myapp /home/username/public_html/subdom
.