[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [cobalt-users] sub-domain subdomain mapped pointed to subdirectory subfolder and CGI
- Subject: RE: [cobalt-users] sub-domain subdomain mapped pointed to subdirectory subfolder and CGI
- From: d.gurney@xxxxxxxxxxxxxxxxx
- Date: Sun Aug 5 21:03:20 2001
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
using the suggestions in the message below I've managed to get a subdomain setup to point to a sub directory of a site and the scripts running in this subdirectory can affect the content of the main site but only as long as the pages required to be changed and the data files it requires to access are chmoded 777 and they are addressed by the absolute path (ie /home/sites/ etc). This seems to be because the privilege of the script is set via the url you address it by since the scripts, pages and data files are all owned by the same user.
Does anyone know where the link is between user privilege and website address ?
Also does anyone know how you enable SSL for a subdomain ? if I enable SSL for the entire domain then try to connect to it, the first page it goes to (no matter what you type in the address bar), is the main site homepage.
Regards,
Dave Gurney
-----Original Message-----
From: ravencarrie@xxxxxxxx Sent: 02 August 2001 11:57
To: cobalt-users@xxxxxxxxxxxxxxx
Subject: [cobalt-users] sub-domain subdomain mapped pointed to
subdirectory subfolder and CGI
Trying to sum this one up for future archive searchers, so they don't experience the desk-banging that I did, missing the ExecCGI tweak at the end.
To point a subdomain such as blue.widgets.com to a subdirectory/subfolder (/home/sites/siteX/web/folder) of www.widgets.com, simply do this:
1. Create a DNS "A" record for blue.widgets.com and point it to the same IP as www.widgets.com. 2. Get to a command line as root and change directories to /etc/httpd/conf.
3. Create a backup of httpd.conf:
cp httpd.conf httpd.conf.bak
4. Open httpd.conf with vi or pico. Page down until you get to your first <VirtualHost> entry. Just above that line, add these two lines:
#Include file added for sub-domain pointing
include /etc/httpd/conf/subdomains.conf
5. Exit out of vi or pico, saving the file (CTRL-X, Y for yes, and <enter> in pico).
6. Create a new file named subdomains.conf. With pico, this is as simple as:
pico subdomains.conf
7. Copy and paste this entire section into the file, then go back and edit it so that it has *your* IP address, *your* subdomain name, *your* path to the subfolder/subdirectory.
#Start copying here
<VirtualHost XXX.XXX.XXX.XXX>
ServerName blue.widgets.com
ServerAdmin siteadmin_username
DocumentRoot /home/sites/siteX/web/subfolder
RewriteEngine on
RewriteCond %{HTTP_HOST} !^XXX.XXX.XXX.XXX(:80)?$ RewriteCond %{HTTP_HOST} !^blue.widgets.com(:80)?$
RewriteRule ^/(.*) http://blue.widgets.com/$1 [L,R]
RewriteOptions inherit
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
</VirtualHost>
#Stop copying here
Watch out for email line-wrap.
Note: In order for CGI to work correctly with a subdomain pointed to a subdirectory, you MUST have cgi-script set as the AddHandler rather than cgiwrap. You also must have ExecCGI turned on for the site (or the server), or the server won't know how to handle classic CGI calls!
8. Save the file and exit.
9. Backup access.conf:
cp access.conf access.conf.bak
10. Open access.conf and allow ExecCGI (classic CGI) for either the entire server (not secure) or for that site (siteX, not siteX/web/subfolder).
- For the entire server, near the top of the file, find this section:
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
- And change the line below it, adding ExecCGI (I've got Indexes turned off to disallow directory browsing) so that it looks like so (your other chosen Options may be different):
Options -Indexes FollowSymLinks Includes MultiViews ExecCGI
- For just that site, page down until you find that site's (siteX) entry near the bottom of the file. On the Options line, add ExecCGI.
11. Save and exit.
12. Restart httpd:
/etc/rc.d/init.d/httpd restart (or httpd.init restart for older models)
You're all finished! Fire up the subdomain in your browser. If you have any problems, check subdomains.conf to make sure you have the IP addresses, DocumentRoot, ServerName and Rewrite rules correct. You can always restore the backup files if anything goes haywire:
cp httpd.conf.bak httpd.conf
cp acces.conf.bak access.conf
Have fun!
--
CarrieB
"The language and concepts contained herein are guaranteed not to cause eternal torment in the place where the guy with the horns and pointed stick conducts his business." --Frank Zappa
_______________________________________________
cobalt-users mailing list
cobalt-users@xxxxxxxxxxxxxxx
To Subscribe or Unsubscribe, please go to:
http://list.cobalt.com/mailman/listinfo/cobalt-users