Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old September 7th, 2001, 10:32 AM
worldtouch worldtouch is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Milian, Italy
Posts: 357 worldtouch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
after I create cgi-bin, error 500 internal error

I have "forbidden: , no permission.

normal I deny other people from entering my portal , they will have such message.

that cgi-bin owned by jennifer and group -"other".

ScriptAlias /cgi-bin/ "/var/apache/cgi-bin/"

<Directory "/var/apache/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>


my cgi-bin is /var/apache/htdocs/www/dir-a/cgi-bin.

does *.cgi must have "x"(execute) ?

The factory cgi-bin /var/apache/cgi-bin.






in apache setting:

<Virtualhost 192.168.1.11>
DocumentRoot /var/apache/htdocs/www/forums
Serverpath /forums
ServerName forums.myserver.com
ErrorLog logs/forums.log
Customlog logs/forums-access.log common
ScriptAlias /cgi-bin /var/apache/htdocs/www/forums/cgi-bin/dir-a
</Virtualhost>



in /var/apache/htdocs/www/forums

drwxr-xr-x 4 jennifer other 512 Sep 8 07:00 forums


inside
$ pwd
/var/apache/htdocs/www/forums
drwxr-xr-x 4 jennifer other 512 Sep 8 07:00 .
drwxr-xr-x 26 jennifer other 8704 Sep 7 22:56 ..
drwxr-xr-x 3 jennifer other 512 Sep 7 22:11 cgi-bin
-rwxr-xr-x 1 jennifer other 20851 Sep 8 07:00 forums.cgi
drwxr-xr-x 5 jennifer other 512 Sep 7 21:59 dir-a
-rwxr-xr-x 1 jennifer other 34866 Sep 8 06:02 install.cgi

when I edit install.cgi in /in /var/apache/htdocs/www/forums

vi install.cgi
#!/usr/bin/perl

#############################################################
#
# >>>>>> SET UP ASSISTANT


#


when I edit forums.cgi in /in /var/apache/htdocs/www/forums
vi forums.cgi

#############################################################


use CGI::Carp "fatalsToBrowser"; # Output errors to browse
use CGI qw(:standard); # Saves loads of work
$CGI::POST_MAX=1024 * 150; # limit post data
$CGI:ISABLE_UPLOADS = 1; # Disable uploads

eval {
($0 =~ m,(.*)/[^/]+,) and unshift (@INC, "$1");
($0 =~ m,(.*)\\[^\\]+,) and unshift (@INC, "$1");
"forums.cgi" 461 lines, 20851 characters


======

$ pwd
/var/apache/htdocs/www/forums/cgi-bin/dir-a

-rwxr-xr-x 1 jennifer other 18082 Sep 7 22:12 misc.cgi
-rwxr-xr-x 1 jennifer other 10831 Sep 7 22:12 newposts.cgi
-rwxr-xr-x 1 jennifer other 45142 Sep 7 22:12 post.cgi
-rw-r--r-- 1 jennifer other 45138 Sep 7 22:12 post.cgi.bak
-rwxr-xr-x 1 jennifer other 56985 Sep 7 22:12 postings.cgi
-rwxr-xr-x 1 jennifer other 5490 Sep 7 22:12 printpage.cgi
-rwxr-xr-x 1 jennifer other 3379 Sep 7 22:12 privacy.cgi
-rwxr-xr-x 1 jennifer other 29407 Sep 7 22:12 profile.cgi
-rwxr-xr-x 1 jennifer other 20905 Sep 7 22:12 register.cgi
-rwxr-xr-x 1 jennifer other 25866 Sep 7 22:12 search.cgi
-rwxr-xr-x 1 jennifer other 6928 Sep 7 22:12 setbadwords.cgi
-rwxr-xr-x 1 jennifer other 53092 Sep 7 22:12 setforums.cgi
-rwxr-xr-x 1 jennifer other 23285 Sep 7 22:12 setmembers.cgi
-rwxr-xr-x 1 jennifer other 12474 Sep 7 22:12 setmembertitles.cgi
-rwxr-xr-x 1 jennifer other 20785 Sep 7 22:12 setstyles.cgi
-rwxr-xr-x 1 jennifer other 7673 Sep 7 22:12 settemplate.cgi
-rwxr-xr-x 1 jennifer other 22324 Sep 7 22:12 setvariables.cgi
-rwxr-xr-x 1 jennifer other 21956 Sep 7 22:12 topic.cgi
-rwxr-xr-x 1 jennifer other 10158 Sep 7 22:12 viewip.cgi
-rwxr-xr-x 1 jennifer other 4632 Sep 7 22:12 whosonline.cgi
q1. both install.cgi and forums.cgi look ok from vi , ( it is in dos format), forum.cgi & install.cgi ( chmod +x),
in IE, forum.cgi display just it is while install.cgi is rather messy. I do not understand why????

q2. my virtualhost document root point /var/apache/htdocs/www/forums, I cannot enter "cgi-bin" with internal error 500.

q3. perl execution is ok in /var/apache/htdocs/www/forums
$ perl -v

This is perl, version 5.005_03 built for i86pc-solaris

Copyright 1987-1999, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.

folks, tell why ???????????


jennifer

Last edited by worldtouch : September 7th, 2001 at 08:57 PM.

Reply With Quote
  #2  
Old September 8th, 2001, 03:58 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> does *.cgi must have "x"(execute) ?

It needs execute permission.

>> <Virtualhost 192.168.1.11>
>> DocumentRoot /var/apache/htdocs/www/forums
>> Serverpath /forums
>> ServerName forums.myserver.com
>> ErrorLog logs/forums.log
>> Customlog logs/forums-access.log common
>> ScriptAlias /cgi-bin /var/apache/htdocs/www/forums/cgi-bin/dir-a
>> </Virtualhost>

1) Remove the line Serverpath
2) Add trailing slash and quote the line ScriptAlias like so:

ScriptAlias /cgi-bin/ "/var/apache/htdocs/www/forums/cgi-bin/dir-a/"

If you don't do this, you will get 404 error.

>> drwxr-xr-x 3 jennifer other 512 Sep 7 22:11 cgi-bin
>> drwxr-xr-x 5 jennifer other 512 Sep 7 21:59 dir-a

Why you have a duplicated dir-a directory at /var/apache/htdocs/www/forums/cgi-bin/dir-a and /var/apache/htdocs/www/forums/dir-a/cgi-bin

>> q1. both install.cgi and forums.cgi look ok from vi , ( it is in dos format)

You need to trim the ^M (\r\n) at the end of line for every line

>> q2. my virtualhost document root point /var/apache/htdocs/www/forums

Your *.cgi files are sitting all over the places in /var/apache/htdocs/www/forums instead of your cgi-bin dir. Keep in mind, if you don't specify a <Directory "/var/apache/htdocs/www/forums">, the Options is then inherited from your parent directory or perhaps your default docroot at /var/apache/htdocs. That said, if
<Directory "/var/apache/htdocs">
Options None
...
...
</Directory>

You then need:

<Directory "/var/apache/htdocs/www/forums">
Options +ExecCGI
...
...
</Directory>l

Reply With Quote
  #3  
Old September 9th, 2001, 07:47 AM
worldtouch worldtouch is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Milian, Italy
Posts: 357 worldtouch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
mind run faster than hands

IT IS NOT IN DOS format.
you see there is no " ^M".....
that is why I shown part of the *.cgi program.

I am collate the feedback from friends, they are very helpful.

I am trying to figure now since I was out of town since saturday afternoon.


will try now!


jennifer

Reply With Quote
  #4  
Old September 9th, 2001, 02:13 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> IT IS NOT IN DOS format

Was it in DOS format or not, I don't know, because you told me it was exactly as shown in your q1 and I was telling you how to solve such problem.

You still haven't replied me whether or not you know where your cgi-bin is.

Reply With Quote
  #5  
Old September 9th, 2001, 10:13 PM
worldtouch worldtouch is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Milian, Italy
Posts: 357 worldtouch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
forbidden 403

cgi(*.pl) is /var/apache/htdocs/www/forums/cgi-bin/bbs


my current setting:

<Virtualhost 192.168.1.11>
DocumentRoot /var/apache/htdocs/www/forums
ServerPath /forums
ServerName forums.myserver.com
ErrorLog logs/forums.log
Customlog logs/forums-access.log common
ScriptAlias /cgi-bin /var/apache/htdocs/www/forums

<Directory "/var/apache/htdocs/www/forums">
Options ExecCGI
AllowOverride None
Options None
Order allow,deny
Allow from all

</Directory>
</Virtualhost>


in forums.log

[Mon Sep 10 10:23:14 2001] [error] [client 192.168.1.1] Options FollowSymLinks d
r SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbi
den: /var/apache/htdocs/www/forums/cgi-bin/bbs




