2 domains,same pc,both don't work
Posted by: sTimulated (---.plus.com)
Date: April 10, 2015 07:50PM

I have a 'different' setup than normal,set up by Steve.

I have domain name stimulatedgaming.com and have been running it successfully for years.
Just bought another domain and have pointed it to my fixed IP,same as stimulatedgaming.com.

I don't have/use a vhosts file as it's all in my httpd.conf file.
Obviously I have not done something correct or have missed something out because now stimulatedgaming.com no longer works.

It all stopped working when I pointed new domain to same IP,coincidence?
Usually I can browse to www.stimulatedgaming.com from my other LAN pc,always have been able to.
I know about the NAT loopback limitation of most routers.
I have parked the new domain and reset the dns zone file to my IP for stim.com
I can browse to www.stimulatedgaming.com on the server pc but not on my other LAN pc.
Browsing with mobile on data (not wifi) did not find stim.com


1 - win7U x64
2 - 2.2 x64
3 - 2.0.63
4 - 5.3.4
5 - 5.5.24
6 - Green



Edited 2 time(s). Last edit at 04/11/2015 12:15AM by sTimulated.

Options: ReplyQuote
Re: 2 domains,same pc,both don't work
Posted by: RiggsFolly (---.as43234.net)
Date: April 11, 2015 10:10AM

Well you had better start by showing the relevant parts of your httpd.conf file.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: 2 domains,same pc,both don't work
Posted by: sTimulated (---.plus.com)
Date: April 11, 2015 02:50PM

Hey Riggs

I have reverted back to an old version,at first nothing worked at all.
Parked my domains and tried an even earlier backup.
Things are working again now,not sure why or how but maybe the dns has sorted itself out?

This is my conf file as it is now..........

### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:[httpd.apache.org];
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
#NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.stimulatedgaming.com
ServerAlias stimulatedgaming.com
DocumentRoot C:/wamp/www/stimulatedgaming
ErrorLog C:/wamp/www/stimulatedgaming/logs/error.log
CustomLog C:/wamp/www/stimulatedgaming/logs/access.log common
</VirtualHost>

<VirtualHost *:80>
ServerName stimulatedgaming.com/Forum
ServerAlias Forum
DocumentRoot C:/wamp/www/stimulatedgaming/Forum
ErrorLog C:/wamp/www/logs/error.log
CustomLog C:/wamp/www/logs/access.log common
</VirtualHost>

<VirtualHost *:80>
ServerName localhost
DocumentRoot C:/wamp/www
ErrorLog C:/wamp/www/logs/error.log
CustomLog C:/wamp/www/logs/access.log common
</VirtualHost>


Include "c:/wamp/alias/*"


I need to add my other domains now before I unpark them.
Is it a case of copy/paste but change domain name for each domain?

<VirtualHost *:80>
ServerName 123.com
ServerAlias 123.com
DocumentRoot C:/wamp/www/123
ErrorLog C:/wamp/www/123/logs/error.log
CustomLog C:/wamp/www/123/logs/access.log common
</VirtualHost>

<VirtualHost *:80>
ServerName www.abc.com
ServerAlias abc.com
DocumentRoot C:/wamp/www/abc
ErrorLog C:/wamp/www/abc/logs/error.log
CustomLog C:/wamp/www/abc/logs/access.log common
</VirtualHost>


Server 123 does not need to be www apparently,I'm just going to use it's domain name to run a stats server.
Hope to run a website from it soon though.
abc domain I will make soon.

In my www folder I just need to make new domain named folders (123 and abc) and put my files inside?
______________________________________________________________________________________________________
This is what I'ver done and what I guess it should look like......

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.stimulatedgaming.com
ServerAlias stimulatedgaming.com
DocumentRoot C:/wamp/www/stimulatedgaming
ErrorLog C:/wamp/www/stimulatedgaming/logs/error.log
CustomLog C:/wamp/www/stimulatedgaming/logs/access.log common
</VirtualHost>

<VirtualHost *:80>
ServerName stimulatedgaming.com/Forum
ServerAlias Forum
DocumentRoot C:/wamp/www/stimulatedgaming/Forum
ErrorLog C:/wamp/www/logs/error.log
CustomLog C:/wamp/www/logs/access.log common
</VirtualHost>

<VirtualHost *:80>
ServerName www.123.com
ServerAlias 123.com
DocumentRoot C:/wamp/www/123
ErrorLog C:/wamp/www/123/logs/123_error.log
CustomLog C:/wamp/www/123/logs/123_access.log common
</VirtualHost>

<VirtualHost *:80>
ServerName 123/Stats.com
ServerAlias 123.com
DocumentRoot C:/wamp/www/123/Stats
ErrorLog C:/wamp/www/123/Stats/logs/123-Stats_error.log
CustomLog C:/wamp/www/123/Stats/logs/123-Stats_access.log common
</VirtualHost>

