[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FW: [cobalt-users] Using symbolic links in DocumentRoot directive
- Subject: FW: [cobalt-users] Using symbolic links in DocumentRoot directive
- From: "Neil J. Kemp" <neil@xxxxxxxxxx>
- Date: Wed Jan 5 16:25:12 2000
Erm. That probably won't make any sense to anyone. I just worked out that
he'd not sent his email to list but direct to me...
You'd think me having to manually send to cobalt-users@xxxxxxxxxxxxxxx would
have told me something...
oops. Apologies.
--Neil
-----Original Message-----
From: cobalt-users-admin@xxxxxxxxxxxxxxx
[mailto:cobalt-users-admin@xxxxxxxxxxxxxxx]On Behalf Of Neil J. Kemp
Sent: 06 January 2000 00:18
To: cobalt-users@xxxxxxxxxxxxxxx
Subject: RE: [cobalt-users] Using symbolic links in DocumentRoot
directive
>I will need to find a solution for this since I want the cgi directly write
>to the extra config file that contains the directives and to restart the
>apache.
Well straight away you're going to have problems there. Although the
permissions for the .conf files could be modified, the httpd runs as root so
restarting it could be a problem from a web CGI. A possible easier way would
be to put a script in the /etc/cron.hourly to restart every hour BUT
bewarned if you did that and there was even the slightest of errors in the
.conf files the server would go down and httpd wouldn't restart until you
look manually at it to fix the error.
There's a few if's here but if you can fufill them all this might help. IF
you can wildcard your DNS for your domains (*.domain.com so all resolve to a
specific IP) and I think you have to do this manually meaning you can't ever
use the GUI again. Also you'll need to then redefine your virtualserver
config in httpd.conf or rather adding that extra.conf line I used from a few
e-mails back. I'll add that later on.
If you can do here's something I do myself because I can't always be
bothered to edit Apache's config for quick things. It's a very flexible
index.cgi you can use instead of index.html
You'll need to be a bit familiar with Perl, but it's only the first few
lines that need adding too.
Skipping the first line, the next two lines of code define two different
subdomains under your main domain and redirect them to different addresses.
This could be addresses inside your own site. Different directories etc.
style is how u want it to redirect. If you just have redirect it'll
literally redirect changing the address in the browser bar. However if it's
frames then it'll redirect to a page with frames but one frame hiding the
address but showing the target address (makes more sense when u see it).
keywords are keywords for search engines, title is the title and URL is the
target URL etc.
The 4th line of code is the DEFAULT page to goto if not already matched
above.
It's messy, but if you can understand how it works, it may be able to be
adapted to your situation (?)
The second file is a redefinition of one of the RaQ2's sites and I have to
put this in my "extra.conf" (included httpd.conf file) and it allows me to
use *.domain.com for web access.
I hope this is of somehelp and apologies if it's all jumbled up. It's just
gone midnight here in the UK XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ords go here" ;$title =3D =
"Title goes here" ;$style =3D "redirect"}
if ($URL eq "") {$URL=3D"http://default.location.com" =
;$title=3D"Everywhere else" ;$keywords=3D"more keywords here" ;$style =
=3D "frames"}
if ($style eq 'frames') {
print "Content-type:text/html\n\n";
print <<EOF;
<html>
<head>
<meta name=3D"keywords" content=3D"$keywords, $title">
<title>$title</title>
</head>
<frameset rows=3D"100%,*" frameborder=3D"no" border=3D"0" =
framespacing=3D"0">
<frame name=3D"MAINFRAME" src=3D"$URL" marginheight=3D0 marginwidth=3D0 =
scrolling=3Dauto noresize>
</frameset>
<noframes><p>Your browser does not support frames. Click <A =
href=3D"$URL">here</A> to go to $title</p>
</noframes>
</html>
EOF
}
elsif ($style eq 'redirect') {=20
print "Content-type:text/html\n\n";
print <<EOF;
<html>
<head>
<title>$title</title>
<meta http-equiv=3D"refresh" content=3D"0;URL=3D$URL">
</head>
<body bgcolor=3D"#FFFFFF">
</body>
</html>
EOF
}
<VirtualHost 216.206.135.126>
ServerName www.mysteria.net
ServerAlias *.mysteria.net
ServerAdmin mysteria@xxxxxxxxxxxx
DocumentRoot /home/sites/site13/web
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
AddHandler server-parsed .shtml
AddType text/html .shtml
Alias /cobalt-images/ /usr/admserv/html/.cobalt/images/
Alias /error/ /usr/admserv/html/.cobalt/error/
RewriteEngine on
RewriteCond %{HTTP_HOST} ^([^:]+)
RewriteRule ^/admin/?$ http://www.mysteria.net:81/.cobalt/sysManage/index.html [L,R]
RewriteCond %{HTTP_HOST} ^([^:]+)
RewriteRule ^/siteadmin/?$ http://www.mysteria.net:81/.cobalt/siteManage/www.mysteria.net/index.html [L,R]
RewriteCond %{HTTP_HOST} ^([^:]+)
RewriteRule ^/personal/?$ http://www.mysteria.net:81/.cobalt/personal/index.html [L,R]
RewriteCond %{HTTP_HOST} ^([^:]+)
RewriteRule ^/.cobalt/(.+) http://www.mysteria.net:81/.cobalt/$1 [L,R]
RewriteCond %{HTTP_HOST} ^([^:]+)
RewriteRule ^/cgi-bin/.cobalt/(.+) http://www.mysteria.net:81/cgi-bin/.cobalt/$1 [L,R]
AliasMatch ^/users/([^/]+)(/(.*))? /home/sites/site13/users/$1/web/$3
ScriptAlias /_vti_bin/_vti_adm/ /home/sites/site13/web/_vti_bin/_vti_adm/
ScriptAlias /_vti_bin/_vti_adm/ /home/sites/site13/web/_vti_bin/_vti_aut/
ScriptAlias /_vti_bin/ /home/sites/site13/web/_vti_bin/
ScriptAlias /cgi-bin/ /home/sites/site13/web/cgi-bin/
AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site13/users/$1/web/$3
</VirtualHost>