Support » Installing WordPress » Local PC Development of Separate Domains

  • I want to set up my Debian OS to be able to design a few different web sites that I plan to publish to completely separate domains (e.g. site1.com, site2.net, site3.org, and site4.co.uk), all of which are hosted on site1.com as what cpanel describes as “addon domains”.

    I’ve successfully installed apache2, php7.4, and mariadb-server. I’ve also installed wordpress, and can access the WordPress control panel.

    I’ve also edited /var/www/html/wordpress/wp-config.php to add the line “define(‘WP_ALLOW_MULTISITE’, true);”.

    I’m new to wordpress, and I’m a bit confused as to whether this plan would be covered by going to setting WordPress > Tools > Network Setup.

    When I do I get the message: “Because you are using localhost, the sites in your WordPress network must use sub-directories. Consider using localhost.localdomain if you wish to use sub-domains.”

    Am I right in thinking that I actually want to set up WordPress to use subdomains? To this newbie it seems a bit counterintuitive, since I actually want separate domains altogether.

    Have I gone wrong somewhere?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter jackdoors

    (@jackdoors)

    (e.g. site1.com, site2.net, site3.org, and site4.co.uk), all of which are hosted on site1.com as what cpanel describes as “addon domains”.

    …that is, all except site1.com, which would be the root domain of my account.

    • This reply was modified 3 months, 1 week ago by jackdoors.

    We now need to tell Windows that the domain ‘testsite1’ is hosted locally, i.e. not … because I had the same errors and I am now developing multiple sites locally.
    https://takesurveyz.onl/www-dressbarnfeedback-com/

    Go to the httpd.conf file and add the setup for each individual subdomain for localhost:

    
    NameVirtualHost 123.4.5.6:80
    <VirtualHost 123.4.5.6:80>
    ServerName localhost
         ServerAlias site1.localhost
         DocumentRoot "..\htdocs\wordpress\site1"
         DirectoryIndex index.php index.html index.html index.htm index.shtml
    </VirtualHost>
    

    Now on to the error message. Basically, WordPress sees “localhost” and assumes you’re testing locally and won’t set up subdomains. My recommendation would be to use a different host and set up your system to act appropriately (Basically, localhost can’t have subdomains unless you set up in a specific way to begin with).

    So instead, use site1.local, site2.local, blog.local and so on. Then change your host file and httpd.conf file the same (substitute local everywhere you used localhost).

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.