Thursday, February 09, 2006

Hair Loss and Extensions (pt 2)

(or how I learned to plug FrontPage Extensions into a Plesk subdomain)

-Part 2 (Read Part 1... The Madness)

How to add Frontpage extensions to a Plesk subdomain. This assumes you have the following created in Plesk:

1)Plesk domain, with Frontpage extensions enabled
2)One or more subdomains created in Plesk for the primary domain

Technical Details
Frontpage extensions are used by Microsoft applications to communicate, read and publish data to web sites. Details about them can be found here. It basically consists of:

Basic Frontpage environment:
1)Frontpage executables and configuration files, /usr/local/frontpage/
2)Web site directories, files, and .htaccess controls

If Frontpage is installed on the root directory then it is configured for the server, you just need to enable it for the individual domains. Plesk does it with their config utilities websrvmgr for the main domains, but their syntax does not seem to account for subdomains,

Here is the recipe:

1)Create a dummy domain (dd) in Plesk, and turn on Frontpage extensions, use the user name and password you want to use for your subdomain

2)change directories to the subdomain httpdocs directory
  • cd /home/httpd/vhosts/domain/subdomains/subdomain/httpdocs/
3)copy the following from the dummy domain:
  • cp -R /home/httpd/vhosts/(dd)/httpdocs/_vt* .
  • cp /home/httpd/vhosts/(dd)/httpdocs/_private/.htaccess private/.htaccess
  • cp -R /home/httpd/vhosts/(dd)/httpdocs/.htaccess .
4)Open the .htaccess file and edit the three lines for your environment:
  • AuthName (subdomain.domain)
  • AuthUserFile (path to the user password file) /home/httpd/vhosts/domain/subdomains/httpdocs/_vti_pvt/service.pwd
  • AuthGroupFile (path to group membership file) /home/httpd/vhosts/domain/subdomains/subdomain/httpdocs/_vti_pvt/service.grp
5)Save this file and copy these three lines. You will need to replace them in a number of starting .htaccess files.

6)Edit each of the .htaccess files. You can find them to make sure you don’ miss any
  • find . -name ‘.htaccess’
7)Edit each of these and replace the AuthName, AuthUserFile, and AuthGroupFiles with the proper entries you copies from when you edited the main .htaccess files.

Don’t change anything else in these files


8)Edit ‘_vti_pvt/access.cnf’ set the Realm and PasswordFile entries appropriately
  • Realm is subdomain.domain.com
  • PasswordFile is: /home/httpd/vhosts/domain/subdomains/subdomain/httpdocs/_vti_pvt/service.pwd
9)Change to the ‘_vti_pvt/ directory

10) chmod go+rw frontpg.lck

11)chown user:root service.cnf
(user is Plesk ftp username)

12)check all file ownership permissions, for all the files mentioned they should be owned by
user:psaserv
Once all these changes have been made the subdomain site has the files necessary, we just need to let apache and Frontpage know whats up.

In /usr/local/frontpage there are files for the parent domain, one in the conf directory and one in the root, we will need a pair of these for each subdomain we created. Copy the files and then we can edit them.

cp /usr/local/frontpage/domain:80.cnf /usr/local/frontpage/subdomain:80.cnf

cp /usr/local/frontpage/conf/domain.fp.80.cnf /usr/local/frontpage/subdomain.fp.80.cnf

The conf file is a httpd conf file excerpt. Edit it to make sense. ServerName, User, DocumentRoot and Directory should be altered appropriately

the :80.cnf file seems to be a pointer to the conf file. And if you notice primary domains (which also support www alias) have a linked files for the www. name. For subdomains you don’t need this.

The last change is to the httpd.include file.
In
/home/httpd/vhosts/domain/conf/httpd.include
you need to find the Directory section and duplicate it for the subdomain entry

You need to make a backup copy of this httpd.include file because it will be over written by Plesk. The other changes should not though.

So if you build the monster you need to automate the replacement of this file and restart of the httpd server.