Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 14th January 2012, 16:46
Martinss Martinss is offline
Member
 
Join Date: Apr 2008
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with symlink - forbidden.

Hello there! My problem is that i have a large hdd with my filesharing homepage and mounted it as

Code:
/home/lejup/hd1/www/
but my domain name default www directory is

Code:
/var/www/clients/client0/web1/web/
.

So i deleted the "web" directory, and created a symlink like this

Code:
ln -s /home/lejup/hd1/www /var/www/clients/client0/web1/web
but there is problem, now when i point to domain.ltd it shows up 403 Forbidden, also a subdomain img.domain.ltd shows the same. I changed chmod to 777 ford index.html files and also for thos directories, but nothing changed, where is the problem?
Reply With Quote
Sponsored Links
  #2  
Old 15th January 2012, 03:26
Martinss Martinss is offline
Member
 
Join Date: Apr 2008
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Also, i chmoded and chowned www-data and web* users to new symlink, but it still gets me forbidden error.
Reply With Quote
  #3  
Old 15th January 2012, 10:52
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

Do you have an index file (index.html, index.php, etc.) in /home/lejup/hd1/www/?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #4  
Old 15th January 2012, 14:43
Martinss Martinss is offline
Member
 
Join Date: Apr 2008
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes i do, but it still shows me forbidden.
Reply With Quote
  #5  
Old 15th January 2012, 14:48
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,586
Thanks: 792
Thanked 4,983 Times in 3,903 Posts
Default

Please post the exact error message from the error.log of the website. Beside that, which php mode do you use and is suexec enabled in that website?

Instead of symlinking the directory, you can try to mount the harddiskpartition directly in the directory /var/www/clients/client0/web1/web
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #6  
Old 15th January 2012, 15:21
Martinss Martinss is offline
Member
 
Join Date: Apr 2008
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Error log shows me

Code:
[Sun Jan 15 16:10:20 2012] [error] [client 85.15.246.78] Symbolic link not allowed or link target not accessible: /var/www/domain.ltd/web/www
[Sun Jan 15 16:10:20 2012] [error] [client 85.15.246.78] Symbolic link not allowed or link target not accessible: /var/www/domain.ltd/web/www
Theres default setting for suexec - enabled, and for php is FastCGI, i guess? Nothing have been changed.

also, mounted the hard drive to the /web/ and it gives me forbidden 403. It is chmoded as 777

Last edited by Martinss; 15th January 2012 at 15:36.
Reply With Quote
  #7  
Old 15th January 2012, 15:41
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,586
Thanks: 792
Thanked 4,983 Times in 3,903 Posts
Default

The above errors are from suexec as the symlink is a security violation for apache so that it denies access to this directory. Please post the new error message that you receive after removing the symlink and changing it back to be a directory and then using mount to mount the harddrive to the directory.

Quote:
It is chmoded as 777
That are too many permissions, that can cause problems as well.Please change the permissions of the web directory back to 710 and ensure that the web directory is owned by the user and group of the website,
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #8  
Old 15th January 2012, 15:52
Martinss Martinss is offline
Member
 
Join Date: Apr 2008
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default

mounted the hardrive as directory in web, put 710 permission to web directory, now i got a .htaccess error

Code:
[Sun Jan 15 16:45:00 2012] [crit] [client 78.84.*.*] (13)Permission denied: /var/www/domain.ltd/web/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
Created blank .htaccess file with 710 permissions and with web* user and client* group, still gives permission denied about htaccess
Reply With Quote
  #9  
Old 15th January 2012, 16:23
Martinss Martinss is offline
Member
 
Join Date: Apr 2008
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Problem solved. There was not right permissions for /web/ directory. Two days of downtime because of this, i lold. But it's normal for newbie. Anyways, big thanks for help falko and till.
Reply With Quote
  #10  
Old 15th January 2012, 18:18
Martinss Martinss is offline
Member
 
Join Date: Apr 2008
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Now i have some problem with PHP, what is different ir ISPconfig? I put php from fastcgi to mod-php and still nothing. The problem is that one script exits and nothing happens, looks like this:

Code:
<?
include "config.php";

if (!isset($HTTP_POST_FILES['userfile'])) exit;


if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) {

if ($HTTP_POST_FILES['userfile']['size']>$max_size) {
        echo "<center><br><br><br>Fails ir parak liels, ludzu samazini to!</center>"; exit; }
if(($HTTP_POST_FILES['userfile']['type']=="image/gif") || 
($HTTP_POST_FILES['userfile']['type']=="image/pjpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/jpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/x-png") || ($HTTP_POST_FILES['userfile']['type']=="image/png")) {

        if (file_exists("./".$path . $HTTP_POST_FILES['userfile']['name'])) {
                echo "<center><br><br><br>Bilde ar shadu nosaukumu jau eksistee! Nomaini nosaukumu un meegjini veelreiz!</center>"; exit; }

//generate random number
$zufall = time();
$fupl = "$zufall";
$nosaukums = $HTTP_POST_FILES['userfile']['name'];
$ext = substr(strrchr($nosaukums, '.'), 1);
$punkc = ".";
if (file_exists("./".$path .$fupl .$punkc .$ext)) {
                echo "<center><br><br><br>Bilde ar shadu nosaukumu jau eksistee! Nomaini nosaukumu un meegjini veelreiz!</center>"; exit; }
        $res = copy($HTTP_POST_FILES['userfile']['tmp_name'], "./".$path .$fupl .$punkc .$ext);
		        
        if (!$res) { echo "<center><br><br><br>Bilde ar shadu nosaukumu jau eksistee! Nomaini nosaukumu un meegjini veelreiz!</center>"; exit; } else {
        ?>
<br>

<?
//set url variable
$domst = "";
$drecks = "/";
$imgf = $fupl.$punkc.$ext;
$thbf = $tpath.$imgf;
$urlf = $domst .$domain .$drecks .$path .$imgf;


//create thumbnails
function createthumb($name,$filename,$new_w,$new_h){
	$system=explode('.',$name);
	if (preg_match('/jpg|jpeg|JPG/',$system[1])){
		$src_img=imagecreatefromjpeg($name);
	}
	if (preg_match('/png|PNG/',$system[1])){
		$src_img=imagecreatefrompng($name);
	}
	if (preg_match('/gif|GIF/',$system[1])){
		$src_img=imagecreatefromgif($name);
	}

$old_x=imageSX($src_img);
$old_y=imageSY($src_img);
if ($old_x > $old_y) {
	$thumb_w=$new_w;
	$thumb_h=$old_y*($new_h/$old_x);
}
if ($old_x < $old_y) {
	$thumb_w=$old_x*($new_w/$old_y);
	$thumb_h=$new_h;
}
if ($old_x == $old_y) {
	$thumb_w=$new_w;
	$thumb_h=$new_h;
}

$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);
	imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y); 


if (preg_match("/png/",$system[1]))
{
	imagepng($dst_img,$filename); 
} 
if (preg_match("/gif/",$system[1]))
{
	imagegif($dst_img,$filename);
}
else {
	imagejpeg($dst_img,$filename); 
}
imagedestroy($dst_img); 
imagedestroy($src_img); 
}

createthumb($path.$imgf,$tpath.$imgf,$tsize,$tsize);
?>



<center>
<div class="rezultats" id="agreement">
<table border='0' >
<link rel="STYLESHEET" type="text/css" href="style.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<FORM action="nowhere" method="post"><title>Attēlu augšupielāde</title>
<center>
<tr><td>BBkods ar mazbildi:</td><td><input type="text" name="thetext" size="60" value="[IMG]<? echo $domst.$domain.$drecks.$tpath.$imgf; ?>[/IMG]"></td></tr>
<tr><td>BBkods ar pilna izmēra bildi:</td><td><input type="text" name="thetext" size="60" value="[IMG]<? echo $domst.$domain.$drecks.$path.$imgf; ?>[/IMG]"></td></tr>
<tr><td>Saite:</td><td><input type="text" name="thetext" size="60" value='<? echo $domst .$domain .$drecks ?>viewer.php?id=<? echo $imgf; ?>'></td></tr>
<tr><td>Tiešā saite:</td><td><input type="text" name="thetext" size="60" value="<? echo $urlf; ?>"></td></tr>
<tr><td>HTML kods:</td><td><input type="text" name="thetext" size="60" value="<a href='<? echo $domst .$domain .$drecks; ?>viewer.php?id=<? echo $imgf; ?>'><img src='<? echo $domst.$domain.$drecks.$tpath.$imgf; ?>'></a>"></td></tr>

<tr><td>Attēla mazbilde:</td><td>                 <img src='<? echo $thbf ?>'>               </td></br><a href="javascript:history.go(-1);" title="uz iepreiksejo lapu">Atpakaļ</a> </div></tr></td></tr>
<?

}
} else { echo "<font color=\"#333333\" face=\"Geneva, Arial, Helvetica, sans-serif\"><link rel='stylesheet' href='style.css' type='text/css'><div class='support' id='agreement'><p><center>Šis ir nepareizs faila formāts!</font></center></div><br>\n"; exit; }
}
?>
</table>
<br><br>
</body>

It just displays white page and thats all. Haven't modified anything in that script, just moved from old server to this new Ubuntu-Server 10.4 with ISPconfig 3.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
postfix problems with smtp linkdeb Server Operation 13 15th March 2014 17:58
postfix/trivial-rewrite digitalage HOWTO-Related Questions 19 13th March 2013 19:02
table lookup problem aurelius Installation/Configuration 5 2nd November 2011 19:12
Apache boot problem / GlusterFS loading stefanm Installation/Configuration 2 9th August 2011 14:25
Strange email problem for one of my domains... any help appreciated paulrobert_a Installation/Configuration 5 9th August 2010 14:15


All times are GMT +2. The time now is 20:08.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.