Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
-/
|--bin
|--home
  |--user_1
    |--somefile.html
    |--somefile2.html
  |--user_2
    |--differentFile.html
|--var
  |--www
    |--file1.html

i want the urls to be http://serverip/user_1/somefile.html but right now it only serves files from the "www" folder

any help will be appreciated.

Thank you

share|improve this question
    
While the symlink will work if the user permissions are correct, you may want to look into user dirs as well –  ernie Jun 20 '13 at 18:42

1 Answer 1

If you want users to be able to access http://serverip/user_1/somefile.html

Then you would do this

ln -s /home/user_1 /var/www

Note that you still have to have proper read permissions set for apache to read the files in /home/user_1

You can also accomplish this in apache configs, take a look here http://stackoverflow.com/questions/4538572/apache-multiple-documentroot

share|improve this answer
    
or just ln -s /home/user_1 /var/www (without the cd). This also assumes the permissions are correct. –  ernie Jun 20 '13 at 18:39
    
mmhm, changed it –  wonton Jun 20 '13 at 18:41
    
thanks, sorry for my lack of knowledge with this topic, if i were to add another file, will i have to do 'ln -s newfile.html' again? –  Joseph Jun 20 '13 at 18:55
    
no it references the directory and reflects the directory's present state, not the state it was at when linked –  wonton Jun 20 '13 at 18:57

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.