Page 1 of 1

New user of XAMPP local host works, domain doesn't

PostPosted: 01. February 2007 00:02
by meows
Hi there guys and girls.
I am having a mental breakdown here, seems if I leave the default httpd.conf alone localhost and https://127.0.0.1/xampp/ and php etc all work great.. If I edit it to show my .com domain my domain works fine, however i lose localhost. I did set up httpd-vhosts.conf with this and the default http.conf
# Use name-based virtual hosting.
#
NameVirtualHost 75.160.145.121:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost 75.160.145.121:80>
ServerAdmin meows@techie.com
DocumentRoot /WWW.ROOT.HOME
ServerName 78ez.com
ServerAlias www.78ez.com
ErrorLog com-error_log
CustomLog access_log common
</VirtualHost>

The big question is how do you edit httpd.conf so you get both localhost and your domain to work?

PostPosted: 01. February 2007 00:06
by Wiedmann
If I edit it to show my .com domain my domain works fine, however i lose localhost.

The first vhost must point to your default localhost. And the second vhost is for your .com domain.

PostPosted: 01. February 2007 00:12
by meows
Wiedmann wrote:
If I edit it to show my .com domain my domain works fine, however i lose localhost.

The first vhost must point to your default localhost. And the second vhost is for your .com domain.


I am so brain dead,. how would I write that? use localhost or the IP 127.0.0.1

PostPosted: 01. February 2007 00:14
by Wiedmann
how would I write that?

There are really many examples, which you can fibnd with the search function here ;-)

e.g.:
http://community.apachefriends.org/f/viewtopi ... host#34538

PostPosted: 01. February 2007 00:18
by meows
The Apache service named reported the following error:
>>> [Wed Jan 31 14:43:41 2007] [warn] NameVirtualHost *:80 has no VirtualHosts .


my VirtualHosts file has this
NameVirtualHost 75.160.145.121:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost 127.0.0.1>
ServerAdmin meows@techie.com
DocumentRoot "F:/Program Files/xampp/htdocs"
ServerName localhost
ServerAlias localhost
## ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
## CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common
</VirtualHost>


<VirtualHost 75.160.145.121:80>
ServerAdmin meows@techie.com
DocumentRoot /WWW.ROOT.HOME
ServerName 78ez.com
ServerAlias www.78ez.com
ErrorLog com-error_log
CustomLog access_log common
</VirtualHost>

Local host works fine but the domain doesn't work anymore

PostPosted: 01. February 2007 00:33
by Wiedmann
Code: Select all
NameVirtualHost 75.160.145.121:80

<VirtualHost 127.0.0.1>
    ...
</VirtualHost>

<VirtualHost 75.160.145.121:80>
    ...
</VirtualHost>


Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
    ...
</VirtualHost>

<VirtualHost *:80>
    ...
</VirtualHost>

PostPosted: 01. February 2007 01:12
by meows
used both samples. and got this error
The Apache service named reported the following error:
>>> [Wed Jan 31 14:43:41 2007] [warn] NameVirtualHost *:80 has no VirtualHosts .

For more information, see Help and Support Center at

Hummm.. flustrating.. lets back up here.. what is the procedure to add a domain to XAMPP?
example what do you change in httpd and the http-vhost files.. is there a post you can direct me to? or what is the correct procedure.
Many Many thanks
Christine

PostPosted: 01. February 2007 01:28
by Wiedmann
used both samples.

Both example?

what is the procedure to add a domain to XAMPP?
example what do you change in httpd and the http-vhost files..

I add the code from my link above.

PostPosted: 01. February 2007 01:33
by meows
yes used both examples.. one at a time.. the end result was
NameVirtualHost 75.160.145.121:80

<VirtualHost 127.0.0.1>
ServerAdmin meows@techie.com
DocumentRoot "F:/Program Files/xampp/htdocs"
ServerName localhost
ServerAlias localhost
</VirtualHost>

<VirtualHost 75.160.145.121>
ServerAdmin meows@techie.com
DocumentRoot /WWW.ROOT.HOME
ServerName 78ez.com
ServerAlias www.78ez.com
</VirtualHost>


not sure why it isn't working.. just assume i missed something else..
so that is why i asked the proper procedure to add a domain to the program

PostPosted: 01. February 2007 01:36
by Wiedmann
yes used both examples..

Why both? There is only one example from me here in this thread? *wondering*

PostPosted: 01. February 2007 01:43
by meows
Wiedmann wrote:
Code: Select all
NameVirtualHost 75.160.145.121:80

<VirtualHost 127.0.0.1>
    ...
</VirtualHost>

<VirtualHost 75.160.145.121:80>
    ...
</VirtualHost>


Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
    ...
</VirtualHost>

<VirtualHost *:80>
    ...
</VirtualHost>


well because it is new and i figured i made a mistake, which surely i have..

can i be pointed in the direction of a how to add a domain, cause i must have messed up somewhere else.

PostPosted: 01. February 2007 01:53
by Wiedmann
Well, the first code, inside the quote, is your own (wrong) code. See your post above.

And the second one is the code you should use.


BTW:
You have read the link i gave you?

PostPosted: 01. February 2007 06:22
by meows
well after spending many more hours reading i came up with this that works.. however it does not find index.htm or index.html in the
DocumentRoot "F:/WWW.ROOT.HOME"
any ideas why this is?
Code: Select all
NameVirtualHost *:80

VirtualHost *:80>
    ServerName localhost:80
    DocumentRoot "F:/Program Files/xampp/htdocs"
    <Directory "F:/Program Files/xampp/htdocs">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName www.78ez.com:80
    DocumentRoot "F:/WWW.ROOT.HOME"
    <Directory "F:/WWW.ROOT.HOME">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>