peranha Posted June 1, 2008 Share Posted June 1, 2008 I cannot think of what it is called. I want to add a prefix to my website. I want to add test.site.com to my website site.com, but cannot think of how to word it to do a search. I tried virtual host, but that didnt work as it only set it up to go to http://site/ and http://test/. Quote Link to comment Share on other sites More sharing options...
neylitalo Posted June 1, 2008 Share Posted June 1, 2008 Subdomain? Your host's control panel probably has a section for managing subdomains. Quote Link to comment Share on other sites More sharing options...
peranha Posted June 1, 2008 Author Share Posted June 1, 2008 Even if I am hosting on my own server, do I still have to register my domain, or is there something in apache that will do this. Quote Link to comment Share on other sites More sharing options...
.josh Posted June 1, 2008 Share Posted June 1, 2008 A server has an ip address. You can go directly to your site by entering in the ip address in the address bar. If you would like to be able to do www.mydomain.com you need to register a domain name and have it point to your server. Your server/apache/whatever does not do this automatically. Basically a domain name is a "nickname" for your server. You pay some registrar domain name service money to reroute requests to mydomain.com to your ip. Now, SUB domains are done on your server. You would do that in cpanel or wherever. Quote Link to comment Share on other sites More sharing options...
peranha Posted June 1, 2008 Author Share Posted June 1, 2008 I am registered with Website website with godaddy, and I am hosting on my own server at my house. i would like to add test.Website.com. do I have to register this with godaddy, as well?? I dont have a cpanel installed on my server, so I am woundering if there is another way, or if not, what type of cpanel do you recommend?? Quote Link to comment Share on other sites More sharing options...
.josh Posted June 1, 2008 Share Posted June 1, 2008 You can do it without cpanel, but I suggest you download cpanel or something equivalent as it is much easier. You do not need to register sub domains with godaddy. You would do it on your own server (through cpanel or on your command line) Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted June 1, 2008 Share Posted June 1, 2008 Try to post the virtual host part of your Apache configuration file. Quote Link to comment Share on other sites More sharing options...
peranha Posted June 1, 2008 Author Share Posted June 1, 2008 <VirtualHost *:8204> DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/mberanek" ServerName localhost </VirtualHost> <VirtualHost *:8204> DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/mberanek/test" ServerName test.localhost </VirtualHost> Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted June 1, 2008 Share Posted June 1, 2008 How doesn't it work? Have you setup your hosts file to make test.localhost go to 127.0.0.1? Quote Link to comment Share on other sites More sharing options...
peranha Posted June 1, 2008 Author Share Posted June 1, 2008 yes I have, when i go to test.localhost and localhost, they both go to "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/mberanek" which is localhost. It will not got to localhost/test when I go to test.localhost not sure why. Quote Link to comment Share on other sites More sharing options...
trq Posted June 1, 2008 Share Posted June 1, 2008 Did you restart apache after making the changes? Quote Link to comment Share on other sites More sharing options...
peranha Posted June 1, 2008 Author Share Posted June 1, 2008 yes i did, and to make sure, I restarted the PC after that didnt work. Quote Link to comment Share on other sites More sharing options...
peranha Posted June 1, 2008 Author Share Posted June 1, 2008 This is my hosts file as well # 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 127.0.0.1 test.localhost Quote Link to comment Share on other sites More sharing options...
peranha Posted June 1, 2008 Author Share Posted June 1, 2008 It works now, after a couple of more restarts. here is my vhosts file in apache <VirtualHost *:8204> DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/mberanek" ServerName localhost </VirtualHost> <VirtualHost *:8204> DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/mberanek/test" ServerName test.localhost </VirtualHost> and this is my hosts file in windows # 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 127.0.0.1 test.localhost Not sure why it didnt work after the first restart, but it finally does. Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.