Welcome Guest. Please Login or Register  


You are here: Index > AMPPS > General Support > Topic : AMPPS DNS?

1


Threaded Mode | Print  

 AMPPS DNS?, Need DNS for AMPPS (15 Replies, Read 27961 times)
sluiting
Group: Member
Post Group: Working Member
Posts: 100
Status:
Hi, Is their a way to "fake" a domain name instead of the default localhost ip? Does AMPPS have a way to create a local DNS so that I'm working in a "domain" so when I'm migrating from my desktop to a server I don't have to spend hours rebuilding the site or trying to modify links in a database? It seems like a simple enough request or am I off on this?  :angel:
IP: --   

AMPPS DNS?
tidus
Group: Member
Post Group: Super Member
Posts: 1121
Status:
Hi,

Yes. For exactly this purpose domain creation is provided by Ampps. :)

Lets assume you want to create mysite.com and the path for its public_html would be C:\Program Files\Ampps\www\mysite.com

Create an addon domain from ampps enduser panel ( http://localhost/ampps ) with domain name as mysite.com and its path as C:\Program Files\Ampps\www\mysite.com

I am assuming you don't have a local dns server so check the checkbox in
the advance settings which will add an entry to host file. (This is important)

NOTE: Check the checkbox even if you see the red note in advance settings. Sometimes(When UAC is active) Red note is shown because Ampps does not have the permission to write into hosts file.

Just add the entry manually in the hosts file. Which is generally located at C:\Windows\System32\driver\etc\hosts

You can refer this Wiki to add domain:
http://www.ampps.com/wiki/Adding_a_Domain#Addon

After you add a domain let Apache restart (Ampps will automatically restart apache).

Now access mysite.com you should be able to see cgi-bin folder listed there. Now create a php test file say test.php in the path C:\Program Files\Ampps\www\mysite.com with the contents
Code
<?php phpinfo(); ?>


Access that php file from browser to see if the php is working. http://mysite.com/test.php


-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

AMPPS DNS?
sluiting
Group: Member
Post Group: Working Member
Posts: 100
Status:
Thank You. After experimenting I did get it to work. I believe that checking the box is very important.  Why is that? What does that do? I can't make an already existing domain work. It just gives me the root if I use that (the 127.0.0.1)

Question. How do I give access to AMPPS so that I don't manually have to add the domain name. Also, a warning to anyone reading this: Do not name your domain name on your localhost the same as your live site unless you don't mind not being able to see the live site while AMPPS is running. Just thought I'd mention this. 
I still can't believe that the people I work with even use MAMP. This is so much easier to setup.
IP: --   

AMPPS DNS?
sluiting
Group: Member
Post Group: Working Member
Posts: 100
Status:
Also, my location for the file was here:
C:\Windows\System32\drivers\etc\hosts

Slightly different, just drivers instead of driver. Also, for others you need to go one directory above and change your directory from read only.
IP: --   

AMPPS DNS?
sluiting
Group: Member
Post Group: Working Member
Posts: 100
Status:
Wish I could edit my posts. I forgot to mention that you need to right-click on the etc directory in order to change permissions. I see that we have a lot of beginners here so I thought I'd mention that.

Also, I did find out that if a site is already built on a real server and migrated to AMPPS it will work when migrated back. Just when building a site in a localhost environment without DNS does this cause an issue. I've heard it's a rite of passage almost for developers since it's not talked about.

IP: --   

AMPPS DNS?
sluiting
Group: Member
Post Group: Working Member
Posts: 100
Status:
I solved my own question. In order to add the DNS to the host file simply go up to drivers directory and right-click, uncheck the read only selection on the folder permissions. A warning may come up on some files simply check skip all. Then restart Windows. The red text will still appear telling you that AMPPS doesn't have rights but it will. Create a test domain and open the host file. You'll see the domain written there.
IP: --   

AMPPS DNS?
BBC2013
Group: Member
Post Group: Newbie
Posts: 15
Status:
Ampps never make problems with Windows 8 and hosts file writing, but for some reason it does in XP. Never mind, not many people use XP anyway.

Wanted to say, dont use domain name .com for faking domains with hosts. Soon or later you will hit the wall, and you will not know why you cannot open some website on Internet.

Make some own domain name and stick to it, some initials that means only for you something.
( Ampps is Good = mysite.aig, for instance)
IP: --   

AMPPS DNS?
sluiting
Group: Member
Post Group: Working Member
Posts: 100
Status:
Thanks. Great advice. I wasn't aware that I could be that creative and make up my own domain type. I just realized that this will allow me to keep the same domain name for my sites by using a different domain name.

Thanks.
IP: --   

AMPPS DNS?
sluiting
Group: Member
Post Group: Working Member
Posts: 100
Status:
I mean extension name like .aig
IP: --   

AMPPS DNS?
tidus
Group: Member
Post Group: Super Member
Posts: 1121
Status:
Hi,

Quote
Thank You. After experimenting I did get it to work. I believe that
checking the box is very important.  Why is that? What does that do?


You can create two domains, one with the checkbox checked and other with the checkbox unchecked. And then see the difference in the file Ampps\apache\conf\extra\httpd-vhosts.conf :)

Apache is not able to resolve Domain Name, if users have not setup their own dns server.


Edited by tidus : October 4, 2013, 1:40 pm

-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

AMPPS DNS?
sluiting
Group: Member
Post Group: Working Member
Posts: 100
Status:
Did you mean httpd-vhosts.conf? I didn't see any reference to domains in that file but in vhosts.conf this was there:

#DO NOT EDIT, CREATED BY AMPPS

           
#### cablewiki.com VirtualHost ####
           

<VirtualHost cablewiki.com:80>
<Directory "c:/program files (x86)/ampps/www/cablewiki.com">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
allow from All
</Directory>
ServerName cablewiki.com
ServerAlias cablewiki.com
ScriptAlias /cgi-bin/ "c:/program files (x86)/ampps/www/cablewiki.com/cgi-bin/"
DocumentRoot "c:/program files (x86)/ampps/www/cablewiki.com"
ErrorLog "C:/Program Files (x86)/Ampps/apache/logs/cablewiki.com.err"
CustomLog "C:/Program Files (x86)/Ampps/apache/logs/cablewiki.com.log" combined
</VirtualHost>

####################################
           
#### cablewiki.org VirtualHost ####
           

<VirtualHost cablewiki.org:80>
<Directory "c:/program files (x86)/ampps/www/cablewiki.org">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
allow from All
</Directory>
ServerName cablewiki.org
ServerAlias cablewiki.org
ScriptAlias /cgi-bin/ "c:/program files (x86)/ampps/www/cablewiki.org/cgi-bin/"
DocumentRoot "c:/program files (x86)/ampps/www/cablewiki.org"
ErrorLog "C:/Program Files (x86)/Ampps/apache/logs/cablewiki.org.err"
CustomLog "C:/Program Files (x86)/Ampps/apache/logs/cablewiki.org.log" combined
</VirtualHost>

####################################
           
#### cablecenter.aig VirtualHost ####
           

<VirtualHost 127.0.0.1:80>
<Directory "c:/program files (x86)/ampps/www/cablecenter.aig">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
allow from All
</Directory>
ServerName cablecenter.aig
ServerAlias cablecenter.aig
ScriptAlias /cgi-bin/ "c:/program files (x86)/ampps/www/cablecenter.aig/cgi-bin/"
DocumentRoot "c:/program files (x86)/ampps/www/cablecenter.aig"
ErrorLog "C:/Program Files (x86)/Ampps/apache/logs/cablecenter.aig.err"
CustomLog "C:/Program Files (x86)/Ampps/apache/logs/cablecenter.aig.log" combined
</VirtualHost>

####################################
IP: --   

AMPPS DNS?
sluiting
Group: Member
Post Group: Working Member
Posts: 100
Status:
cablecenter.aig  is a full domain and the other two are not.
IP: --   

AMPPS DNS?
tidus
Group: Member
Post Group: Super Member
Posts: 1121
Status:
Quote From : sluiting October 4, 2013, 1:37 pm
Did you mean httpd-vhosts.conf? I didn't see any reference to domains in that file but in vhosts.conf this was there:

#DO NOT EDIT, CREATED BY AMPPS

           
#### cablewiki.com VirtualHost ####
           

<VirtualHost cablewiki.com:80>
<Directory "c:/program files (x86)/ampps/www/cablewiki.com">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
allow from All
</Directory>
ServerName cablewiki.com
ServerAlias cablewiki.com
ScriptAlias /cgi-bin/ "c:/program files (x86)/ampps/www/cablewiki.com/cgi-bin/"
DocumentRoot "c:/program files (x86)/ampps/www/cablewiki.com"
ErrorLog "C:/Program Files (x86)/Ampps/apache/logs/cablewiki.com.err"
CustomLog "C:/Program Files (x86)/Ampps/apache/logs/cablewiki.com.log" combined
</VirtualHost>

####################################
           
#### cablewiki.org VirtualHost ####
           

<VirtualHost cablewiki.org:80>
<Directory "c:/program files (x86)/ampps/www/cablewiki.org">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
allow from All
</Directory>
ServerName cablewiki.org
ServerAlias cablewiki.org
ScriptAlias /cgi-bin/ "c:/program files (x86)/ampps/www/cablewiki.org/cgi-bin/"
DocumentRoot "c:/program files (x86)/ampps/www/cablewiki.org"
ErrorLog "C:/Program Files (x86)/Ampps/apache/logs/cablewiki.org.err"
CustomLog "C:/Program Files (x86)/Ampps/apache/logs/cablewiki.org.log" combined
</VirtualHost>

####################################
           
#### cablecenter.aig VirtualHost ####
           

<VirtualHost 127.0.0.1:80>
<Directory "c:/program files (x86)/ampps/www/cablecenter.aig">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
allow from All
</Directory>
ServerName cablecenter.aig
ServerAlias cablecenter.aig
ScriptAlias /cgi-bin/ "c:/program files (x86)/ampps/www/cablecenter.aig/cgi-bin/"
DocumentRoot "c:/program files (x86)/ampps/www/cablecenter.aig"
ErrorLog "C:/Program Files (x86)/Ampps/apache/logs/cablecenter.aig.err"
CustomLog "C:/Program Files (x86)/Ampps/apache/logs/cablecenter.aig.log" combined
</VirtualHost>

####################################


Hi,

Sorry. Yes, httpd-vhosts.conf


-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

AMPPS DNS?
sluiting
Group: Member
Post Group: Working Member
Posts: 100
Status:
I see: the difference is in the top line of each.

<VirtualHost cablewiki.org:80> (folder and not domain)
<VirtualHost 127.0.0.1:80> cablecenter.aig (actual DNS domain name)
It looks like it's saying in the last one to go up one level and use port 80? The other is saying "I'm in a folder called cablewiki.org and use port 80. Is that right?

Pardon, I'm still trying to understand what a DNS server is and how it relates as well as how the server software "thinks" if you can call it that thinking.
IP: --   

AMPPS DNS?
tidus
Group: Member
Post Group: Super Member
Posts: 1121
Status:
Hi,

Oh it is not related to folders here. :)

Refer this:
http://httpd.apache.org/docs/current/vhosts/
and
http://httpd.apache.org/docs/current/mod/core.html#virtualhost

also search for DNS Server on net.

Really not possible to write everything here. :)



-----------------------
Follow AMPPS on,
Twitter : https://twitter.com/AMPPS_Stack
Facebook :  http://www.facebook.com/softaculousampps
Google+ : https://plus.google.com/+AmppsStack
IP: --   

« Previous    Next »

Threaded Mode | Print  

1


Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is May 26, 2024, 1:58 am.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 10  |  Page Created In:0.021