Plesk :: Automatic shared SSL and temporary URL for domains
by Tinuva on Feb.25, 2009, under Plesk
Sometimes you move a domain to a plesk server, or set up a new domain and would like to test it before the domain registration is complete or share a SSL amongst multiple domains or even have problems testing the domain since the builtin plesk website preview doesnt work with php sessions.
Step1: Add * record dns entry.
Lets for example say your shared SSL will be servername.domain.com
You will need a record as follows:
Record type: A
Value: *.servername.domain.com
Step2: Have a Wildcard SSL certificate ready, order it so long and add it later on.
Step3: Create the main domain servername.domain.com on your server
Step4: Add the following event to the plesk control panel:
Event: Domain Created
Priority: Lowest (0)
User: root
Command: /usr/local/psa/admin/plib/api-cli/domalias.php –create
This will automate the creation of the temporary url for you.
Step5: Create the domain example.co.za on your server and double check that the alias was created.
Step6: Add a custom button to your control panel
Create the file /usr/local/psa/admin/htdocs/domains/tempurl.php
With the contents from this file here: tempurl_php.txt
You will need to replace the $host variable with the server’s name.
Then add a custom button to the server as follows:
Plesk8 -> server -> custom buttons
Plesk9 -> home -> custom buttons (on admin account)
Button Label: Temporary URL
Location: Domain administrator’s Home page
Priority: 100
Background Image: Dont have one yet….
URL: /domains/tempurl.php
Context help tips contents: Preview domain on temporary url.
Tick: &dom_name=
Tick: Visible to all sub-logins
Now you will have a button to automate visiting the url for clients.