Report this

What is the reason for this report?

looking for the location of $domain variable in the default vhost file in a Marketplace Wordpress setup

Posted on December 1, 2019

Hi I’m trying to find where the value for $domain is stored on a Marketplace wordpress install

during installation it asks for you domain and a few other things and then it updates files

The /etc/apache2/sites-available/000-default.conf file is below

UseCanonicalName On

<VirtualHost *:80> ServerAdmin webmaster@localhost

    ServerName $domain
    ServerAlias www.$domain

    DocumentRoot /var/www/html

    <Directory /var/www/html/>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

I’m tryng to find where the value $domain is stored I checked the only spot I know of /etc/apache2/conf-available/fqdn.conf and it’s not there

I know I could directly change that value ServerName [NEW-DOMAIN-NAME] but would like to know where that variable is being stored in case it affects other things.

also side question where is the value for ${APACHE_LOG_DIR} stored at.

Thanks



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

I’ve just gone through the initial setup script for the Marketplace Wordpress Droplet and it looks like that the only place where the $domain is specified is in the /etc/apache2/sites-enabled/000-default.conf file.

You could take a look at the setup script as well, to do so just create a new Wordpress Droplet from the Marketplace, then SSH to the droplet, press CTRL+C to exit the setup screen and with your favorite text editor open this file here:

/opt/digitalocean/wp_setup.sh

Hope that this helps! Regards, Bobby

Hi,

Same here! I would like to know where $domain is stored because I change my wordpress url and $_SERVER[‘SERVER_NAME’] still has the old url so I have some bad redirect (like /wp-admin).

I know I could directly change that value but I prefer to know where $domain is store to change it. You didn’t answer that question… and can’t find it.

Update : Found a solution! In site-available the conf file is using $domain but in site-enabled the conf file contains the url that I could modify.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.