Trying to switch from an old domain to a new one

April 28, 2016 533 views
DNS Nginx Applications CentOS

We recently moved over to a new website hosted on Shopify. The old url that we used www.divaboutiqueonline.com has been transferred over to be used with Shopify. We recently purchased a new domain from GoDaddy www.divamfcarchive.com to be used to access the old site for record keeping. We have been trying to set up the new domain in the nginx server but to no avail. Our website was made by a 3rd party who we can no longer contact. I contacted DigitalOcean and got as far as I could. We found the server file in conf.d in /../etc/nginx/conf.d/divaboutiqueonline. The server information was changed but the website divamfcarchive.com is still giving a 503 error. Below I will post all the steps and the server file I went through. I would greatly appreciate any and all help:

[root@divaboutiqueonline ~]# ls -a
. .cshrc .pki
.. divaboutiqueonline.com_new.crt .rnd
anaconda-ks.cfg .gnupg .ssh
.bash_history install.log .tcshrc
.bash_logout install.log.syslog virtualmin-install.log
.bash_profile install.sh
.bashrc .mc
[root@divaboutiqueonline ~]# cd ..
[root@divaboutiqueonline /]# ls
aquota.group bin dev home lib64 media opt root selinux sys usr
aquota.user boot etc lib lost+found mnt proc sbin srv tmp var
[root@divaboutiqueonline /]# cd etc/
[root@divaboutiqueonline etc]# ls
adjtime inittab quotatab
aliases inputrc rc
aliases.db iproute2 rc0.d
alternatives iscsi rc1.d
anacrontab issue rc2.d
audisp issue.net rc3.d
audit jwhois.conf rc4.d
awstats krb5.conf rc5.d
bash_completion.d ld.so.cache rc6.d
bashrc ld.so.conf rc.d
blacklist.dat ld.so.conf.d rc.digitalocean
blkid libaudit.conf rc.local
centos-release libuser.conf rc.sysinit
chkconfig.d localtime redhat-release
clamd.conf login.defs resolv.conf
clamd.d logrotate.conf rpc
cron.d logrotate.d rpm
cron.daily lvm rsyslog.conf
cron.deny lynx.cfg rsyslog.d
cron.hourly lynx.lss rwtab
cron.monthly lynx-site.cfg rwtab.d
crontab magic sasl2
cron.weekly mailcap scponly
crypttab makedev.d securetty
csh.cshrc mc security
csh.login mime.types selinux
dbus-1 mke2fs.conf services
default modprobe.d sestatus.conf
depmod.d motd shadow
dhcp mtab shadow-
dhparams.pem multipath shells
digitalocean my.cnf skel
DIR_COLORS nanorc snmp
DIR_COLORS.256color NetworkManager ssh
DIR_COLORS.lightbgcolor networks ssl
dracut.conf nginx statetab
dracut.conf.d nsswitch.conf statetab.d
environment odbc.ini subversion
ethers odbcinst.ini sudo.conf
exports openldap sudoers
favicon.png opt sudoers.d
filesystems pam.d sudo-ldap.conf
freshclam.conf passwd sysconfig
fstab passwd- sysctl.conf
ftpusers pear system-release
gai.conf pear.conf system-release-cpe
gcrypt php.d terminfo
GeoIP.conf php-fpm.conf udev
GeoIP.conf.default php-fpm.d updatedb.conf
gnupg php.ini usermin
group pkcs11 virc
group- pki virtualmin-license
grub.conf plymouth vsftpd
gshadow pm warnquota.conf
gshadow- popt.d webmin
host.conf postfix wgetrc
hostname ppp X11
hosts printcap xdg
hosts.allow profile xinetd.d
hosts.deny profile.d yum
httpd proftpd.conf yum.conf
init protocols yum.repos.d
init.d quotagrpadmins
[root@divaboutiqueonline etc]# cd nginx/
[root@divaboutiqueonline nginx]# ls
conf.d koi-utf mime.types scgi_params uwsgi_params
fastcgi_params koi-win nginx.conf ssl win-utf
[root@divaboutiqueonline nginx]# cd conf.d/
[root@divaboutiqueonline conf.d]# ls
dev.divaboutiqueonline.com divaboutiqueonline.com-backup
[root@divaboutiqueonline conf.d]# 

This is the current content of the conf.d file:

server {
server_name www.divamfcarchive.com ;
rewrite ^(.*)$ http://divamfcarchive.com $1 permanent;
server {
server_name divamfcarchive.com;

ssl on;
ssl_certificate /etc/nginx/ssl/divamfcarchive.com_new.crt;
ssl_certificate_key /etc/nginx/ssl/divamfcarchive.com.key;

root /home/divaboutiq/public_html;
index index.html index.htm index.php;

access_log /var/log/virtualmin/divamfcarchive.com_access_log;
error_log /var/log/virtualmin/divamfcarchive.com_error_log;
if ($request_method !~ ^(GET|HEAD|POST)$) { return 403; }
location ~ /\. { deny all; access_log off; log_not_found off; expires 3$
location ~ \/favicon.ico { access_log off; log_not_found off; expires 1$
location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt)$ { expires 14d; }
location / {
try_files $uri $uri/ /index.php?$args;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME /home/divaboutiq/public_html$fastcgi_scri$
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT /home/divaboutiq/public_html;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param HTTPS $https;
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/php-nginx/14181346709859.sock/socket;
  • This is a fairly in-depth issue. If you agree to allow me access (no cost), and further agree not to hold me liable for any issues that arise after I've helped out, I'm willing to set it up for you.

    e-mail me at jon at my website (found in my profile)

  • Hey Jon, I sent you an email via my iCloud email. Let me know if you received it.

  • Not yet, but until I do, go ahead and run this:

    nginx -t -c /etc/nginx/nginx.conf

    This should tell us where the issue is.

  • Sure, I'll try to message you again via email its jon @ your website .com right?

    [root@divaboutiqueonline ~]# nginx -t -c /etc/nginx/nginx.conf
    nginx: [emerg] BIO_new_file("/etc/nginx/ssl/divaboutiqueonline_new.crt") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/nginx/ssl/divaboutiqueonline_new.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
    nginx: configuration file /etc/nginx/nginx.conf test failed
    [root@divaboutiqueonline ~]# 
  • Correct. jon@MY_USERNAME.com

    Looks like they don't have your certificate where they think they do.

    Run this:
    ls -lah /etc/nginx/ssl/

  • All right, I sent another email to you. My name is Ricky so you should look for an email under that name. Ran the command:

    [root@divaboutiqueonline ~]# ls -lah /etc/nginx/ssl/
    total 32K
    drwxr-xr-x 2 root root 4.0K Nov 18 11:18 .
    drwxr-xr-x 4 root root 4.0K Dec  9  2014 ..
    -rw-r--r-- 1 root root 6.6K Dec  5  2014 divaboutiqueonline.com.crt
    -rw-r--r-- 1 root root 1.1K Nov 12  2014 divaboutiqueonline.com.csr
    -rw-r--r-- 1 root root 1.7K Nov 12  2014 divaboutiqueonline.com.key
    -rw-r--r-- 1 root root 6.6K Nov 18 11:18 divaboutiqueonline.com_new.crt
    [root@divaboutiqueonline ~]# 
1 Answer


I just wanted to make sure that I understood the situation correctly -- divaboutiqueonline.com was hosted on a Droplet, and, after you moved it to Shopify, you want to point divamfcarchive.com to the old site that is hosted on the Droplet?

It looks like your Droplet is running Virtualmin. Do you happen to have the credentials for the Virtualmin control panel? If so, try logging into https://divamfcarchive.com:10000/ and browsing to Server Configuration -> Change Domain name. Then, try to find the divaboutiqueonline.com virtual server/site and renaming it to the new domain.

If not, try using your root SSH login credentials. If that does not work either, SSH in as root and run the following command to reset the password:

/usr/libexec/webmin/changepass.pl /etc/webmin root password
Have another answer? Share your knowledge.