How to Setup Symlinks in Litespeed Apache

You can use symlink to put a website in under another website without having files actually in the same directory.

    1. check in litespeed security settings that symlinks following is allowed
      1. make sure no other vhost settings that prohibit symlink
    2. make the destination folder ready
    3. identify the location where you will be making the symlink
      1. if symlink is a folder, don’t make that as a folder
    4. run this for the folder that holds the target symlink and the source symlink. The reason is, we need to know who the owner is for both, if they are different we need to set them the same
      ls -al
    5. if they are different, change the source to have same user as the target. I prefer to change the source rather than the target.
      chgrp {{user}} {{folder}}
    6. Now set the symlink. Note – do NOT add / even if you are trying to link folder. Make sure the target folder is not created.
      ln -s {{source}} {{target}}
      ln -s /home/username/a /home/username/public_html/somefolder
    7. You can now test


Some common problems:

[ERROR] [redacted] [HTAccess] Failed to open [redacted/.htaccess]: Permission denied
[INFO] [redacted] [redacted#Aredacted:443] File not found [redacted/403.shtml]
[INFO] [redacted] redacted#redacted:443] Auto Index is disabled for [redacted], access denied

This means the user is different, and Litespeed won’t allow reading. Check step 4,5 above



Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>