niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Apps » Apache
Alias or ScriptAlias ?
Post new topic   Reply to topic Page 1 of 1 [5 Posts] View previous topic :: View next topic
Author Message
Boyle Owen
*nix forums Guru


Joined: 07 Feb 2005
Posts: 618

PostPosted: Wed Jul 19, 2006 7:32 am    Post subject: RE: Alias or ScriptAlias ? Reply with quote

Quote:
-----Original Message-----
From: Matus UHLAR - fantomas [mailto:uhlar@fantomas.sk]

You can also look at AddHandler
(http://httpd.apache.org/docs/2.2/mod/mod_mime.html#addhandler) to
extend CGI to all .cgi files.

I wonder why didn't you start with this Wink

And I wonder why you *did* start with this...

Both solutions work, both solutions were mentioned - order is
irrelevant.

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored.

Quote:
--
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
42.7 percent of all statistics are made up on the spot.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP
Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please notify the sender urgently and then immediately delete the message and any copies of it from your system. Please also immediately destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. The sender's company reserves the right to monitor all e-mail communications through their networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of the sender's company.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Back to top
Matus UHLAR - fantomas
*nix forums Guru


Joined: 21 Feb 2005
Posts: 430

PostPosted: Tue Jul 18, 2006 2:11 pm    Post subject: Re: Alias or ScriptAlias ? Reply with quote

On 18.07.06 11:48, Boyle Owen wrote:
Quote:
It is not a great idea to mix static and CGI content in the same
directory since a simple misconfiguration can put your code on the web.

I don't think this is a problem. or, better said, such problem can appear
anywhere (e.g. just rename .php to something else)

Quote:
However, it can be done using SetHandler (see
http://httpd.apache.org/docs/2.2/mod/core.html#sethandler) and Options
ExecCGI.

I find AddHandler simpler and universal:

AddHandler cgi-script .cgi
Options ExecCGI

and it will work globally. If you want to enable/disable CGI's per-context,
you only need to put Options +-ExecCGI into VirtualHost/Directory/Location
secrionc.

Quote:
You also need "DirectoryIndex script.cgi" in that dir...

Or simply index.cgi and let user use proper name for the script...

(e.g. "DirectoryIndex index.var index.cgi index.html")

Quote:
You can also look at AddHandler
(http://httpd.apache.org/docs/2.2/mod/mod_mime.html#addhandler) to
extend CGI to all .cgi files.

I wonder why didn't you start with this Wink
--
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
42.7 percent of all statistics are made up on the spot.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Back to top
Mauro
*nix forums beginner


Joined: 12 Dec 2003
Posts: 13

PostPosted: Tue Jul 18, 2006 10:23 am    Post subject: Re: Alias or ScriptAlias ? Reply with quote

Thank You
It works fine!!!

----- Original Message -----
From: "Boyle Owen" <Owen.Boyle@swx.com>
To: <users@httpd.apache.org>
Sent: Tuesday, July 18, 2006 11:48 AM
Subject: RE: [users@httpd] Alias or ScriptAlias ?


Something like this might work:

<Location /mydir/script.cgi>
Options ExecCGI
SetHandler cgi-script
</Location>

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored.



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Back to top
Boyle Owen
*nix forums Guru


Joined: 07 Feb 2005
Posts: 618

PostPosted: Tue Jul 18, 2006 9:48 am    Post subject: RE: Alias or ScriptAlias ? Reply with quote

Quote:
-----Original Message-----
From: Mauro [mailto:mauog@interfree.it]
Sent: Tuesday, July 18, 2006 11:28 AM
To: users@httpd.apache.org
Subject: [users@httpd] Alias or ScriptAlias ?

Hi all,
I have my server with its document root running.
Now I would like to add another directory in which:
every user go to www.myserver.mine/mydir/ execute
/myserver/mydir/script.cgi
In this directory there are also some subdirs with css, icons
and html pages I would like web server shows.

If i configure it like
"ScriptAlias"
web server try to execute all inside
If i configure it like
"Alias"
and I add
"DirectoryIndex script.cgi"
"Options +ExecCGI"
web server shows me content of script.cgi without executing it.

It is not a great idea to mix static and CGI content in the same
directory since a simple misconfiguration can put your code on the web.
However, it can be done using SetHandler (see
http://httpd.apache.org/docs/2.2/mod/core.html#sethandler) and Options
ExecCGI.

Something like this might work:

<Location /mydir/script.cgi>
Options ExecCGI
SetHandler cgi-script
</Location>

You also need "DirectoryIndex script.cgi" in that dir...

You can also look at AddHandler
(http://httpd.apache.org/docs/2.2/mod/mod_mime.html#addhandler) to
extend CGI to all .cgi files.

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored.

Quote:

Could you help me?

Thank Yoo

Mauro




This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please notify the sender urgently and then immediately delete the message and any copies of it from your system. Please also immediately destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. The sender's company reserves the right to monitor all e-mail communications through their networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of the sender's company.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Back to top
Mauro
*nix forums beginner


Joined: 12 Dec 2003
Posts: 13

PostPosted: Tue Jul 18, 2006 9:28 am    Post subject: Alias or ScriptAlias ? Reply with quote

Hi all,
I have my server with its document root running.
Now I would like to add another directory in which:
every user go to www.myserver.mine/mydir/ execute /myserver/mydir/script.cgi
In this directory there are also some subdirs with css, icons and html pages I would like web server shows.

If i configure it like
"ScriptAlias"
web server try to execute all inside
If i configure it like
"Alias"
and I add
"DirectoryIndex script.cgi"
"Options +ExecCGI"
web server shows me content of script.cgi without executing it.

Could you help me?

Thank Yoo

Mauro
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [5 Posts] View previous topic :: View next topic
The time now is Fri Nov 21, 2008 9:05 pm | All times are GMT
navigation Forum index » Apps » Apache
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts per alias header_checks Tuan Van Postfix 1 Fri Jul 21, 2006 5:29 am
No new posts how to alias an array with a variable in a loop ? Jack Perl 4 Wed Jul 19, 2006 8:17 pm
No new posts must size_t be an alias? Old Wolf C 5 Fri Jul 14, 2006 2:20 am
No new posts ScriptAlias in apache2 "target uid mismatch with director... JupiterHost.Net Apache 1 Thu Jul 13, 2006 4:48 pm
No new posts how to define weak alias in user_defined library seyong_choi@hotmail.com C 1 Wed Jul 12, 2006 9:03 pm

Free Ajax Scripts | Books | Loans | Hotels in Central london | Low Interest Credit Card
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.7371s ][ Queries: 20 (0.6264s) ][ GZIP on - Debug on ]