LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-29-2006, 01:05 PM   #1
metalx1000
Member
 
Registered: Jun 2006
Distribution: Debian
Posts: 112

Rep: Reputation: 16
Unhappy Apache broken link


ok I'm running Apache on my Kubuntu OS.

I've created to identical folders:

Code:
/var/www/plans
/var/www/plan
the permisions are the same

Code:
drwxrwxrwx 2 root root 4096 2006-09-29 13:53 plan
drwxrwxrwx 2 root root 4096 2006-09-29 13:51 plans
The httpd.conf for the to folders are the same:
Code:
<Directory "/var/www/plan/">

#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
	AddHandler cgi-script .cgi .sh .pl
    Options Indexes Includes FollowSymLinks MultiViews ExecCGI

#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo", 
# "AuthConfig", and "Limit"
#
    AllowOverride None

#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all
</Directory>


<Directory "/var/www/plans/">

#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
	AddHandler cgi-script .cgi .sh .pl
    Options Indexes Includes FollowSymLinks MultiViews ExecCGI

#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo", 
# "AuthConfig", and "Limit"
#
    AllowOverride None

#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all
</Directory>
When I run the main.cgi script (which is a photo album script) They both run and make likes for all the JPEG's in the folder. But, the 'plan' folder all of the links are bad. But the 'plans' folder there all fine.

All the permisions in both folders are the same for all the files and all the files are the same. I just copied them.

What am I over looking?

I can post the code if need but I don't think it's that because I've had it working in other folders before. It just seems that some times can get it to work and some times can't even though I'm doing the same thing.
 
Old 09-29-2006, 02:51 PM   #2
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
try this. Move the plan folder to a different name. Then cp the plans folder as plan folder. and see if the permissions still work. If it does then you should start looking inside of your plan folder that you just moved. If if does the same thing then you might want to look at your script.
 
Old 09-29-2006, 04:20 PM   #3
metalx1000
Member
 
Registered: Jun 2006
Distribution: Debian
Posts: 112

Original Poster
Rep: Reputation: 16
rename

I renamed 'plan' to 'pla' and then 'plans' to 'plan' then 'pla to 'plans'

well, basicly I switched the names.

and the new 'plans' folder still works but the 'plan' folder still has broken links.

here is the script which I got out of a book called'Wicked cool shell scripts'

Code:
#!/bin/sh
# album - online photo album script
echo "Content-type: text/html"
echo ""

header="head.htm"
footer="footer.html"
count=0

if [ -f $header ] ; then
  cat $header
else
  echo "<html><body bgcolor='white' link='#666666' vlink='#999999'><center>"
fi

echo "<h3>Contents of $(dirname $SCRIPT_NAME)</h3>"
echo "<table cellpadding='3' cellspacing='5'>"

for name in *jpg
do
  if [ $count -eq 4 ] ; then
    echo "</td></tr><tr><td align='center'>"
    count=1
  else
    echo "</td><td align='center'>"
    count=$(($count + 1))
  fi

  nicename="$(echo $name | sed 's/.jpg//;s/-/ /g')"

  echo "<a href='$name' target=_new><img style='padding:2px'"
  echo "src='$name' height='100' width='100' border='1'></a><BR>"
  echo "<span style='font-size: 80%'>$nicename</span>"
done
echo "</td></tr><table>"

if [ -f $footer ] ; then
  cat $footer
else
  echo "</center></body></html>"
fi

exit 0
 
Old 09-29-2006, 04:28 PM   #4
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
so since the changing of the names is all that happened that means that it has to be in the script. Since the once working directory now does not work and the non working directory now works we have narrowed it down.
 
Old 09-29-2006, 04:30 PM   #5
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
looks like your problem may lay somewhere in that script where it says

Code:
nicename="$(echo $name | sed 's/.jpg//;s/-/ /g')"

  echo "<a href='$name' target=_new><img style='padding:2px'"
  echo "src='$name' height='100' width='100' border='1'></a><BR>"
  echo "<span style='font-size: 80%'>$nicename</span>"
done
 
Old 09-29-2006, 05:33 PM   #6
metalx1000
Member
 
Registered: Jun 2006
Distribution: Debian
Posts: 112

Original Poster
Rep: Reputation: 16
I got it. Well, I had to chmod a+r *.jpg. and then restart the server. Which makes since. The only thing is that the plans folder still says

Code:
-rwx------ 1 root  root  98211 2006-09-29 13:53 2.jpg
-rwx------ 1 root  root  71580 2006-09-29 13:53 ks.jpg
but it still works works.
I thought I tried changing them read for all earlier, but I must have not restarted the server after doing it.

Sorry for wasteing your time. Thank for the help.
 
Old 09-29-2006, 05:58 PM   #7
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
I wouldn't say it was a waste of time since we solved the problem. It would have only been a waste of time if you had given up.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
link broken tootcsen Linux - Newbie 3 06-07-2006 10:43 PM
Broken link in Tutorials section carambar LQ Suggestions & Feedback 1 03-28-2006 01:30 PM
media:/ link broken Telemako Linux - General 0 11-27-2005 02:43 PM
link (broken) newlin Linux - Software 1 11-22-2003 02:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration