user3305818
user3305818

Reputation: 184

How to create Symbolic link for linux web server

How to create the symbolic link for the path on web server(linux).

Suppose I want to create link for request url

http://localhost:8059/layerslider/skins/fullwidth/skin.css

And the file is present on server at location

/home/users/assets/plugins/layerslider/skins/fullwidth/skin.css

Do anyone know about it????

Thanks

Upvotes: 3

Views: 7817

Answers (3)

Pankaj Badukale
Pankaj Badukale

Reputation: 2046

See this is not good practice. But in some case we need to use it.

But you need to first allow the symbolic links for the domain.

You can do it with configuation file of apache.

Add this:: Options FollowSymLinks

Then you can create and apache2 allow to symbolic links.

ln -s original_folder_soruce symbolic_link_path_name

Upvotes: 1

user3270303
user3270303

Reputation:

Creating symbolic link does not recommended.

But you have option to on this facility.

In apache hosting confuguration file add this:

Options FollowSymLinks

And provide appropriate permission according to file needs.

And be specific answer to your question is:

create symbolic as

ls -s /home/users/assets/plugins/layerslider/ /web-rootFolder/layerslider

Upvotes: 2

Luca Davanzo
Luca Davanzo

Reputation: 21520

I think you have to change the location of localhost on server side.

 sudo gedit /etc/apache2/sites-enabled/000-default

DocumentRoot /home/users/assets/plugins
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/users/assets/plugins
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

After save file (ctrl+o ctrl+x), restart apace.

sudo /etc/init.d/apache2 restart

To change the port:

sudo nano /etc/apache2/ports.conf

Upvotes: 0

Related Questions