Create symlink

Description:

A symlink (or symbolik) link allows creating an alias for a file or folder in a different folder with a different name. This can come in handy for accessing special folders in the structure that don’t need to be made public, or creating special rules or exception in server access.

Solution:

A symlink is created easy with the following command:

$ ln -s {/path/to/file-or-folder} {symlink-alias}

For example:

$ ln -s /htdocs/myproject/important_folder /htdocs/mylink

Then we can set up for example a location block in our nginx configuration, that points to that folder:

location /visible_link/ {
root /htdocs/mylink;
}

Advertisements

About admin

Just another php developer trying to give something back to the community.
This entry was posted in Linux, Tools and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s