<VirtualHost *:80>
ServerName www.abc.org.uk
ServerAlias abc.org.uk
DocumentRoot C:/wamp/www/abc
ErrorLog C:/wamp/www/abc/logs/abc_error.log
CustomLog C:/wamp/www/abc/logs/abc_access.log common
</VirtualHost>

<VirtualHost *:80>
ServerName localhost
DocumentRoot C:/wamp/www
ErrorLog C:/wamp/www/logs/error.log
CustomLog C:/wamp/www/logs/access.log common
</VirtualHost>


Include "c:/wamp/alias/*"


Apparently the stats server needs to be in the 123 root folder but I'm thinking there may be a clash with some files when I put a website in there?
So I put the stats server in it's own folder inside 123 folder

Both look like this.....
wamp/www/123
wamp/www/123/stats
I'm hoping I've edited vhost right to accomplish this?
Although not sure about the alias.
Maybe there's a better way and I can put the stats files in root 123 along with the website once I've made it?
Or it cannot be done?



Edited 4 time(s). Last edit at 04/11/2015 10:32PM by sTimulated.

Options: ReplyQuote
Re: 2 domains,same pc,both don't work
Posted by: RiggsFolly (---.as43234.net)
Date: April 11, 2015 10:52PM

Hi

First pointing new domains to your router WAN ip should not cause your existing setup any problems. Apache will just not know what to do with them and launch the first Virual Host in your list of vhosts.

RULE:
If Apache cannot find the domain name in the list of vhosts it always defaults to the first in the list.
Thats why localhost should always be defined as the first vhost and be set to allow only local access, any unusual access will therefore get 'not allowed access' error, detereing hackers.

As long as when you add the new vhost definitions you also create the folder that they point to they should not raise any errors and stop Apache from loading.

Cannot see why you are not using the standard method of defining vhosts i.e. using the /extra/httpd-vhost.conf file but it shoudl not be a problem adding them in httpd.conf like you say you have done.

If you want to try setting it up properly see [forum.wampserver.com]

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 1 time(s). Last edit at 04/11/2015 10:52PM by RiggsFolly.

Options: ReplyQuote
Re: 2 domains,same pc,both don't work
Posted by: sTimulated (---.plus.com)
Date: April 12, 2015 11:13AM

So apart from the localhost should be the first vhost my conf file looks ok?

I don't know if it is a limitation of apache2.0.63 but there is no /extra folder within my conf folder and no vhost line to uncomment.

Remembering way back we had problems with newer versions,I also needed php4 to work along side php5.
Steve did wonders to get it all working and it has been trouble free for years.
At one time I did use apache2.2.22 because that has /extra/httpd-vhosts.conf and is edited with my domain details but as said we needed to use 2.0.63.

Now I need to add some more domains......

And yes domain was pointed to my wan ip before any edits were done and no domain folders created.
Not sure why my original website suffered total failure but it did,even total windows reinstall and backup failed to bring website back alive.
Regardless of what happened I am back to being online and things working great again,with all those bad edits gone.

I'm doing all edits and folder making etc before I point and unpark this time.

Should I edit my conf file to be more like this.....

<VirtualHost *:80>
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
ErrorLog C:/wamp/www/logs/error.log
CustomLog C:/wamp/www/logs/access.log common
<Directory "c:/wamp/www">
AllowOverride All
Require local
</Directory>
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "c:/wamp/www/project1"
ServerName project1
ErrorLog C:/wamp/www/logs/project1_error.log
CustomLog C:/wamp/www/logs/project1_access.log common
<Directory "c:/wamp/www/project1">
AllowOverride All
Require local
</Directory>
</VirtualHost>

Or is my original conf ok?
I have not edited my host file yet,it should be like this?

127.0.0.1 localhost
127.0.0.1 stimulatedgaming
127.0.0.1 123
127.0.0.1 123/stats
127.0.0.1 abc

::1 localhost
::1 stimulatedgaming
::1 123
::1 123/stats
::1 abc



Edited 4 time(s). Last edit at 04/12/2015 11:24AM by sTimulated.

Options: ReplyQuote
Re: 2 domains,same pc,both don't work
Posted by: Otomatic (Moderator)
Date: April 12, 2015 11:20AM

Hi,

For Apache 2.0.63 (Obsolete) and Apache 2.2.22, "Require" directives does not work.
You must use Allow and Deny directives.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: 2 domains,same pc,both don't work
Posted by: sTimulated (---.plus.com)
Date: April 12, 2015 11:36AM

Otomatic Wrote:
-------------------------------------------------------
> Hi,
>
> For Apache 2.0.63 (Obsolete) and Apache 2.2.22,
> "Require" directives does not work.
> You must use Allow and Deny directives.


Yes,my install is way behind but I don't think my 'setup' works with newer versions.
2.2.22 is installed but not used afaik

