Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm working on a project with a directory structure that relies on symlinks. I would like to package this project in such a way that users with no command line access or knowledge could still upload the project to their servers. At the moment, this is not possible, whenever I attempt to upload the symlinks, they are converted into the contents they link to.

Is it actually possible to upload symlinks to a server? If yes, what would be the procedure? If not can you recommend another approach?

This project wouldn't work without symlinks as I need the same information in various places and copying the content is not an option.

Thanks!!!

share|improve this question

4 Answers 4

up vote 1 down vote accepted

Besides the suggestions from Dennis you could look at tar or cpio and then use a self-extracting shell script to make it easier on the end user to install.

Look up here-to (>>) documents under any bash scripting tutorial or try MakeSelf.

share|improve this answer
    
Thanks, this may be the answer actually!... In the meantime, I also found out that I may be able to use the symlink() PHP function , all the symlinks are relative links –  slimbuddah Sep 15 '09 at 22:56
    
You could then package up everything into a tar archive with all symlinks in place, then create a PHP page that "installs" the application for them. You could then add some branding to the PHP page so that the users feel like it is a polished installer –  Wayne Sep 16 '09 at 3:04

If your project is a PHP application and we assume that the worst case scenario of installation target is some unix webhotel with PHP that has all safe features on, there really is no way to execute/run some installation script on the server.

Best option is probably to have a PHP-page that will create the required links with symlink() or link(). Either hardcode them into the PHP-page or write a simple script that will read simple configuration file.

share|improve this answer
    
Yes, the project is a PHP application. This sounds like the solution to me, although I may also try the self-extracting shell script and leave the option to the user –  slimbuddah Sep 16 '09 at 6:48

To expand on Dennis Williamson's answer:

You're using FTP to upload. FTP doesn't support symlinks.

FTP is also unadvisable for other reasons.

Supporting uploading through ssh instead will get rid of your problem. E.g. you will be able to use rsync.

share|improve this answer
    
Personally I use SFTP, but I would expect some users to use FTP... For my own use, I'd just create the symlinks on the server , but I can't expect users to have command line access –  slimbuddah Sep 15 '09 at 22:52

How are you uploading?

rsync can copy symlinks, if that's an option that's available to you.

Could your users run a script to create the symlinks?

share|improve this answer
    
Nope, I have to assume the users have minimum knowledge... –  slimbuddah Sep 15 '09 at 22:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.