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.

Thursday, February 02, 2006

Hair Loss and Extensions

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

- Part 1



We use Plesk 7 to manage out hosting servers. I like its interface, it is easy to use, and I find my clients have few problems navigating it.



I recently had a new client with a primary domain and a few subdomains utilize our hosting services. It was our first hosting contract which involved subdomains and a large population of publishers using Microsoft products, including Frontpage, Word, and Excel to keep portions of their site updated.



During deployment of the site I realized that Plesk 7 doesn't support Frontpage extensions for subdomains. This was a disappointment, and we worked to try and enable functionality of the Microsoft Products using FTP as a methodology for file transfer. As usual we found that Microsoft supports their own methods better than standards and it became apparent that implementation of Frontpage extensions on the subdomains would make the editing, updating and management of the site easer.


I spent a bunch of time reading up on the Frontpage extensions, and especially as they related to Plesk, and specifically Plesk 7. There is not a lot of detail. I found a great Frontpage support resource, and details on installing from scratch on a Linux/Apache server. Unfortunately that is not exactly what I needed. Plesk does some strange things, like has its own suexec etc. So we needed to fit into that system.


Further research yielded a way to manually clean an installation that is not behaving, and this lead me to realize that the extensions are not all that foreign, They are just a bunch of directories, .htaccess, executable and configuration files. I created a blank test domain and traced the files and directories created and came up with a recipe that worked for me.


Caveats/Warnings:

  1. If you edit the web site settings in Plesk after you make these changes, Plesk will overwrite your changes to the domain httpd.include file

  2. If you reboot the server Plesk will overwrite the changes to the domain httpd.include file

  3. File ownership and permissions are critical, pay careful attention

  4. I did not spend the time to script recreation of the environment in the event of corruption

  5. If you follow these instructions in a production environment without first testing them you deserve the lynching you get, and don't blame me.

Considerations:

  1. You may want to remove FTP access after this because all management can be accomplished through Frontpage, and ftp users can corrupt files. To do this clear the FTP password in Plesk

  2. Be sure and test your changes and familiarize yourself with the files and structures before going to a live environment

Ok enough gas bagging..... Part 2 will be coming up next...