So I should use.....

<VirtualHost *:80>
DocumentRoot "c:/wamp/www/123"
ServerName project1
ErrorLog C:/wamp/www/logs/123_error.log
CustomLog C:/wamp/www/logs/123_access.log common
<Directory "c:/wamp/www/123">
AllowOverride All
</Directory>
</VirtualHost>

I am not a coder,I just am copy/pasting.
If using the above is better/safer then I will make the edits.

Options: ReplyQuote
Re: 2 domains,same pc,both don't work
Posted by: sTimulated (---.plus.com)
Date: April 12, 2015 03:02PM

If I type my wan IP in my browser I get my wampserver homepage?



Edited 2 time(s). Last edit at 04/12/2015 08:42PM by sTimulated.

Options: ReplyQuote
Re: 2 domains,same pc,both don't work
Posted by: RiggsFolly (---.as43234.net)
Date: April 13, 2015 11:39AM

You should include the access criteria in a <Directory>...</Directory> assuming apache 2.0 allows that like this

<VirtualHost *:80>
    DocumentRoot "c:/wamp/www/123"
    ServerName project1
    ErrorLog C:/wamp/www/logs/123_error.log
    CustomLog C:/wamp/www/logs/123_access.log common
    <Directory "c:/wamp/www/123">
        AllowOverride All
        Order Allow,Deny
        Allow from all
    </Directory>
</VirtualHost>

Or use
   Allow from 127.0.0.1 localhost

For the localhost definition, so that localhost is only allow to be accessed from the PC running Apache.


Quote

If I type my wan IP in my browser I get my wampserver homepage?

Yes thats correct, as no domain is used in the url, apache should default to the first vhost which should be localhost.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: 2 domains,same pc,both don't work
Posted by: sTimulated (---.plus.com)
Date: April 13, 2015 06:27PM

Cheers Riggs,I'll us that with Allow from 127.0.0.1 localhost.

Any danger allowing my wampserver homepage to be seen?

Thanks

Options: ReplyQuote
Re: 2 domains,same pc,both don't work
Posted by: RiggsFolly (---.as43234.net)
Date: April 13, 2015 07:23PM

It wont be seen, by anyone other than you. If you use

Allow from 127.0.0.1 localhost

As that means any external IP will receive a "NOT ALLOWED ACCESS" message

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: 2 domains,same pc,both don't work
Posted by: sTimulated (---.plus.com)
Date: April 14, 2015 12:07AM

After trial and error finally got it working.
It now looks like this,Websites would only show if I used www com

<VirtualHost *:80>
DocumentRoot "c:/wamp/www"
ServerName localhost
ErrorLog C:/wamp/www/logs/error.log
CustomLog C:/wamp/www/logs/access.log common
<Directory "c:/wamp/www">
AllowOverride All
Order Allow,Deny
Allow from 127.0.0.1 localhost
</Directory>
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "c:/wamp/www/123"
ServerName ww w.123.com
ErrorLog C:/wamp/www/logs/123_error.log
CustomLog C:/wamp/www/logs/123_access.log common
<Directory "c:/wamp/www/123">
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "c:/wamp/www/123/Forum"
ServerName ww w.123.com/Forum
ErrorLog C:/wamp/www/logs/Forum_error.log
CustomLog C:/wamp/www/logs/Forum_access.log common
<Directory "c:/wamp/www/123/Forum">
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "c:/wamp/www/abc"
ServerName ww w.abc.com
ErrorLog C:/wamp/www/logs/abc_error.log
CustomLog C:/wamp/www/logs/abc_access.log common
<Directory "c:/wamp/www/abc">
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "c:/wamp/www/abc"
ServerName ww w.xyz.org.uk
ErrorLog C:/wamp/www/logs/xyz_error.log
CustomLog C:/wamp/www/logs/xyz_access.log common
<Directory "c:/wamp/www/xyz">
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>

What was the ServerAlias line for in my old vhost?

Options: ReplyQuote
Re: 2 domains,same pc,both don't work
Posted by: RiggsFolly (---.as43234.net)
Date: April 14, 2015 10:10AM

Can I suggest that you do a little reading of your own to find out how your environment actually works

[httpd.apache.org]

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: 2 domains,same pc,both don't work
Posted by: sTimulated (---.plus.com)
Date: April 14, 2015 08:23PM

Thanks for that,ServerAlias does what I thought it did but when I tested it without that line it worked which is why I asked.
Of course it did not work when I just tested it now,wamp homepage came up, so I've added the line
ServerAlias 123.com *.123.com and it seems to be working properly.

Initially this line is what confused me - ServerName project1 - I thought I could give it a relevant name instead of using ww w.123.com

I'd update my install but pretty sure newer apache/php versions don't work alongside php4

Thanks

Options: ReplyQuote


Sorry, only registered users may post in this forum.