PHP website on Linux - server DNS address could not be found.

I am creating a test environment of a website.  I copied what was in production and made modifications for the test environment.  I performed the following steps.

1.  On the server where the production website exists created directory test.mysite.com (example).
2.  Copied files from prod.mysite.com to test.mysite.com after making changes (e.g. dbase connections to point to test dbase instead of prod).
3.  edit apache2.conf file to include the test.mysite.com (example below).
<VirtualHost *:80>
        Header set Access-Control-Allow-Origin "*"
        DocumentRoot "/home/webserver/www/apitest.mysite.com"
        ServerName apitest.mysite.com
        <Directory "/home/webserver/www/apitest.mysite.com">
                Require all granted
        </Directory>
</VirtualHost>
<VirtualHost *:80>
        DocumentRoot "/home/webserver/www/test.mysite.com"
        ServerName test.mysite.com
        <Directory "/home/webserver/www/test.mysite.com">
                Require all granted
        </Directory>
</VirtualHost>

Open in new window


I also made sure that the file permissions for each folder matched the production permissions.

When I type URL test.mysite.com I receive server DNS address could not be found.
LVL 2
CipherISAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jan SpringerCommented:
did you add a DNS record for test?
0
arnoldCommented:
Does nslookup test.mysite.com return an IP address?
If not, that is the issue.
If you do not want to update DNS records for testing, you can define the record on your local machine by adding it in /etc/hosts on Linux/Unix systems or in c:\windows\system32\drivers\etc\hosts (elevated editor required to open/edit)
Ip_address test.mysite.com

In this situation, the browser will get the information From the local file......
0
Jan SpringerCommented:
Adding it to /etc/hosts only works if you are local to the machine.

For it to work and test properly, add a DNS entry.
0
Webinar: Miercom Evaluates Wi-Fi Security

It's not just about Wi-Fi connectivity anymore. A wireless security breach can cost your business large amounts of time, trouble, and expense. Plus, hear first-hand from Miercom how WatchGuard's Wi-Fi security stacks up against the competition in our upcoming webinar!

CipherISAuthor Commented:
How do I add a DNS entry on the linux server?
0
Jan SpringerCommented:
You add it to the zone for that domain.

Find out the registrar for your domain name and log in to the portal to add the record.

      dig soa mysite.com

substituting "mysite.com" with your real domain name on a linux machine (assuming that you have bind-utils installed).
0
CipherISAuthor Commented:
So I need to go to the registrar for domain name?

I did the following.  I found the host file (in etc directory) and added the last two entries.  Below is an example.  There are other sites with the 123.0.1.1 IP (as an example).

123.0.1.1       apiprod.mysite.com #Existed
123.0.1.1       prod.mysite.com      #Existed

123.0.1.1       apitest.mysite.com  #Added
123.0.1.1       test.mysite.com       #Added

Open in new window

0
CipherISAuthor Commented:
Below is what I receive when I try to access the webpage.
This site can’t be reached

test.mysite.com’s server DNS address could not be found.
Try running Windows Network Diagnostics.
DNS_PROBE_FINISHED_NXDOMAIN

Open in new window

0
Jan SpringerCommented:
Right.  Add a record in DNS -- not the hosts file.
0
CipherISAuthor Commented:
@arnold when I open a command prompt and type

nslookup  test.mysite.com

I receive below

Server:  Unknown
Address:  10.x.x.x

*** UnKnown can't find test.mysite.com:  Non-existent domain

when I type below

nslookup prod.mysite.com

I don't receive the error.  It provides me with the IP address.
0
CipherISAuthor Commented:
@Jan.  That is the below step?
You add it to the zone for that domain.

Find out the registrar for your domain name and log in to the portal to add the record.

      dig soa mysite.com

substituting "mysite.com" with your real domain name on a linux machine (assuming that you have bind-utils installed). 

Open in new window

If so, I will need to find the registrar.
0
Jan SpringerCommented:
The registrar will identify the name servers.  

Those name servers may belong to the registrar.  If they do, then make your changes there.

They may point to different servers.  If so, then that's where you make your changes.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CipherISAuthor Commented:
Ugh.  Was hoping this would be easy.
0
Jan SpringerCommented:
Would you like to message me the domain name and I'll tell you what you need to know?
0
arnoldCommented:
If you are testing, follow the suggestion of adding
IP test.mysite.com
to the etc/hosts file applicable to your system and be done with it.

You can achieve the same on your local home machine if necessary.




use mxtoolbox.net or bettetwhois.com
enter your domain. there you will see the domain name servers responsible for your domain as well as the registrar through whom it is registered.  You would need to access that refistrar if you are using their name server and update the records in DNS adding test.mysite.com with an IP where the site is.
If you have a hosted proivder that is different from the registrar, you would usually either have a console to manage the domain's name server records, or would need to email them requesting that they add a record for test.mysite.com pointed to an IP.......

As Jan mentioned. to direct you explicitly on what you need to do, we need to know the domain name in question in order to direct you to the correct destination to get what you need.
0
CipherISAuthor Commented:
I did enter test.mysite.com in etc/hosts and I am still receiving the error.
0
arnoldCommented:
Hopefully you realize that your response are not providing information. I have no access to what is going on in your system nor what you see.

What is the error you get is it that it can not reach the server or the server does not respond or unable to process the request.
Look at the Apache logs.

is the IP 123.0.0.1 supposed to represent a public IP or an internal IP?
If you use http://123.0.0.1 in your example what do you see?
telnet 123.0.0.1 80
HEAD http://test.mysite.com HTTP/1.1
REferer:
host:

Make sure if you run firewalld or iptables as the local sever firewall that you allow port 80 access.
0
tliottaCommented:
I did enter test.mysite.com in etc/hosts...
What "etc/hosts" did you enter it into?
...and I am still receiving the error.
Where are you seeing the error?

Where is "test.mysite.com" in relation to where you receive the error? And where is "prod.mysite.com"? I see virtual hosts referenced, but where? All on the same hardware? In VMs? Other?

The networking relationships between all of the 'systems' that you seem to be referencing are very unclear. It's impossible to know what should be happening without a description of your environment.
0
CipherISAuthor Commented:
What etc/hosts did you enter into
I believe it was on the etc directory and the hosts file is there

Where are you seeing the error
I was seeing the error in the browser when I would type test.mysite.com
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.