hosting 2nd domain with Wampserver 64
Posted by: michaelmoody (---.2-4.cable.virginm.net)
Date: April 17, 2018 05:08PM

I host a WordPress website on my own PC at home www.moodyimage.co.uk using Wampserver64, I have broadband and simply got my domain provider to point their DNS at the IP address of my Virgin Media router, added a rule to let port 80 through the route fire wall and all worked fine,
I have added a second WordPress website on my PC “langridge” which works fine locally after adding entries in my hosts file
192.168.0.15 localhost
192.168.0.15 langridge
And to the httpd-vhosts file a second Virtual host entry
<VirtualHost *:80>
ServerName langridge
ServerAlias langridge
DocumentRoot "${INSTALL_DIR}/langridge"
<Directory "${INSTALL_DIR}/langridge/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
But how do I get www.langridgephotography.com (currently parked) to point to this second instance on my PC?
Do I use a different port? or do I just get the DNS for my second site to point to the same IP address and Apache is clever enough to point each domain name at the right WordPress instance on my PC ?
Thanks, Michael…..

Options: ReplyQuote
Re: hosting 2nd domain with Wampserver 64
Posted by: RiggsFolly (Moderator)
Date: April 17, 2018 11:34PM

Apache looks at the incoming domain name and uses that to decide which site to serve by matching it to a ServerName or ServerAlias in your VH definitions.
So amend the VH to use the correct domain name

So for example change the VH to be

<VirtualHost *:80>
    ServerName langridgephotography.com
    ServerAlias www.langridgephotography.com
    DocumentRoot "${INSTALL_DIR}/langridge"
    <Directory "${INSTALL_DIR}/langridge/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Then get the domian name pointed to your routers WAN ip as before

Then change your HOSTS file to

127.0.0.1 langridgephotography.com
::1 langridgephotography.com

so that you can still server the site locally, if that what you want

Now when you use the domain name `langridgephotography.com` in your local browser you will server your site locally and when requests come from the internet they will also server the correct site.

---------------------------------------------------------------------------------------------
(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


Sorry, only registered users may post in this forum.