Not much different from creating a symlink in cPanel, you can also easily create a symlink in CyberPanel using SSH or you can also use a Cron Job.
In this article, we will discuss both ways to create a symlink in CyberPanel.
How to Create a Symlink in CyberPanel
If you want to use the SSH method, make sure you have already obtained SSH access to your website (not root SSH access to the server).
However, if you have not yet obtained SSH access in CyberPanel, you can follow this tutorial: How to Access CyberPanel Hosting SSH.
Option 1: Creating a Symlink in CyberPanel Using SSH
There are several steps you need to take if you use this option, including:
- SSH Login
- Determine the Source and Destination Folder/File
- Run the Symlink Command
- Check the Symlink
1. SSH Login
After finding your website's SSH login details in CyberPanel, you can log in to SSH using Terminal, CMD, or an SSH application such as PuTTY.
If you are using Terminal or CMD to access SSH for user namad3815 with IP 192.168.1.1 and port 1999 (default SSH port 22), then you can use this command
ssh [email protected] -p 19992. Determine the Source and Destination Folder/File
You can open the File Manager page in CyberPanel to check the location you want to add to the symlink, for example, here we use the following file and folder for the source
/home/namadomain.biz.id/public_html/symlink-dari-sini/index.phpThen, you can determine the destination where the folder will be called, for example, here it will be called to this folder
/home/namadomain.biz.id/public_html/symlink-kesiniAfter you have determined both, you can then run the symlink command via SSH.
3. Run the Symlink Command
You can run the symlink command using SSH with the following command line
ln -s folder/file_sumber folder_tujuanMake sure to change source folder/file and destination_folder according to the folder or file location you are using.
If you use the source and destination folders from step number 2, the result will look like this
ln -s /home/namadomain.biz.id/public_html/symlink-dari-sini/index.php /home/namadomain.biz.id/public_html/symlink-kesiniIf successful, there will be no success or failure information, but you will immediately get the option to run a new command line, so you can check the results via the File Manager in CyberPanel.
4. Check the Symlink
You can check the symlink you created by opening the destination folder using the File Manager in CyberPanel.
If successful, you will find a file that functions as a symlink.
Additionally, if the file or folder you are calling is media, you can try accessing the destination folder page on your website, for example namadomain.biz.id/symlink-kesini/
Option 2: Creating a Symlink in CyberPanel Using a Cron Job
If you prefer using a Cron Job over SSH, you can create a symlink by following this tutorial
1. Open the Cron Job Page
To open the Cron Job page, you need to log in to the CyberPanel control panel on your server first, then open the menu Websites > List websites > Manage Website
On the Manage Website page, find and open the menu Cron Jobs
2. Determine the Source and Destination File/Folder
Just like when using SSH, you need to determine the source and destination file/folder. For example, here we use the file located in the following folder as the source
/home/namadomain.biz.id/public_html/symlink-file-dari-sini/index.phpThen for the destination folder, it will be added to the following folder
/home/namadomain.biz.id/public_html/symlink-file-kesini3. Add a Cron Job
Back on the Cron Jobs page, you can click the button ADD CRON to add a new cron job and run the symlink command
In the column Pre defined, select the option Every Minute so that the symlink can be created as quickly as possible
Then in the command column, you can use the same command as when using SSH
ln -s folder/file_sumber folder_tujuanMake sure to change source folder/file and destination_folder according to the folder or file location you are using.
For this example, the resulting command used will look like this
ln -s /home/namadomain.biz.id/public_html/symlink-file-dari-sini/index.php /home/namadomain.biz.id/public_html/symlink-file-kesiniAnd the final result before you finally add the Cron Job will look like this
4. Check the Symlink
Unlike the SSH method where the symlink is added immediately after adding the command, when using Cron Jobs, you have to wait a few minutes until the symlink file is added
5. Delete the Cron
Although not required, it is recommended to delete the cron you added so that later when you delete the symlink, it is not automatically recreated because the Cron is still running.
To delete a cron, you can return to the Cron Jobs page, then click the trash icon on the Cron you want to delete.
COMMENTS
Loading...