Link to home
Start Free TrialLog in
Avatar of shawn857
shawn857

asked on

How to point my domain name to my EasyPHP web files directory...

Hello Experts, I've rented a cheap Windows VPS and installed EasyPHP on it. I'm a complete newbie at EasyPHP but it was actually pretty easy to set up and I managed to create and test the PHP script I want to eventually run live. I've got this PHP file and all my website files in the C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb folder on my VPS... my last task is - how do I configure an existing domain name of mine to "point" to this folder?

Thanks!
    Shawn
Avatar of arnold
arnold
Flag of United States of America image

You alter the www record within the DNS zone of your domain with your registrar pointing to the Ip of your VPS.

Test first. from a workstation outside the VPS
c:\windows\system32\drivers\etc\hosts or /etc/hosts (linux/unix system)
add the IP of your your vps

x.x.x.x www.yourdomain.com

Note you have to run notepad as administrator before opening and being able to save the file in that location.
use a web browser to go to http://www.yourdomain.com and see if that works. Presumably you have a way to identify the difference between the sites.
Avatar of shawn857
shawn857

ASKER

Sorry Arnold, I'm pretty green at this stuff... I'll need some more guidance on this.

"You alter the www record within the DNS zone of your domain with your registrar pointing to the Ip of your VPS."

>> I'm not sure what you mean by "DNS Zone". Is that something with my domain's registrar, or something that I change on my VPS? I've attached a screenshot of the various options available at my domain registrar. Can you tell me which one I need to change? Under "Change Nameservers" I had already set it to my VPS's DNS servers (ex. ns4.chicagovps.net) a few days ago, but that didn't seem to do any good.


"Test first. from a workstation outside the VPS
c:\windows\system32\drivers\etc\hosts or /etc/hosts (linux/unix system)
add the IP of your your vps

x.x.x.x www.yourdomain.com"

OK, I think I did this part right. I found the "hosts" file in the directory you stated on my VPS and added this line at the bottom:

192.3.3.155  www.optimaloption.net

Thanks!
   Shawn
RegistrarScreen.JPG
The test has to be done on a workstation to test your web setup not on the VPS.
People visiting your site will not be doing that from the VPS.

To test access as mydomain.com add its entry on your workstation as well.

Provided the two sets to cover the possible available systems to users.

If you, using a system other than the VPS having the alteration referenced to the hosts file, browse the site and are satisfied that it works as intended, go to edit DNS records
There you should see
mydomain.com. IN A x.x.x.x
or
@ IN A x.x.x
@ is synonymous as mydomain.com.

The other entry could either be
www IN A x.x.x.x
or
www IN CNAME @

The two records deals with accessing your site as www.mydomain.com and mydomain.com
My Suggestion,  is to comment out if possible, or add orig. to the existing records while adding the new ones (Make sure to initially use low values for TTL).
This will provide you with a simple way to transition back if needed.
Phew, I didn't follow too much of that. Hard to follow your lingo. Can you please dumb it down a bit?

"The test has to be done on a workstation to test your web setup not on the VPS. "

>> What do you mean by a "workstation"? You mean just my normal I'm computer from where I am here in Canada. My VPS is in the USA. Also, what "test" do you mean?

"To test access as mydomain.com add its entry on your workstation as well."

>> I didn't follow this.


"Provided the two sets to cover the possible available systems to users."

>> I don't understand what you mean by this either  :-(


"If you, using a system other than the VPS having the alteration referenced to the hosts file, browse the site and are satisfied that it works as intended, go to edit DNS records
There you should see
mydomain.com. IN A x.x.x.x
or
@ IN A x.x.x
@ is synonymous as mydomain.com."

>> Where do I edit these DNS records? On my domain registrar, or on my VPS??


"My Suggestion,  is to comment out if possible, or add orig. to the existing records while adding the new ones (Make sure to initially use low values for TTL)."

>> Don't understand this at all. What do you mean by "orig." and "TTL" ?


Thanks for your efforts, but I'm going to need something more "step-by-step". I'm having a very hard time following you.

Thanks
   Shawn
Ok,
Before making any changes, you need to make sure that your VPS setup is setup correctly and functions as intended when accessed from external locations.
Step 1 involves using a workstation that is not the VPS. Modify the hosts file on the workstation to bypass the external public record.
in the hosts file \
x.x.x.x optimaloption.net
x.x.x.x www.optimaloption.net

Right now it points to 192.3.3.155 is this the IP of your VPS (from the VPS browse to whatismyip.com)
Replace the x.x.x.x in the above example within the hosts file on a workstation with the IP displayed in the whatismyip.com

Verify that your site works as intended.
Once You are satisfied that it functions as you intended. (you can make the change to the workstation's hosts file removing the entries added early in step 1.

Step 2) To make the VPS the destination for visitors to your domain, you need to make the change public.
This is done via the edit DNS records  in the image you posted.
a) make sure to retain the current information there just in the event you need to change it back.
The suggestion with orig.optimaloption.net and orig.optimaloption.net is to preserve the record for a faster transition back if needed.
Look in the A and CNAME records  You are looking for two entries they either have optimaloption.net. or @ (@ represents the name of the domain where it is seen) representing the browser access to the site without the need to include the www in the browser
The second will be www CNAME/ALIAS pointing to optimaloption.net. or to @.
TTL is a time setting how long this record is valid before it needs to be refreshed, it could take as long as four hours for your changes to appear to those who previously accessed your site. Lowering this value while making the changes will reduce the transition if needed.
Hopefully this makes things clearer.
I just don't understand what you mean by "workstation". You mean just my regular computer here that I use?? If so, I don't understand how changing any setting on my computer here can affect my VPS or my optimaloption.net domain name. I just don't get it.

Shawn
Yes in the first step you need to use any system available to you that is not the VPS to confirm that your VPS Hosted site is setup correctly and functions.

Without making the change, your requests using your domain will not go to the VPS but will go to where it is currently.  An equivalent comparison a friend of yours lives at 123 some street, sometown.
The person is relocating and would like your opinion. The new address is 234 someother street, anothertown.
The entries in the hosts file are the new address so that when you drive to see your friends place you end up in the new location versus going back to the place where the person currently reside.

The same is the change in step one which will take you as the user when requesting www.optimaloption.net to the new location on the VPS versus where it is now.

If you are comfortable and do not see a need to verify/confirm that the VPS setup works, skip step 1 and just make the changes outlined in step 2 modifying the DNS record pointing the domain(optimaloption.net or @) record to the VPS IP.
OK, I made the change to my "hosts" file here on my computer. Here's what it looks like now:

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost
192.3.3.155     optimaloption.net
192.3.3.155     www.optimaloption.net

Open in new window


I'm not sure what you want me to do when you say "Verify that your site works as intended". You mean just try and call it up on a browser from my regular computer here?? Well, I tried to call up www.optimaloption.net and nothing comes up... it just says "Problem loading page" and "The connection has timed out".

Thanks
   Shawn
Is 192.3.3.155 the IP of YOUR VPS?
If it is, your domain is already pointing to it.
First you need to make sure under advanced windows firewall settings, you allow port 80 TCP /Web traffic through the firewall
Within the configuration of the EasyPHP/IIS you need to set the root folder/document root pointing to where the files are.
Did you follow the guide to set it up?

http://www.easyphp.org/support/
Yep, 192.3.3.155 is the IP of my VPS. I've been running EasyPHP on it for a few weeks now to develop my PHP script and now that I have it working right, I want to make it live and have my domain point to it.

So my domain is already pointing to the VPS?? Could that be because at my domain's registrar, I have the Nameservers set to ns4.chicagovps.net. ns5.chicagovps.net, etc ?

You also wrote:

"First you need to make sure under advanced windows firewall settings, you allow port 80 TCP /Web traffic through the firewall"

>> Is this on the VPS or on my regular computer here?

"Within the configuration of the EasyPHP/IIS you need to set the root folder/document root pointing to where the files are. "

>> How do I do this?

Thanks
   Shawn
There are two sets of information: With the registrar through whom the domain is registered the NAME servers listed on the registrarion reflect who needs to be asked to locate the information. At this time, your optimaloption.net and www.optimaloption.net already point to the 192.3.3.155 IP address, your VPS.

The choice is yours whether using the existing registrar you manage your Domains DNS records to the VPS host.
Make sure they have all the services configured that you need and want for your domain before making changes to the name servers reflected on the registration record.  If you do not, they may point the Mail handling along with anything else to where they think it should go without regard where you want it to go.  i.e. your current email is handled by provider.

Your VPS however is not accepting external connections on that IP/port 80.
Check the firewall settings on the VPS to make sure it allows port 80 traffic through.  Double check the VPS to make sure there is easyphp(apache) bound to port 80
netstat -an | find ":80"
*sigh*... lots of things I couldn't follow there.

You wrote:

"There are two sets of information: With the registrar through whom the domain is registered the NAME servers listed on the registrarion reflect who needs to be asked to locate the information. At this time, your optimaloption.net and www.optimaloption.net already point to the 192.3.3.155 IP address, your VPS."

>> You said there are 'two sets of information', then you mentioned one and stopped. I find it hard to follow how you explain things.
   

"The choice is yours whether using the existing registrar you manage your Domains DNS records to the VPS host.
Make sure they have all the services configured that you need and want for your domain before making changes to the name servers reflected on the registration record.  If you do not, they may point the Mail handling along with anything else to where they think it should go without regard where you want it to go.  i.e. your current email is handled by provider."


>> There won't be any email involved with my new domain, this domain will exist to solely display and run my index.php script.


"Your VPS however is not accepting external connections on that IP/port 80.
Check the firewall settings on the VPS to make sure it allows port 80 traffic through."

>> My VPS is running Windows Web Server 2008 R2 - something I've never used before. Where do I find how to allow port 80?


 "Double check the VPS to make sure there is easyphp(apache) bound to port 80
netstat -an | find ":80"

>> Don't know what you mean by this, or that command you mention. Is that a DOS command you want me to run on the VPS??

Thanks
   Shawn
It seems you are not far enough along o have your site accessible.
Instead of me trying with every answer guesstimate how far along you are,
Please look at the documentation of easyphp that includes the step by step setup and tests along the way to confirm  that you are on the right path:
http://www.easyphp.org/support/
Then confirm that you can browse your site while on the VPS.

You need to provide the step by step which instructions you are following, which page/step of those you are on, and what issues you are having.

At this point, I am close to a conclusion that you have a VPS, You installed easyPHP and are wondering why it is not working.  Installing EasyPHP is one step of several.  The guide outlines ...

My suggestion would have been before signing up for a VPS, you should use EasyPHP on your local system where you can learn how it functions, how it is setup, what the steps to configure it are, etc.

You effectively, prior to learning to Drive went out and bought a car, and now asking how to get from point A to Point B. When provided direction, with every subsequent response it gets closer and closer to a point when the answer will be, "I do not know how to drive."

Meaning, After the several attempts of trying to answer your question, I do not think you have easyPHP csetup on the VPS .
Sure I have it set up, A couple of weeks ago I did everything that is on this page:

http://www.easyphp.org/support/quickstart/

I then went to work developing my PHP script (simply displays a small form accepting two pieces of info and generates and displays a code for the user). I got all that working and can run the script in the browser on the VPS. I simply right-click on the EasyPHP system tray icon, click "localweb", and run my script on the VPS. I have my script all done, now I want to make it live so when people go to www.optimaloption.net, it comes up and they can use it.

What part am I missing here?

Thanks
   Shawn
you are missing the part that using a web browser going to http://www.optimaloption.net/hello.php or hello.htm etc
that you create and can see in the browser.
If you can while on the VPS view your site as http://www.optimaloption.net 

Then your issue is that your VPS is behind a firewall and access to port 80 is blocked.
What OS is running on your VPS?

Does your chicagovps provide a configuration panel interface similar to the one your domain's registrar has where one of the options here is to edit/configure the firewall?

Internet <=> [black box] <=> VPS

Right now your VPS is not accessible on port 80 which is where your website (easyPHP) is.

What I am trying to determine is whether you need to make adjustments to the software/windows firewall on the VPS, or the changes need to be made within the confines of the [black box] Host provided firewall.
while on the VPS use a browser, IE go to http://127.0.0.1/ what do you see?
No, www.optimaloption.net does not work on my VPS - it never has. www.optimaloption.net doesn't work from ANY location... that's what I'm trying to get working.

When I call up http://127.0.0.1/ from my VPS, my index.php file (which is in the "Localweb" folder) executes fine and appears in the browser. This is the same as right clicking on the EasyPHP system tray icon and clicking the "LocalWeb" selection.

Arnold, I invite you to log into my VPS and look around for yourself. I can privately email you the user/pass if this is okay. I don't mind.

Thanks
   Shawn
Usually, people here want a similar opportunity to .......

You can send me a message through EE using the message interface.

Please make sure to setup a non-admin separate login for this.

What it sounds like us that you configured easyPHP. Such that the web server is bound only to the localhost and not to all IPs on the system

In a command window on the VPS, netstat -an | find ":80" | find /I "listen"
Do you only have
127.0.0.1:80
This means that is the only ip on which it can be accessed.
What you should have
0.0.0.0:80
Or
*:80
This means that the web is listening on all IPs/network cards the system has configured.


using the hosts example on the VPS using the
127.0.0.1 www.optimaloption.net
Can you now browse your site?
You need to use the easyphp, administrator to setup ...

If you decide to please make sure to include where your sites folder location is.
Thanks Arnold, you wrote:

"Usually, people here want a similar opportunity to .......
You can send me a message through EE using the message interface.
Please make sure to setup a non-admin separate login for this."

>> Thanks. I will send you this very shortly. You can use the regular Administrator account, I don't mind. That way, you have full capability to do whatever needs to be done.


"What it sounds like us that you configured easyPHP. Such that the web server is bound only to the localhost and not to all IPs on the system".

>> Well, I didn't really do any special configurations on EasyPHP at all. After i installed it, I just used it "as is". I guess this is the problem - it needs some additional special configuration which I don't know how to do.


"In a command window on the VPS, netstat -an | find ":80" | find /I "listen"
Do you only have
127.0.0.1:80
This means that is the only ip on which it can be accessed.
What you should have
0.0.0.0:80
Or
*:80
This means that the web is listening on all IPs/network cards the system has configured."

>> OK, did this command and here is what it returned:

TCP    127.0.0.1:80       0.0.0.0:0                LISTENING


"using the hosts example on the VPS using the
127.0.0.1 www.optimaloption.net
Can you now browse your site?
You need to use the easyphp, administrator to setup ..."

>> on my VPS, 127.0.0.1 brings up my index.php file, as usual. www.optimaloption.net still  does not work - as usual.


"If you decide to please make sure to include where your sites folder location is. "

>> My files are located in folder:

C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb

index.php is the file I wish to display when people visit www.optimaloption.net.


Thanks for the help Arnold...

Shawn
ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you for doing that Arnold... but www.optimaloption.net still does not come up on my regular computer here. I have also a spare computer and it won't come up on that either. Could this be because of some settings I have with my domain's registrar ? (www.dotyou.com)

Shawn
ok, made the requisite changes to the VPS's windows firewall to allow port 80 traffic through the windows firewall.
First rule when sorting by rule name "Allow external connection ......." on the public only

you should be set now.  Cautionary, please make sure you keep checking security events dealing with apache/easyPHP to make sure if there are any vulnerability found, that you update your setup in a timely manner.
Thanks for that Arnold, and now www.optimaloption.net indeed comes up on my regular computer here... but strangely enough, it won't come up on my other spare computer here. Does www.optimaloption.net come up for you on your regular computer where you are at?

Thanks
    Shawn
The other spare computer is likely displaying a cache, while holding down shift+ctrl+R or (F5 provided it is not controlling your touchpad), triggers a refresh and the site should appear. make sure the spare system is connected just in case.
The "hosts" file on my spare system looks quite normal:

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost

Open in new window


Thanks
   Shawn
The hosts file are merely a means to test functionality of a site during a transition between providers to make sure that the site with the new provider is functional.
All those settings in hosts file on the VPS, and others that use the 192.3.3.155 IP should be removed to avoid having them interfer/rear their ugly head in the future. When you move from the current provider and once the VPS is shutdown, on the system where the hosts file points to that IP so will the site.
My spare system is connected fine, but still www.optimaloption.net won't come up. I tried shift+ctrl+R and also F5. I also went into Firefox|Options|Advanced and cleared out the cache. Still no good  :-(

Thanks
   Shawn
Does www.optimaloption.net come up on your system Arnold?
On the spare system, nslookup www.optimaloption.net does it point to 192.3.3.155?
The issue if any with your spare system is a separate issue.
Everyone everywhere that has internet connection should see your site without an issue.
what is nslookup, and how do I use it?
Command window, nslookup is the tool to lookup the name to ip conversion on reverse
nslookup www.optimaloptionl.net
should return 192.3.3.155.
OK, in the command prompt of my spare system I did the command:

nslookup www.optimaloption.net

it returned this:

Server: cns01.eastlink.ca
Address: 24.222.0.94

Non-authoritative answer:
Name:  optimaloption.net
Address:  192.3.3.155
Aliases:  www.optimaloption.net
In this question I am not in a position to address a new question.
Anyone who wants to access your site from anywhere in the world can.  If they are unable to, the issue is not on your VPS side.

