Just setup WordPress on my droplet server, now my site is down, please help?

November 1, 2017 346 views
WordPress Server Optimization PHP Configuration Management

Hi there everyone, I connected to my droplet server via SSH and followed all the steps in this guide:
https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-lamp-on-ubuntu-16-04

Everything worked great, and I was completely successful in my attempt. I entered my site URL in google chrome and got the wordpress select-a-language setup, exactly as shown in the guide.

I then shut down my PC and went to bed. When I woke up, I tried entering my site URL from a different computer to finish the wordpress setup and suddenly my site was down. I got the following error: "This site can’t be reached
cultureontrial.com’s server DNS address could not be found.
Try running Windows Network Diagnostics.
DNSPROBEFINISHED_NXDOMAIN"

I did absolutely nothing at all between that timeframe, didn't touch my server, didn't even use Putty or the droplet in any way. I tried again a few days later from the PC I did the setup on and still the site was down.

I tried following Step 5 in the guide over again, ran "curl -s https://api.wordpress.org/secret-key/1.1/salt/" and got new secure values. Copied and pasted them into the wp-config.php file exactly as I did last time, and still nothing.

If anyone can please help on this let me know. It would be really deeply appreciated as I'm getting quite frustrated by this!

10 Answers
alexstine November 8, 2017
Accepted Answer

Hello,

Please change this line.

#ServerName www.example.com

Then you should add your domain in instead.

ServerName www.example.com

Notice in my second example the "#" sign is also removed. That is important to ensure the line is not commented out. After you make the edit, restart Apache.

service apache2 restart

Hope this gets things working. Thanks.

  • That's a very simple fix, sorry I didn't realize that! I tried changing the file however and got the following error:

    Error writing 000-default.conf: permission denied

    I tried giving myself permissions to write the file using chmod but ran into errors as well:

    aaron@ubuntu-1gb-nyc3-01:/etc/apache2/sites-available$ chmod 660 /etc/apache2/sites-available
    chmod: changing permissions of '/etc/apache2/sites-available': Operation not permitted

  • sorry nevermind, I switched users to root and it worked fine from there. Thanks so much for your help!

UPDATE: I tried going through the steps in the guide again and got it (kind of) working, when I enter my server IP address I can access the wordpress setup just fine (just as i did before) but when I enter the url cultureontrial.com i still get the page not found error. When I first followed this guide I got the wordpress setup when I entered the domain.

Hello,

Please add these define statements to wp-config.php.

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

Replace http://example.com with your domain name. Hope it helps, thanks.

  • Unfortunately, before you posted this answer, I went into WordPress Dashboard --> General Settings and saw the fields "WordPress Address" and "Site Address" were filled with my IP address "http://104.236.88.248". I replaced both fields with "cultureontrial.com" which apparently seems to have locked me out of my site.

    Now the URL cultureontrial.com won't work, I cannot access the login page from there, and the only login page that works, http://104.236.88.248/wp-login.php, redirects me to an error page every time i attempt to login. Also, when I enter http://104.236.88.248 my theme is deprecated, which it wasn't before I made the change on the General Settings page.

    Is there any way I can regain access to the backend of my site and change the General Settings page back to the way it was?? Please help! I will make a question about this later.

    • Hello,

      Please add these statements to wp-config.php. These will override what you set in WP Admin --> Settings --> General.

      define('WP_HOME','http://example.com');
      define('WP_SITEURL','http://example.com');
      

      The format should be http://YOUR_DOMAIN_HERE.com, that is probably what went wrong when you entered just your domain in those fields. After saving wp-config.php you should be able to access your site again.

      Let me know if it helps, thanks.

Hello,

Could you please paste your wp-config.php here so I can have a look? Go ahead and star * out the DB information and other security information so it's not public here on the forums.

We'll figure it out. Thanks.

  • Hi there, according to someone else I messaged about this they can see my site just fine, and even access the wp-login page!! Here is my php file in full:

    "<?php

    define('DB_NAME', 'wordpress');

    define('DB_USER', 'username');

    define('DB_PASSWORD', 'password');

    define('DB_HOST', 'localhost');

    define('DB_CHARSET', 'utf8');

    define('DB_COLLATE', '');

    define('FS_METHOD', 'direct');

    define('WP_HOME','http://cultureontrial.com');

    define('WP_SITEURL','http://cultureontrial.com');

    define('AUTHKEY', 'HkGqbj]fzyMlqO||<P2e-[lXd0y}? +ZS}dR/VC#q-VV|eRr<HoOi{,SrK5A[GYn');
    define('SECUREAUTHKEY', 'u,$6T]]XEKhhf]/eHt,<ZRrylcSR4;/mP^q2F,ejNy$JyPJ+gX0y6jbU8_HR');
    define('LOGGED_IN_KEY', 'h8Q|k7YdT7Gn04.O7,OQF$Z:=3<P;+P&9:;JxwNL5H7yb]t-YQX<A0Q4EKNXb@!F');
    define('NONCE_KEY', 'G]&J;6|9zx5>s!rgCab91c$+#Q58){mg|5fUxiYwG{GY}-K3k3a|:6?+BHeD =K5');
    define('AUTHSALT', '=VVWuT]4}&+t$Nr*aD>|Ls6<.#A1xa00$WrFtiRT20lY2=?zB)Bg)I;4/+cAgKF');
    define('SECUREAUTHSALT', 'x-w}I/OrFw||Eg[ozZP)F5g:|@On+6?=Px,.<gj#xDw}<r0]#/ka@I]@h]nK');
    define('LOGGED_IN_SALT', 'eNRrl=u/8=-|:w}tzetx[P.j|OSJs9J?K~?Yt};/N7vO:a;O@<&#b!7>|3Qq`zm');
    define('NONCESALT', '((O {.Vds8g$H,4$t+7mpg4)X5.KKNs-<ETwK<qZ3-o>+oFcH eIJ0}3:tj*-');

    $tableprefix = 'wp';

    define('WP_DEBUG', false);

    if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(FILE) . '/');

    require_once(ABSPATH . 'wp-settings.php');"

    When I attempt to access cultureontrial.com from my computer it says "This site can’t be reached

    cultureontrial.com’s server DNS address could not be found."

    I can access the site through 104.236.88.248, and I can access 104.236.88.248/wp-login, but when I attempt to login I get redirected to an error page. cultureontrial.com/wp-login doesn't work for me either.

    Can you let me know if you can see those webpages? According to someone else they are working on their computer.

    thank you

Hello,

I cannot access your domain at all. This looks to be a DNS issue. Could you please verify your records? When I ping your domain, it does not come back with an IP address. I can also help you further if you post your DNS records configuration here.

dell@alexstine1 ~
$ ping cultureontrial.com
Ping request could not find host cultureontrial.com. Please check the name and try again.

Could you also cat your .htaccess file and /etc/apache/sites-available/site.com.conf file? I'd like to see those configurations as well.

Thanks.

  • thank you, I'm running apache2, I entered "ls /etc/apache2/sites-available" but that file directory only has the following three files listed:

    000-default.conf
    000-default-le-ssl.conf
    default-ssl.conf

You can cat "000-default.conf". Also have you checked your DNS records setup?

Thanks.

  • Hey there! This is what the 000-default.conf file looks like:

    <VirtualHost *:80>
    # The ServerName directive sets the request scheme, hostname and port th at
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
    
        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn
    
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
    
        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
    

    RewriteEngine on
    RewriteCond %{SERVERNAME} =cultureontrial.com
    RewriteRule ^ https://%{SERVER
    NAME}%{REQUEST_URI} [END,NE,R=permanent]
    </VirtualHost>

    vim: syntax=apache ts=4 sw=4 sts=4 sr noet

    I have the nameservers for digital ocean in google domains (see here) and I also have the DNS records set up in digital ocean (here). They were set up this way before I set up wordpress and before wordpress, my URL site redirected to a blank apache page, so I assume they were set up correctly.

You're welcome. Glad I could help.

  • Sorry, I must have spoken too soon. I was able to edit the 000-default.conf file as you mentioned but my website still remains inaccessible as it was before. I noticed when I open 000-default-le-ssl.conf it also contains the line "#ServerName www.example.com". Do I need to change that line as well?

    best wishes

Hello,

Sorry, I'm not to familiar with Apache. I did some research and this should get things working. In 000-default.conf, replace ServerName with the following.

ServerName example.com
ServerAlias www.example.com

Then restart Apache.

service apache2 restart

Hopefully this will get things working for you.

https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts

by Justin Ellingwood
The Apache web server is the most popular way to serve web content on the internet. Apache has the ability to serve multiple domains from a single server by using a mechanism called "virtual hosts". If a virtual host is configured correctly for each domain, the web server can correctly route traffic to the appropriate files based on the domain name requested. In this guide, we'll demonstrate how to configure Apache virtual hosts on an Ubuntu 14.04 VPS.

unfortunately it did not work still, but thank you so much for your efforts. if you have any other suggestions i'd be willing to try them.

Have another answer? Share your knowledge.