# [SOLVED] multimon.cgi - getting to work

## Joseph_sys

I've apcupsd build with 'cgi" flag and the "multimon.cgi" now is in directory:

/usr/libexec/apcupsd/cgi-bin/

So I have created a symlink to my apache cgi-bin:

```
ln -s /usr/libexec/apcupsd/cgi-bin/multimon.cgi /var/www/localhost/cgi-bin
```

 but I'm getting permission error:

```
You don't have permission to access /cgi-bin/multimon.cgi on this server.
```

I've changed permission of multimon.cgi to "apache"

```
ll /usr/libexec/apcupsd/cgi-bin/

total 100

-rwxr-xr-x 1 apache apache 27440 Sep 14 23:38 multimon.cgi
```

 but symlink is owned by "root" what am I doing wrong?Last edited by Joseph_sys on Tue Apr 30, 2013 3:16 pm; edited 1 time in total

----------

## Joseph_sys

When I copied all cgi related file from: 

/usr/libexec/apcupsd/cgi-bin/

to: 

/var/www/localhost/cgi-bin

it works. Why doesn't it work via symlink?

----------

## fbcyborg

Try to make a physical link instead!

```
ln -P /usr/libexec/apcupsd/cgi-bin/multimon.cgi /var/www/localhost/cgi-bin/
```

 :Wink: 

----------

## Joseph_sys

 *fbcyborg wrote:*   

> Try to make a physical link instead!
> 
> ```
> ln -P /usr/libexec/apcupsd/cgi-bin/multimon.cgi /var/www/localhost/cgi-bin/
> ```
> ...

 

Thanks, yes this worked as well.

Will the files in "/var/www/localhost/cgi-bin/" get updated with a next "apcupsd" upgrade?

----------

## fbcyborg

 *Joseph_sys wrote:*   

> 
> 
> Thanks, yes this worked as well.
> 
> Will the files in "/var/www/localhost/cgi-bin/" get updated with a next "apcupsd" upgrade?

 

I think so. As a consequence of the physical link. You can even try yourself using a text file, creating a physical link to it in another directory and modifying the original one. If the destination is modified too, then the answer to your question is yes!  :Wink: 

----------

## hdcg

Hi,

Apache's FollowSymLink Option directive controls whether apache follow symbolic links or not.

See http://httpd.apache.org/docs/2.2/mod/core.html#options for details.

Best Regards,

Holger

----------

## Joseph_sys

Thank you, yes I think this was my problem: 

```
<Directory "/var/www/localhost/cgi-bin">

   AllowOverride None

   Options None

   Order allow,deny

   Allow from all

</Directory>
```

Changing it to: Options -Indexes FollowSymLinks

solved the problem.

So it works either way enable in apache "FollowSymLinks" or create a "Hard Link"

----------

## fbcyborg

Good to know that. I didn't know about the FollowSymlinks option.

----------

