|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
>> 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 |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
>> 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. |
|
#5
|
|||
|
|||
|
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. |
|
#6
|
|||
|
|||
|
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. |
|
#7
|
|||
|
|||
|
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. |
|
#8
|
|||
|
|||
|
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? |
|
#9
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > after I create cgi-bin, error 500 internal error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|