PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, September 21, 2022

[FIXED] How to add public virtual host in Apache 2.4 with WAMP

 September 21, 2022     apache, php, virtualhost, wampserver     No comments   

Issue

I have an Apache server that handles two virtual host on port 8080, one is private (localhost) and a second one is public (internet). The private virtual host works fine but the public keeps redirecting all public requests to the localhost and I'm not sure what I'm doing wrong. Please help! Below is the httpd-vhost.conf file:

# Virtual Hosts

<VirtualHost *:8080>
ServerName localhost
DocumentRoot c:/wamp64/www
<Directory  "c:/wamp64/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
</Directory>
</VirtualHost>

<VirtualHost *:8080>
ServerName mydomain.com
DocumentRoot c:/wamp64/www/App
<Directory  "c:/wamp64/www/App/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require all granted
</Directory>
DirectoryIndex index.html index.php
</VirtualHost>
#

Also, this is running WAMP / Magento on Windows Server 2012 and hosted in Azure. Thanks a lot!


Solution

I found that the virtual host was configured correctly and the re-directing problem was in MySQL Magento Db, which was pointing to the localhost:8080. I changed core_config_data under web/unsecure/base_url and web/secure/base_url to my public domain and it worked fine. I posted this answer in case someone else lands here with a similar problem. Thanks



Answered By - Jacman
Answer Checked By - Timothy Miller (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing