Difference between revisions of "Subdomain setup"

From Dreamwidth Notes
Jump to: navigation, search
m
Line 1: Line 1:
In order to get subdomain user URLs working, uncomment the bolded lines in <code>etc/ljconfig.pl</code>:
+
== DNS Management ==
 +
 
 +
First, you will also have to set up a wildcard subdomain record with your host. If you are hosting your installation on Linode, here is an example of how to do this.
 +
 
 +
Go to the DNS Manager section of your account and click on the domain zone your DW install is hosted on. Go to the "A/AAA Records" section and note the IP address of the hosts:
 +
 
 +
[[Image:Linode a records.png]]
 +
 
 +
(Note: the above picture already has the wildcard listed in it.  Yours won't have that yet, but will when you finish this.) You will want to click on "Add a new A/AAA Record":
 +
 
 +
[[Image:Linode subdomain wildcard.png]]
 +
 
 +
Here, you will want to add <code>*.yourdomain.com</code> and the IP address you noted on the last page.  Save this form and a wildcard subdomain should be added to your A/AAA Records section.
 +
 
 +
== Configuration ==
 +
 
 +
To configure your installation for user subdomains, uncomment the bolded lines in <code>etc/ljconfig.pl</code>:
  
 
  # Support URLs of the form http://username.yoursite.com/ ?
 
  # Support URLs of the form http://username.yoursite.com/ ?
Line 10: Line 26:
 
  <b>$ONLY_USER_VHOSTS = 1;</b>
 
  <b>$ONLY_USER_VHOSTS = 1;</b>
  
You will also have to set up a wildcard subdomain record with your DNS.
+
If you only want certain user classes to have user subdomains, <b>do not</b> set <code>$ONLY_USER_VHOSTS</code> to 1, or journals who do not have this user capability won't work!
 +
 
 +
You will also have to set a user capability in <code>etc/ljconfig.pl</code> called <code>userdomain</code>.  If you want all users to have this capability, add it to %CAP_DEF:
 +
 
 +
%CAP_DEF = (
 +
        'maxfriends' => 500,
 +
        'userpics' => 1,
 +
        'checkfriends_interval' => 60,
 +
        'checkfriends' => 1,
 +
        'styles' => 0,
 +
        'todomax' => 25,
 +
        'todosec' => 0,
 +
        'friendsviewupdate' => 30,
 +
        'findsim' => 1,
 +
        'getselfemail' => 0,
 +
        <b>'userdomain' => 1</b>
 +
);
 +
 
 +
Otherwise, you will have to add <code>'userdomain' => 1</code> to one or more of the user classes listed in <code>%CAP</code>.
  
 
[[Category: Dreamwidth Installation]]
 
[[Category: Dreamwidth Installation]]

Revision as of 15:38, 16 September 2008

DNS Management

First, you will also have to set up a wildcard subdomain record with your host. If you are hosting your installation on Linode, here is an example of how to do this.

Go to the DNS Manager section of your account and click on the domain zone your DW install is hosted on. Go to the "A/AAA Records" section and note the IP address of the hosts:

Linode a records.png

(Note: the above picture already has the wildcard listed in it. Yours won't have that yet, but will when you finish this.) You will want to click on "Add a new A/AAA Record":

Linode subdomain wildcard.png

Here, you will want to add *.yourdomain.com and the IP address you noted on the last page. Save this form and a wildcard subdomain should be added to your A/AAA Records section.

Configuration

To configure your installation for user subdomains, uncomment the bolded lines in etc/ljconfig.pl:

# Support URLs of the form http://username.yoursite.com/ ?
# If so, what's the part after "username." ?
$USER_VHOSTS = 1;
$USER_DOMAIN = $DOMAIN;

# If you ONLY want USER_VHOSTS to work and not the typical /users/USER and /community/USER
# then set this option:
$ONLY_USER_VHOSTS = 1;

If you only want certain user classes to have user subdomains, do not set $ONLY_USER_VHOSTS to 1, or journals who do not have this user capability won't work!

You will also have to set a user capability in etc/ljconfig.pl called userdomain. If you want all users to have this capability, add it to %CAP_DEF:

%CAP_DEF = ( 
        'maxfriends' => 500,
        'userpics' => 1,
        'checkfriends_interval' => 60, 
        'checkfriends' => 1,
        'styles' => 0,
        'todomax' => 25, 
        'todosec' => 0,
        'friendsviewupdate' => 30, 
        'findsim' => 1,
        'getselfemail' => 0,
        'userdomain' => 1
);

Otherwise, you will have to add 'userdomain' => 1 to one or more of the user classes listed in %CAP.