Wamp Wordpress Domain redirecting remote pc to localhost
Posted by: chancezj (---.hsd1.ms.comcast.net)
Date: January 01, 2021 09:38PM

I've been trying to setup a live site with wamp and various configurations for a week and I'm stuck. Please help. Here is my configuration:

1 - Window 10 64 bit
2 - WampServer 3.2.3 64bit
3 - Apache 2.4.46
4 - PHP 7.3.21
5 - MySQL 5.7.31
6 - Green Icon

I already had 2 live IIS sites running on ports 80 & 81. SiteA.com=80 SiteB.com=81

I've successfully installed a fresh installation of WAMP with a wordpress & woocommerce site w/a new install of myphp configured to port 8080. I can pull up the wamp server page on [localhost]

My woocommerce site, is located at C:\wamp64\www\SiteC set up with a virtual host for SiteC.com

<VirtualHost *:8080>
ServerName sitec.com
DocumentRoot "c:/wamp64/www/sitec"
<Directory "c:/wamp64/www/sitec/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>


I can access it locally at SiteC.com:8080 but my problem is setting it up with my domain name and accessing it externally.


Lets say my IP is 44.33.22.11
My domain name is forwarded to 44.33.22.11:8080/sitec

When I enter the URL sitec.com from a remote pc it errors because it's trying to open localhost:8080/sitec/ on the remote computer and fails. How do I fix this?



Edited 6 time(s). Last edit at 01/03/2021 10:35PM by chancezj.

Options: ReplyQuote
Re: Configuration Help Needed
Posted by: RiggsFolly (Moderator)
Date: January 01, 2021 10:36PM

Hi

Are you using a Dynamic DNS or have you actually purchased sitec.com and pointed the DNS to your IP Address?

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.2.4 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.19>

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 01/01/2021 10:36PM by RiggsFolly.

Options: ReplyQuote
Re: Configuration Help Needed
Posted by: chancezj (---.hsd1.ms.comcast.net)
Date: January 01, 2021 10:44PM

Hello. First thanks for helping. I have purchased the domain from ionos.com and forwarded it to my WAN IP and port 8080. Port 8080 is forwarded on my router to my server IP. Firewalls and antivirus are off.

Options: ReplyQuote
Re: Configuration Help Needed
Posted by: chancezj (---.hsd1.ms.comcast.net)
Date: January 01, 2021 10:47PM

I don't understand why the server is directing the remote pc to their own localhost:8080. I don't have anything in the hosts files of either pc.

Options: ReplyQuote
Re: Configuration Help Needed
Posted by: RiggsFolly (Moderator)
Date: January 01, 2021 11:07PM

I assume you still have a locahost defined in your httpd-vhosts.conf file?
I also assume that the locahost VH definition is the first definition in the hosts file?

If so it sounds like there is something wrong with the definition of sitec.com, Apache will default to the first definition in the HOSTS file if it cannot find a well defined VH for what it is looking for.

You can test this suposition by changing your hosts file to have the sitec.com as the first definition, if that starts to work, then this is the issue. All we then need to do is find the issue in the sitec.com definition

You might show us your full httpd-vhosts.conf file as well please.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.2.4 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.19>

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: Configuration Help Needed
Posted by: chancezj (---.hsd1.ms.comcast.net)
Date: January 02, 2021 03:02AM

Here's my files:
httpd-vhosts.conf

# Virtual Hosts
#
<VirtualHost *:8080>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>



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

Options: ReplyQuote
Re: Configuration Help Needed
Posted by: chancezj (---.hsd1.ms.comcast.net)
Date: January 02, 2021 03:05AM

Here's my httpd.conf (removed - there was nothing of significance there).



Edited 2 time(s). Last edit at 01/03/2021 10:33PM by chancezj.

Options: ReplyQuote
Re: Configuration Help Needed
Posted by: chancezj (---.hsd1.ms.comcast.net)
Date: January 02, 2021 03:13AM

windows hosts file - nothing of significance here


Server hosts file:
127.0.0.1 localhost
127.0.0.1 sitea.com
127.0.0.1 siteb.com

remote hosts file:
127.0.0.1 localhost



Edited 1 time(s). Last edit at 01/03/2021 10:34PM by chancezj.

Options: ReplyQuote
Re: Configuration Help Needed
Posted by: RiggsFolly (Moderator)
Date: January 02, 2021 12:21PM

Morning

Right, so the HOSTS file is used Only to seed the Windows DNS Cache and as such affect only the PC that hosts file exists upon. So it has no relevance to accessing sitec.com from a remote location. So it does not matter that its not in the HOSTS file.

Ahh hang on, woocommerce that sits on top of WordPress, so I bet you installed your wordpress and woocomerce using `localhost:8080/sitec/`
Wordpress remembers this and stores this in its database, and uses that to generate internal links.

If you tell me your real site name (send a Private Message if you like) I can preobably check that with a simple homepage page view

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.2.4 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.19>

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: Configuration Help Needed
Posted by: chancezj (---.hsd1.ms.comcast.net)
Date: January 02, 2021 06:29PM

Ah I think you're right. My wordpress site url was http:// localhost:8080/sitec


I've changed the site url to http:// sitec.com and restarted everything but then it couldn't find the site even on localhost.

Can you give me an example of what it should be? I'll have to google it a bit to troubleshoot but that pointed me in the right place. Thank you



Edited 2 time(s). Last edit at 01/02/2021 06:32PM by chancezj.

Options: ReplyQuote
Re: Configuration Help Needed
Posted by: RiggsFolly (Moderator)
Date: January 02, 2021 06:54PM

Not sure I can, I am not a WordPress expert

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.2.4 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.19>

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: Configuration Help Needed
Posted by: chancezj (---.hsd1.ms.comcast.net)
Date: January 03, 2021 10:31PM

Thanks for your help RiggsFolly. I don't think this is the best solution but I've got it up and going now.

Solution: I changed the wordpress site path to match the same WANIP and directory that I have in my domain name forwarding:
http:// 44.33.22.11:8080/sitec

I also had to install a wordpress plugin to rename all instances of localhost:8080 in my phpmyadmin database to change all instances of localhost:8080 to 44.33.22.11:8080.

I don't understand why wordpress doesn't just use the relative directory path of the site for it's default image & file urls but whatever. As long as it works.



Edited 4 time(s). Last edit at 01/04/2021 12:59AM by chancezj.

Options: ReplyQuote
Re: Configuration Help Needed
Posted by: RiggsFolly (Moderator)
Date: January 05, 2021 09:54AM

Glad you have something that works.

Small Point, phpMyAdmin is not a database, its a tool written in PHP to make maintaining a MyQSL database more user friendly.

I would have gone with a VH with the ServerName of sitec.com and then change wordpress to use that as the url, but whatever

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.2.4 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.19>

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.