How to create a Symbolic Link on myVesta Hosting Panel

Post Reply
User avatar
Posts: 91
Joined: Mon Jul 19, 2021 1:41 am
Has thanked: 7 times
Been thanked: 3 times

What is a Symbolic link:
In Linux, a symbolic link (also known as a symlink or soft link) is a file that points to other files or directories by representing their absolute or relative path. It's similar to shortcuts in Windows and provides a
convenient way to access files or folders with long paths quickly. Symbolic links can be particularly useful when you need to reference a frequently accessed file or folder from different locations, without having to create multiple copies of it.

How it works?
A symbolic link is a reference to the original file on your system and doesn't contain data from the target file. Therefore, deleting the target file renders the symbolic link useless, but deleting the symlink doesn't affect the target file. This behavior makes symbolic links a useful tool for managing file paths and reducing duplication on your system. Additionally, symbolic links can be easily updated to point to a new file or directory, providing a convenient way to keep your system organized and up-to-date.

How to configure it on myVesta Hosting Panel:

For example, we added and we want that domain to open files from this folder

1. Add to myVesta
2. In your SSH, as root, run:

Code: Select all

#Creating folder
mkdir /home/user/web/
chown user:user /home/user/web/

Code: Select all

#Delete default public_html folder
rm -rf /home/user/web/

Code: Select all

#Creating of a symbolic link
ln -s /home/user/web/ /home/user/web/
chown -h user:user /home/user/web/
So the conclusion is, after those steps - folder /home/user/web/ is symlinking to /home/user/web/

Another way to do this is to use v-move-folder-and-make-symlink command: viewtopic.php?t=767

Post Reply