LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-09-2012, 05:58 AM   #1
adam_1784
Member
 
Registered: Dec 2011
Posts: 41

Rep: Reputation: Disabled
ScriptAliasMatch apache


ScriptAliasMatch ^/~([a-zA-Z0-9]+)/cgi-bin/(.+) /home/$1/cgi-bin/$2

will map a request to http://example.com/~user/cgi-bin/script.cgi to the path /home/user/cgi-bin/script.cgi and will treat the resulting file as a CGI script.

I want to access http://example.com/cgi-bin/script.cgi as my path is /home/user/www/cgi-bin/script.cgi what changes i have to make in ScriptAliasMatch condition.
 
Old 03-09-2012, 08:43 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,901

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
Hi,

If you want to map the main apache cgi-bin directory to a specific user cgi-bin directory you don't need ScriptAliasMatch. ScriptAlias is enough
Code:
ScriptAlias /cgi-bin/ "/home/user/www/cgi-bin/"
If you insist, you can use:
Code:
ScriptAliasMatch ^/cgi-bin/(.*) "/home/user/public_html/cgi-bin/$1
Regards
 
Old 03-12-2012, 07:08 AM   #3
adam_1784
Member
 
Registered: Dec 2011
Posts: 41

Original Poster
Rep: Reputation: Disabled
Thanks for the help.

I try both the option but it did not work .
I also try this one

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !~
RewriteCond %{REQUEST_URI} ^\/.*\.pl$
RewriteCond %{DOCUMENT_ROOT} \/home\/mst3k\/public_html
RewriteRule ^(.*)$ /~mst3k/$1 [L]

but it also didnt work
 
Old 03-12-2012, 08:12 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,901

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
What exactly are you trying to do and how it's not working. Check apache logs to see what's happening
If you want a request for http://example.com/cgi-bin/script.cgi to be served from the cgi directory in /home/mst3k/public_html/cgi-bin, then you need the just ScriptAlias above modified like this (added the specific username)
Code:
ScriptAlias /cgi-bin/ /home/mst3k/public_html/cgi-bin/
 
  


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
setting up apache from scratch on a linux machine, apache failed message upon bootup dramous43 Linux - Enterprise 2 01-26-2010 08:53 AM
Apache Webserver on Slackware - Failed to Start Apache - 'no listening sockets .." CCTVGuru Linux - Server 4 10-11-2009 02:14 AM
Apache 1.3.33 (debian built) and Apache SSL does not respond to the proper ports lqorg_user Linux - Networking 0 11-06-2005 05:11 PM
Apache Webserver 403 Forbidden Errors (User not in apache group?) Mankind75 Mandriva 4 07-08-2004 06:30 AM
apache benchmarks (apache v13 / apache v20) ; large differences between benchmarking markus1982 Linux - Software 0 02-08-2003 11:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:33 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration