Solved symlink: No such file or directory

rigoletto@

Developer
Hello,

I am using nginx to run Nextcloud and it is working fine. Now I am trying to move the server {} from nginx.conf to a separated file inside servers-available folder with a symbolic link to servers-enabled folder using then include servers-enabled/* on nginx.conf.

The problem were the symbolic link inside servers-enabled return:

Code:
nextcloud: No such file or directory

but it is there:

Code:
lrwxr-xr-x  1 root  wheel  27 Jul 20 22:18 nextcloud -> servers-available/nextcloud

the symlink was created using (from /usr/local/etc/nginx):

Code:
# ln -sv servers-available/nextcloud servers-enabled
 
Probably a broken symlink because you linked it with a relative path instead of absolute. Test it with file server-enabled (on the symlink). Try instead ln -s /path/to/source server-enabled.
 
Probably a broken symlink because you linked it with a relative path instead of absolute. Test it with file server-enabled (on the symlink). Try instead ln -s /path/to/source server-enabled.

Yes, of course! Working already.

Thanks you. :beer:
 
You can use relative paths for symlinks but you have to take the current directory of the link itself into account. I'm assuming you have a structure similar to Debian/Ubuntu:
Code:
*/etc/nginx/
       |_ sites-available/
       |_ sites-enabled/
You can create a relative link in sites-enabled: cd sites-enabled ; ln -s ../sites-available/mysite mysite
 
SirDice

Code:
I'm assuming you have a structure similar to Debian/Ubuntu:
That make me curious. Is there a standard different practice on FreeBSD?

PS. I use Gentoo by the way. :D
 
The only standard practice on FreeBSD is that ports and packages must install their configuration files under /usr/local, usually /usr/local/etc or a subdirectory of it. Beyond that it's for the port maintainer to decide if he/she wants to or can follow the hierarchy or conventions of the upstream or do something different.
 
Back
Top