PDA

View Full Version : Help with symbolic link



rwb
03-11-2006, 08:00 PM
Hi there

I asked this question before and, with the help of users here, resolved it. I figured that the next time I had do this, I'd search the forum - but the contents vanished when they lost that drive a few months ago. :eek:

Ah well... I'm trying to create a symbolic link for a addon domain so stats can be viewed without logging into CPanel.

I've never been able to use SSH (local ISP issues, buggers) so I'm trying to issue a LN command thru the Cron interface in CPanel. I've tried...

ln -s /public_html/ADDON-DOMAIN-NAME/stats /tmp/webalizer/ADDON.MAIN-DOMAIN.com/

.... so I'm expecting that a visit to www.ADDON-DOMAIN-NAME.com/stats/ will produce whatever is in /tmp/webalizer/ADDON.MAIN-DOMAIN.com/

Cron replies "No such file or directory". There is no "stats", but I though Cron would create it for me. This worked last time I did it (or obviously something like it) for another domain, but I didn't save the command or cron output.

Any ideas on what I'm missing?

Randy

cdpuk
03-12-2006, 06:16 AM
If you can't use SSH you may find it easier to create a tiny PHP script that executes commands for you.


<?php
$output = shell_exec('mkdir ~/public_html/something/stats');
echo "<pre>$output</pre>";
?>

But as far as I know the directory must exist before you can link it.

-Chris

petrus
03-12-2006, 09:13 AM
You need to specify the full path. The paths that you specified were paths for ftp, as if / was your home directory. Your home directory is not the root directory in terms of the filesystem, so you need to put a ~ in front of both of the paths, or just specify the whole path like /home/username/public_html/something/stats

http://www.liquidweb.com/manual/chapter2/filesystem.html

rando
03-12-2006, 06:00 PM
I've never been able to use SSH (local ISP issues, buggers)
FIND A NEW ISP!

That is absolutely not acceptable at all ever. :)

rwb
03-13-2006, 08:21 PM
The cable company is the only option in my area right now, unless I go back to dialup. The telephone company has trucks crawling all over the area though, so it won't be long. My current ISP even dropped NNTP service recently - I'm afraid they're moving further away from good service.

The PHP idea, plus there reminder about the path got the job done. Thanks.

page1ink.
04-19-2006, 01:16 PM
you can allow public stats for your main domain via (in this example) Webalizer by creating a cron job with the following command:


ln -s ~/tmp/webalizer ~/public_html/stats

the reason rwb's method wasn't working was because the command asks for (link) then (target), where (link) is the address to link TO and (target) is the address to link FROM. his example shows this in reverse order.

you don't need SSH access to do this, simply use the crontab interface from your control panel. I set mine to run every minute so it would go through ASAP, but if you do that make sure to remeber to delete the cron job afterwards.

you also must CHMOD your ~/tmp/webalizer/ directory to 777 which you can do via the file manager in the control panel.

you can also use this command for an addon domain by changing the command to:


ln -s ~/tmp/addon.domain.com/webalizer ~/public_html/addon/stats

rwb
04-28-2006, 05:05 AM
Excellent, thanks. I think all that through PHP is a bit cleaner though. This must all sound really stupid to those fortunate enough to have SSH working.

So, just to take this to it's logical conclusion... does anyone know if these forums are now covered by any type of regular backup procedure?

rwb