Plesk How-To: Adding Wildcard Domains when setting up Multisite beta and Elgg: Revision

Last updated by The Father

This is something that the Plugin Multi Site requires which you will need to know. The plugin is located at http://community.elgg.org/pg/plugins/fabcol/read/329499/multisite-beta-233-for-elgg-15-and-elgg-161  This is the plugin by Fabrice who it looks like has done a great job!

If you are running Plesk control panel then you more then likely already know that common tasks such as cron job setups or normal functions are now much more complex because of Plesk.

There are 2 steps incolved with doing this:

To Add Wildcard Sub Domains Do This:

Step 1) <Fairly Easy to Do>

Go To your Plesk Control Panel - Once you are logged in and your desktop appears Click Domains Link - From the list of Domains that appears select the domain that you wish to turn on wildcard domains for. Lets use mydomain.com as an example - Go ahead and click mydomain.com

Once that page loads select the icon and/or link called DNS Settings and click it!

Now click the link and/or Icon called Add Record

Once that loads you are present with 3 items:

1) Record Type - Leave that alone

2) Enter Domain Name - Just put a * in that box

3) Enter IP Address - Put that IP Address of the server that hosts your Elgg site

Now click the Ok Button.

You should now see a new entry after that next page loads under your resource records that should show your new entry like this *.mydomain.com

If you do not have a new entry is your list then do not attempt the next step because you could possibly mess your server completely. But if you do see the above entry in your list then proceed to step 2 Below.

Step 2) <More Difficult to do and recommended only for people that know what they are doing!!!!>

This step requires root access to your server. I personally use a program called Secure CRT for all my SSH sessions. 

Depending on your server configuration:

If you are already running Elgg on your server you should already have a vhost.conf file. If you do not then chances are your install of Elgg is not very good and/or secure.

If you do not have the vhost.conf file for mydomain.com then you will need to create one by doing these steps:

1) cd /var/www/vhosts/mydomain.com/conf/ or /home/httpd/vhosts/mydomain.com/conf/

2) type in Pico vhost.conf <enter>

Add this line

ServerAlias *.mydomain.com

now click the control key and X - Save changes

if you already have the file

 

Edit the /var/www/vhosts/mydomain.com/conf/vhost.conf or /home/httpd/vhosts/mydomain.com/conf/vhost.conf file and enter this information:

ServerAlias *.mydomain.com

Once again save changes and exit.

 

Whether the vhost.conf was new or not, you will need to reload the Apache configuration:

Enter the following command  /etc/init.d/httpd reload and <enter>

Thats all there is to it. To make sure that this is working simply open your web browser and type in anything-you-want.mydomain.com and it should now point to the front page of your elgg site. If not then go back to the top of this page and start over. Any questions let me know

The Father

FWIW - I just want to add that I did not figure all of this out by myself.  Bits and pcs are from notes I found on other web sites but I did add it all up and expand on it so that you can get the job done the same way i did!