Does your spare system have a VPN connection to the VPS?

To look at  the spare system, open a related quested with nominal point value.  In there you should post what if any error you get when accessing the site with your system. And is the issue the same through out the different browsers you may have access to.
OK I understand. I have just asked an online friend to try going to the site for me and it worked for him. So the site works for you fine also?
OK, it's clearly a firefox issue on my spare computer Arnold, because I tried Google Chrome and IE and www.optimaloption.net came up successfully on both of them - so we are good there!

What I don't fully understand yet Arnold, is how does my domain optimaloption.net *KNOW* to point exactly to the folder
C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb  ?

Where is the configuration that dictates that?

Thanks
   Shawn
The location is part of the Apache (web server) portion.

Using the easyPHP admin interface, the e to the left most, provides the access to the configuration of the various components that make up the setup. Open Apache and look there, you might have other configuration references, etc.  

Local web is the default location meaning when you were installing it prompted you where you want the different items stored.
You likely were not looking for custom to alter where the data is stored.

Documentroot is a reference.

Apache.org  has references describing its settings/functionality.
OK, so if I wanted to create "subdomains" of optimaloption.net, would it be a complicated thing? Now that I have things working, ideally I would like to have 3 different subdomains:

extrak.optimaloption.net
yyy.optimaloption.net
zzz.optimaloption.net

Do I just need to make a subdirectory off my Localweb directory named "extrak" and move my files there?

Thanks
   Shawn
Folders within local web will be accessible
I've not looked through the easyphp long enough

Do you want to effectively have multiple websites served from your domain?

Look at the httpd.conf file (Apache config) for VirtualHost entries
Each <VirtualHost *:80> entry can be differentiated through the use of
ServerName domain1.com
ServerAlias www.domain1.com


Please look at the Apache.org site for VirtualHost examples and explanation.

What would happen is that you will point using the DNS record editor of the registrar or through whatever tools chicagovos provides to create and point each su domain to your VPS IP.

Apache when receiving a request will differentiate the sites based on the ServerName/ServerAlias and what the browser submits.
Is there a folder such as
C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\cont
With files here.
I.e. Is there an include at the bottom of the httpd.conf file?
OK... can you help me while I try to set up one subdomain (extrak.optimaloption.net) ? The other subdomains, I will need only in the future.

Should I wrap up this question and submit another question for a new issue... or can we continue with this same issue?

Thanks
    Shawn
Yes, you should start a separate question.
OK, I will wrap this one up and do so. Thank you for your help Arnold.

Arnold, the domain optimaloption.net was just a "spare" domain I had to test all this and get it going... now that I know it will work, I am going to register a new domain name that will be the permanent proper domain name for this task. I guess we will need to give this a day or so to propogate before we can begin with the subdomain issue...

Thanks
    Shawn
The hosts file example, can bypass the delay waiting for propagation.

192.3.3.155 www.newnonexistatntdomain.com

On a system (not VPS) will get you to your VPS when the above URL is used in the browser.

I've not looked closely enough to determine whether the definitions of the sites that Apache serve's up are manually stored within the plain text files of httpd.conf or are possibly configured/stored within the MySQL database table dealing with websites.
....
When you post the related question,

Did you install MySQL workbench by any chance to help you manage the data within MySQL or phpmyadmin to manage it via a web browser (note that if you do setup phpmyadmin, to restrict access to this directory.)
No, I'm pretty sure I did not install MySQL as I figured I did not need it.

Let's just wait till my new domain becomes propogated, to make things simpler.

So all I need to do with my new domain is to specify the ChicagoVPS namesservers (ie. ns4.chicagovps.net, etc) with my registrar?

Thanks
   Shawn
It is installed and running.  Look at easyphp admin, Apache and MySQL are listed with both started..

IMHO! It is best to retain control.  This way you can register domains at will, make record addition/changes through the interface whose image you originally posted without the need to request changes from chicagovos if they do not provide a User interface to manage the domain functionality.

Transferring/delegating the domain to chicagovos might come with a cost.
Oh ok, so I *did* install MySQL, sorry.

So what do I do now? Do I need to change anything?

Shawn
At this point this question is done. Correct?  Please open a separate related question to deal with your next question.
EasyPHP setup and operational, wanting to configure to have multiple domains hosted on the single IP system.