I have one website virtual hosting under xampp apache and using certbot to obtain ssl cert
certbot certonly --webroot --w C:\xampp\htdocs\mysite\wordpress --d www.mysite.com
After successful obtain
It created 4 pem files in C:Certboxarchivemysite and 4 .smylink(.pem) files in C:Certboxlivemysite which symlink to those 4 files on archive folder
Heres the problem:
Everytime I reboot the pc, those 4 .smylink(.pem) files seems lost its target to those 4 pem files in C:Certboxarchivemysite and seems to became broken and preventing xampp apache from starting
What I’ve tried:
- Cmd run
cd C:Certbotlivemysite
thendel cert.pem.symlink
and recreatemklink /H cert.pem.symlink C:Certbotarchivemysitecert.pem
2
Answers
It turn out is the permission issues,those symlink has reset the permissions after system reboot which is very odd , this explain why the "shortcut" tab in properties was missing which I missunderstand the symlink was losing the target.
I have to regrant permissions to those symlink files by doing
icacls <path> /grant Everyone:(R)
via cmdIt seems like the issue you’re facing is related to symbolic links being broken after a system reboot. Windows might reset the symbolic links or the paths might change during startup.
One solution is to create a batch script that recreates the symbolic links each time your computer starts up. Here’s an example of how you can create a simple batch script:
Open Notepad or any text editor.
Copy and paste the following script into the editor:
Save the file with a .bat extension, for example, recreate_links.bat. Save it to a location of your choice.
To make this script run on startup, you can create a shortcut to it and place the shortcut in the Startup folder.
Press
Win + R
to open the Run dialog.Type
shell:startup
and press Enter. This opens the Startup folder.Copy the shortcut of your
recreate_links.bat
script into this folder.Now, every time your computer starts up, it will execute the batch script and recreate the symbolic links for you.
PS: Adjust the paths in the script if your actual paths are different.
PPS: This has never happened to me as I primarily use a Linux-based System.