

# Manage multiple WordPress sites with Multisite on Lightsail
WordPress Multisite

This section covers the following topics related to managing blogs on your WordPress Multisite instance in Amazon Lightsail:

**Topics**
+ [

# Add blogs as domains to your WordPress Multisite on Lightsail
](amazon-lightsail-add-blogs-as-domains-to-your-wordpress-multisite.md)
+ [

# Add blogs as subdomains to your WordPress Multisite on Lightsail
](amazon-lightsail-add-blogs-as-subdomains-to-your-wordpress-multisite.md)
+ [

# Define the primary domain for your WordPress Multisite instance on Lightsail
](amazon-lightsail-define-the-primary-domain-for-your-wordpress-multisite.md)

# Add blogs as domains to your WordPress Multisite on Lightsail
WordPress Multisite: Add blogs as domains

A WordPress Multisite instance in Amazon Lightsail is designed to use multiple domains, or subdomains, for each blog site that you create within that instance. In this guide, we’ll show you how to add a blog site using a different domain than your main blog’s primary domain on your WordPress Multisite instance. For example, if your main blog’s primary domain is `example.com`, you can create new blog sites that use the `another-example.com` and `third-example.com` domains on the same instance.

**Note**  
You can also add sites using subdomains to your WordPress Multisite instance. For more information, see [Add blogs as subdomains to your WordPress Multisite instance](amazon-lightsail-add-blogs-as-subdomains-to-your-wordpress-multisite.md).

## Prerequisites


Complete the following prerequisites in the order shown:

1. Create a WordPress Multisite instance in Lightsail. For more information, see [Create an instance](how-to-create-amazon-lightsail-instance-virtual-private-server-vps.md).

1. Create a static IP and attach it to your WordPress Multisite instance in Lightsail. For more information, see [Create a static IP and attach it to an instance](lightsail-create-static-ip.md).

1. Add your domain to Lightsail by creating a DNS zone, then point it to the static IP that you attached to your WordPress Multisite instance. For more information, see [Create a DNS zone to manage your domain’s DNS records](lightsail-how-to-create-dns-entry.md).

1. Define the primary domain for your WordPress Multisite instance. For more information, see [Define the primary domain for your WordPress Multisite instance](amazon-lightsail-define-the-primary-domain-for-your-wordpress-multisite.md).

## Add a blog as a domain to your WordPress Multisite instance


Complete these steps to create a blog site on your WordPress Multisite instance that uses a domain which is different than your main blog’s primary domain.

**Important**  
You must complete step 4 listed in the prerequisites section of this guide before following these steps.

1. Sign in to the administration dashboard of your WordPress Multisite instance.
**Note**  
For more information, see [Get the application user name and password for your Bitnami instance](log-in-to-your-bitnami-application-running-on-amazon-lightsail.md).

1. Choose **My Sites**, then **Network Admin**, and **Sites** in the top navigation pane.  
![\[Sites menu in the WordPress administration dashboard.\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/wp-multisite-add-blogs-as-subdomains-sites-menu.png)

1. Choose **Add New** to add a new blog site.

1. Enter a site address into the **Site Address (URL)** text box. This is domain that will be used for the new blog site. For example, if your new blog site will use `example-blog.com` as the domain, then enter `example-blog` into the **Site Address (URL)** text box. Ignore the primary domain suffix displayed on the page.  
![\[Ignore the domain suffix in the WordPress administration dashboard\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/wp-multisite-add-blogs-as-domains-ignore-domain-suffix.png)

1. Enter a site title, select a site language, and enter an admin email.

1. Choose **Add Site**.

1. Choose **Edit Site** in the confirmation banner that appears on the page. This will redirect you to edit the details of the site that you recently created.  
![\[Edit Site page\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/wp-multisite-add-blogs-as-domains-edit-site.png)

1. In the **Edit Site** page, change the subdomain that is listed in the **Site Address (URL)** text box to the apex domain that you want to use. In this example, we specified `http://example-blog.com`.  
![\[Edit site address\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/wp-multisite-add-blogs-as-domains-edit-site-address.png)

1. Choose **Save Changes**.

   At this point, the new blog site has been created in your WordPress Multisite instance, but the domain is not yet configured to route to the new blog site. Continue to the next step to add an address record (A record) to your domain’s DNS zone.  
![\[Sites list in the WordPress administration dashboard.\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/wp-multisite-add-blogs-as-domains-sites-list.png)

## Add an address record (A record) to your domain’s DNS zone


Complete these steps to point the domain for your new blog site to your WordPress Multisite instance. You must perform these steps for every blog site that you create on your WordPress Multisite instance.

For demonstration purposes, we’ll use the Lightsail DNS zone. However, the steps may be similar for other DNS zones typically hosted by domain registrars.

**Important**  
You can create a maximum of six DNS zones in the Lightsail console. If you need more DNS zones, we recommend using Amazon Route 53 to manage your domain’s DNS records. For more information, see [Make Amazon Route 53 the DNS service for an existing domain](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/MigratingDNS.html).

1. Sign in to the [Lightsail console](https://lightsail.aws.amazon.com/).

1. In the left navigation pane, choose **Domains & DNS**.

1. Under the **DNS zones** section of the page, choose the DNS zone for your new blog site’s domain.

1. In the DNS zone editor, choose the **DNS records** tab. Then, choose **Add record**.  
![\[The DNS zone editor in the Lightsail console.\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/wp-multisite-add-blogs-as-domains-dns-zone.png)

1. Choose **A record** in the record type drop-down menu.

1. In the **Record name** text box, enter an “at” (@) symbol to create a record for the root of the domain.

1. In the **Resolves to** text box, choose the static IP address attached to your WordPress Multisite instance.  
![\[Adding an address record to the DNS zone in the Lightsail console.\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/wp-multisite-add-blogs-as-domains-a-record.png)

1. Choose the Save icon.

   After the change propagates through the internet’s DNS, the domain will route traffic to the new blog site on your WordPress Multisite instance.

## Enable cookie support to allow sign in for blog sites


When you add blog sites as domains to your WordPress Multisite instance, you must also update the WordPress configuration (`wp-config`) file on your instance to enable cookie support. If you don't enable cookie support, then users might experience a "Error: Cookies are blocked or not supported" error when trying to sign in to the WordPress administration dashboard of their blog sites.

1. Sign in to the [Lightsail console](https://lightsail.aws.amazon.com/).

1. On the Lightsail home page, choose the SSH quick connect icon for your WordPress Multisite instance.  
![\[SSH quick connect on the Lightsail console.\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/wp-multisite-ssh-quick-connect.png)

1. After your Lightsail browser-based SSH session is connected, enter the following command to open and edit the `wp-config.php` file of your instance using Vim:

   ```
   sudo vim /opt/bitnami/wordpress/wp-config.php
   ```
**Note**  
If this command fails, you might be using an older version of the WordPress Multisite instance. Try running the following command instead.  

   ```
   sudo vim /opt/bitnami/wordpress/wp-config.php
   ```

1. Press **I** to enter insert mode in Vim.

1. Add the following line of text below the `define('WP_ALLOW_MULTISITE', true);` line of text.

   ```
   define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST']);
   ```

   The file will look like the following when done:  
![\[Edit to the wp-config file\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/wp-multisite-add-blogs-as-domains-wp-config-edit.png)

1. Press the **Esc** key to exit insert mode in Vim, then type `:wq!` and press **Enter** to save your edits (write) and quit Vim.

1. Enter the following command to restart the underlying services of the WordPress instance.

   ```
   sudo /opt/bitnami/ctlscript.sh restart
   ```

   Cookies should now be enabled on your WordPress multisite instance, and users who are trying to sign in to their blog sites will not encounter the "Error: Cookies are blocked or not supported" error.

## Next steps


After you add blogs as domains to your WordPress Multisite instance, we recommend that you get familiar with WordPress Multisite administration. For more information see [Multisite Network Administration](https://developer.wordpress.org/advanced-administration/multisite/) in the WordPress documentation.

# Add blogs as subdomains to your WordPress Multisite on Lightsail
WordPress Multisite: Add blogs as subdomains

A WordPress Multisite instance in Amazon Lightsail is designed to use multiple domains, or subdomains, for each blog site that you create within that instance. In this guide, we’ll show you how to add a blog site as a subdomain of your WordPress Multisite instance. For example, if your main blog’s primary domain is `example.com`, you can create new blog sites that use the `earth.example.com` and `moon.example.com` subdomains on the same instance.

**Note**  
You can also add sites using domains to your WordPress Multisite instance. For more information, see [Add blogs as domains to your WordPress Multisite instance ](amazon-lightsail-add-blogs-as-domains-to-your-wordpress-multisite.md).

## Prerequisites


Complete the following prerequisites in the order shown:

1. Create a WordPress Multisite instance. For more information, see [Create an instance](how-to-create-amazon-lightsail-instance-virtual-private-server-vps.md).

1. Create a static IP and attach it to your WordPress Multisite instance. For more information, see [Create a static IP and attach it to an instance](lightsail-create-static-ip.md).

1. Add your domain to Lightsail by creating a DNS zone, then point it to the static IP that you attached to your WordPress Multisite instance. For more information, see [Create a DNS zone to manage your domain’s DNS records](lightsail-how-to-create-dns-entry.md).

1. Define the primary domain for your WordPress Multisite instance. For more information, see [Define the primary domain for your WordPress Multisite instance](amazon-lightsail-define-the-primary-domain-for-your-wordpress-multisite.md).

## Add a blog as a subdomain to your WordPress Multisite instance


Complete these steps to create new blogs on your WordPress Multisite instance that use a subdomain of your main blog’s primary domain.

**Important**  
You must complete step 4 listed in the prerequisites section of this guide before following these steps.

1. Sign in to the administration dashboard of your WordPress Multisite instance.
**Note**  
For more information, see [Get the application user name and password for your Bitnami instance](log-in-to-your-bitnami-application-running-on-amazon-lightsail.md).

1. Choose **My Sites**, then **Network Admin**, and **Sites** in the top navigation pane.  
![\[Sites menu in the WordPress administration dashboard.\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/wp-multisite-add-blogs-as-subdomains-sites-menu.png)

1. Choose **Add New** to add a new blog site.

1. Enter a site address, which is the subdomain that will be used for the new blog site.  
![\[Add new site in the WordPress administration dashboard.\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/wp-multisite-add-blogs-as-subdomains-add-new-site.png)

1. Enter a site title, select a site language, and enter an admin email.

1. Choose **Add Site**.

   At this point, the new blog site has been created in your WordPress Multisite instance, but the subdomain is not yet configured to route to the new blog site. Continue to the next step to add an address record (A record) to your domain’s DNS zone.  
![\[Sites list in the WordPress administration dashboard.\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/wp-multisite-add-blogs-as-subdomains-sites-list.png)

## Add an address record (A record) to your domain’s DNS zone


Complete these steps to point the subdomain for your new blog site to your WordPress Multisite instance. You must perform these steps for every blog site that you create on your WordPress Multisite instance.

For demonstration purposes, we’ll use the Lightsail DNS zone. However, the steps may be similar for other DNS zones typically hosted by domain registrars.

1. Sign in to the [Lightsail console](https://lightsail.aws.amazon.com/).

1. In the left navigation pane, choose **Domains & DNS**.

1. Under the **DNS zones** section of the page, choose the DNS zone for the domain that you defined as the primary domain for your WordPress Multisite instance.

1. In the DNS zone editor, choose the **DNS records** tab. Then, choose **Add record**.  
![\[DNS zone editor in the Lightsail console.\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/wp-multisite-add-blogs-as-subdomains-dns-zone.png)

1. Choose **A record** in the record type drop-down menu.

1. In the **Record name** text box, enter the subdomain specified as the site address when creating the new blog site on your WordPress Multisite instance.

1. In the **Resolves to** text box, choose the static IP address attached to your WordPress Multisite instance.  
![\[Adding an address record to the DNS zone in the Lightsail console.\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/wp-multisite-add-blogs-as-subdomains-a-record.png)

1. Choose the Save icon.

   That is all you need to do. After the change propagates through the internet’s DNS, the domain will redirect to the new blog site on your WordPress Multisite instance.

## Next steps


After you add blogs as subdomains to your WordPress Multisite instance, we recommend that you get familiar with WordPress Multisite administration. For more information see [Multisite Network Administration](https://developer.wordpress.org/advanced-administration/multisite/) in the WordPress documentation.

# Define the primary domain for your WordPress Multisite instance on Lightsail
WordPress Multisite: Define domain

A WordPress Multisite instance in Amazon Lightsail is designed to use multiple domains, or subdomains, for each blog site that you create within that instance. Because of this, you must define the primary domain to use for the main blog of your WordPress Multisite instance.

## Prerequisites


Complete the following prerequisites in the order shown:

1. Create a WordPress Multisite instance in Lightsail. For more information, see [Create an instance](how-to-create-amazon-lightsail-instance-virtual-private-server-vps.md).

1. Create a static IP and attach it to your WordPress Multisite instance in Lightsail. For more information, see [Create a static IP and attach it to an instance](lightsail-create-static-ip.md).
**Important**  
You must reboot your WordPress Multisite instance after you attach a static IP to it. This will allow the instance to recognize the new static IP associated to it.

1. Add your domain to Lightsail by creating a DNS zone, then point it to the static IP that you attached to your WordPress Multisite instance. For more information, see [Create a DNS zone to manage your domain’s DNS records](lightsail-how-to-create-dns-entry.md).

1. Allow time for the DNS changes to propagate through the internet's DNS. Then, you can continue to the [Define the primary domain for your WordPress Multisite instance>](#define-the-primary-domain-for-your-wordpress-multisite) section of this guide.

## Define the primary domain for your WordPress Multisite instance


Complete these steps to ensure that your domain, such as `example.com`, redirects to the main blog of your WordPress Multisite instance.

1. Sign in to the [Lightsail console](https://lightsail.aws.amazon.com/).

1. In the left navigation pane, choose the SSH quick connect icon for your WordPress Multisite instance.  
![\[SSH quick connect on the Lightsail console.\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/wp-multisite-ssh-quick-connect.png)

1. Enter the following command to define the primary domain name for your WordPress Multisite instance. Be sure to replace `<domain>` with the correct domain name for your WordPress Multisite.

   ```
   sudo /opt/bitnami/configure_app_domain --domain <domain>
   ```

   Example:

   ```
   sudo /opt/bitnami/configure_app_domain --domain example.com
   ```
**Note**  
If this command fails, you might be using an older version of the WordPress Multisite instance. Try running the following commands instead, and be sure to replace `<domain>` with the correct domain name for your WordPress Multisite.  

   ```
   cd /opt/bitnami/apps/wordpress
   sudo ./bnconfig --machine_hostname <domain>
   ```
After running that command, enter the following command to keep the bnconfig tool from automatically running every time the server restarts.  

   ```
   sudo mv bnconfig bnconfig.disabled
   ```

   At this point, browsing to the domain that you defined should redirect you to the main blog of your WordPress Multisite instance.

## Next steps


Complete the next steps after you have defined the primary domain for your WordPress Multisite instance:
+ [Add blogs as subdomains to your WordPress Multisite instance](amazon-lightsail-add-blogs-as-subdomains-to-your-wordpress-multisite.md)
+ [Add blogs as domains to your WordPress Multisite instance](amazon-lightsail-add-blogs-as-domains-to-your-wordpress-multisite.md)

Follow the step-by-step instructions to learn how to add new blog sites using separate domains or subdomains, and how to define the primary domain for your main blog on the WordPress Multisite instance.

The guide covers prerequisites such as creating a WordPress Multisite instance, attaching a static IP, creating a DNS zone, and configuring the primary domain. It then provides detailed steps for adding blogs as domains or subdomains, updating DNS records, enabling cookie support, and performing other necessary configurations. By following this guide, you can effectively manage and organize multiple blogs within your WordPress Multisite instance, leveraging the flexibility of using separate domains or subdomains for each blog site.