there is many type of errors, since I tried different methods after reading from the text, with/w o +, qoutes....etc and <directory> </directory>, remove ServerPath. ownership, group...etc.


After 4 hours, I also tried this.

I ftp a file called forum.cgi (perl program, chmod x, then chmod 0755) in var/apache/htdocs/www/forums . I IE, I saw the file as a text file,it is display not excute at all.

I ftp a file called install.cgi (perl program, chmod x, then chmod 0755) in var/apache/htdocs/www/forums . I IE, I saw the file as
file text but messy. it is display not excute at all. when u vi it , it does not say it is a dos format. install.cgi look ok when it was edited with vi.


I ftp anther file file *.html, in /var/apache/htdocs/www/forums
it display ok as a html should have.








no luck at all.
jennifer

Last edited by worldtouch : September 10th, 2001 at 01:29 AM.

Reply With Quote
  #6  
Old September 10th, 2001, 06:09 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
1) Remove the following lines from your <VirtualHost> block as they don't make sense to Apache.

ServerPath /forums
ScriptAlias /cgi-bin /var/apache/htdocs/www/forums

2) As a docroot, it's going to need more than ExecCGI. So start out with Options All within <Directory "/var/apache/htdocs/www/forums">.

There is a basic rule to the usage of ScriptAlias, if your situation doesn't compile with the rule, don't use it.

- If your cgi-bin resides under your docroot, don't use it just because you alias or scriptalias it only if it doesn't physically locate under your docroot.
- If your script requires or you are incapable to relocate the log file, html file and image elsewhere other than residing in the same directory as your CGI scripts, don't use it just because a scriptalias'ed cgi-bin can't have non CGI scripts within it or in its subdir recursively.

For (1) above, CGI scripts can be executed anywhere, not just cgi-bin given you have at least ExecCGI to your docroot.
For (2), if you specify Options All, you can place your script anywhere under your docroot.

Reply With Quote
  #7  
Old September 10th, 2001, 08:23 AM
worldtouch worldtouch is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Milian, Italy
Posts: 357 worldtouch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
no. I do n't know why error 403

I used to have mail.pl in /var/apache/cgi-bin ( this is the area where the original cgi located. later the data form are ported to mysql table.

2 days ago, I was able to find a free bbs ( ikonboard), I have read the whole part for install and then I just ftp all cgi in /var/apache/cgi-bin and try the installation.

It has same error message which I have gone thro' 0755.

In the first ( 100 lines there is an area specify where is cgi directory suppose to go ( as common cgi for all the webspace directory.)

in virtual directory , it must be a pair of <virtualhost>
.... </virtualHost>


my current setting:



<Virtualhost 192.168.1.11>
DocumentRoot /var/apache/htdocs/www/forums
#ServerPath /forums
ServerName forums.myserver.com
ErrorLog logs/forums.log
Customlog logs/forums-access.log common
#ScriptAlias /cgi-bin /var/apache/htdocs/www/forums


</Virtualhost>

<Directory "/var/apache/htdocs/www/forums">
Options All
AllowOverride None
#Options None
Order allow,deny
Allow from all

</Directory>



1) Remove the following lines from your <VirtualHost> block as they don't make sense to Apache.

DONE

ServerPath /forums
ScriptAlias /cgi-bin /var/apache/htdocs/www/forums


DONE

2) As a docroot, it's going to need more than ExecCGI. So start out with Options All

within <Directory "/var/apache/htdocs/www/forums">.


DONE


There is a basic rule to the usage of ScriptAlias, if your situation doesn't compile with the rule, don't use it.


OK



my normal documentroot is /var/apache/htdocs/www/......
see above!!


jennifer

Last edited by worldtouch : September 10th, 2001 at 06:08 PM.

Reply With Quote
  #8  
Old September 10th, 2001, 08:14 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
What error from which script are you getting the 403 error now? What is the full system path to that script?

Make sure it's somewhere at /var/apache/htdocs/www/forums or a subdir under it. You can't put those scripts to /var/apache/cgi-bin.

How about full URL to that script?

Reply With Quote
  #9  
Old September 11th, 2001, 04:23 AM
worldtouch worldtouch is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Milian, Italy
Posts: 357 worldtouch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
I got it...

I setup the forum board already. I will have to do testing in solaris and then linux.


I still sendmail or qmail before it look more like half of the function of devshed.com

Thanks!!!

jennifer

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > after I create cgi-bin, error 500 internal error


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway