4

I am trying to upgrade my server on a home network, supporting a few personal and club websites.

The issue:

  • An aging legacy server running in an internal network (that includes several personal use computers). The server supports two public domains, under a single IP address.
    For example: example1.org and example2.net, under IP address 170.101.32.5
  • The legacy server supports several custom-built server-side applications that are still being used. Conversion of these apps (to PHP) will take a few months.
  • The internet connection is via FIOS (static IP address).

The goal:

  • Upgrade to a new (Apache/mySql/PHP capable) server.
  • Since app conversion will take several months, a staged upgrade will be used.
  • Thus: during the upgrade process both machines (legacy and new) should be operational
Note that:
  • The legacy server does not run Windows or Linux; and is not running Apache.
  • The apps are built using older languages (not PHP, and not .NET).
  • Hence simply swapping in a new machine won't work

After several hours of testing, I provide an answer below.

1 Answer 1

3

I used Windows 10 PC with WAMP version 3.2.6_x64 (Apache 2.4.51) The legacy server will continue to use port 80, and the new server will use port 8080

The following lists the several steps I used to achieve the desired solution. For now I kept it simple: IPV4 support, http: (no SSL support). None of the steps are complicated, but getting them all right took some time.

Step 1 : Modifying Windows

The following assumes that you were able to successfully install Windows, with a stable connection to the internet. That uses DHCP to obtain an internal IP addresss. And that you installed WAMP, and that it works locally.

For example: `http://127.0.0.1/` will display server information (using a  phpInfo() type of format).

1a: Assign a static IP address to the new server using Windows Settings

Network and Internet -> ethernet Click on box that appears -- could have text Network connected

Set network profile to public

Then scroll down to ip settings, and click edit.

Several input boxes appear ...

In the first box:

  • change to Manual

Several new input boxes are shown:

  • IPV4: turn on. For now, I did not turn on IPV6

  • IP address: A static internal address. For example: 192.168.1.4. This static address is used in the modifying router step below

  • Subnet prefix length: Set to 24. Note that I did not need to specify a 255.255.255.0 subnet mask.

  • Gateway: could be 192.168.1.1 -- I did not change this field.

  • Prefered DNS: I entered the DNS that associated with my FIOS account. But 192.168.1.1 (the default) also worked.

And then Save

1b: Windows firewall modification.

Hint: to find it type "firewall" in the search box, and select "Windows Defender Firewall"

  • Guest or public networks: set to connected

  • Under Advanced settings -> inbound rules -> new rule type of rule: port

  • apply to: tcp
  • All ports? Specific ports: 8080
  • Select the Allow the connectionradio button,
  • When does this rule apply: check all 3 boxes (or maybe just check public box)
  • name and description as you see fit
  • Click Finish

    This required clicking Next a few times. After Finish, the name of this new rule will appear in the list of inbound rules.

  If you want to enable ping, under the existing inbound rules find and enable
    File and Printer Sharing --  Echo Request (ICMPv4-IN)
  I enabled both the <i>Domain</i> and  <i>Private. </i> versions of this rule.

You might have to reboot Windows after these changes. Make sure it works (that the internet connection is stable)

Notes:

  • Since Microsoft is annoying about constantly changing the Windows setting menu structure, you may have to search for some of these. The windows search box can be helpful.

  • Hint: from a windows command prompt, C:>ipconfig /all will show current IP settings (such as the Default Gateway and DNS Server).

  • As of March 2022 WAMP (version 3.2.6_x64) installation required installing several Microsoft redistributables. The links are listed on the Wamp installation screens. Downloading and installing them was tedious but not difficult

  • As suggested elsewhere, you need to be sure nothing conflicts with your http ports. For example, Skype or IIS. See Upgraded to Windows 10 ... for some useful tips (on using netstat -aon)

Step 2: Modifying the router

These details are specific to my internet setup: static Verizon Fios, using a 2 year old Fios-G1100 router. I logon to it from an internal PC using 192.168.1.1

2a: set up a Port Forwarding Rule

Advanced -> Network Setting -> Port Forwarding Rules -> Add

  • Service Name: httpAlt. You can use whatever word you want, it will be used in the next step

  • Service description: something descriptive

  • Click on Add Server Ports

  • Protocol: TCP
  • Source ports: Any
  • Destination ports: Single
  • In the input box that appears: 8080
  • Click Apply (save these specifications)

  • Click Apply (save this rule)

The list of Port Forwarding Rules will now contain a httpAlt row (or whatever Service Name you chose).

2b: Assign a Port Forwarding Rule to an internal IP address

o back to Main, click on Port Forwarding.

  • Under Create new port forwarding rule:
  • In the Select IP from menu dropdown menu
  • Chose the static IP address you assigned to the new machine (using the above setup: 192.168.1.4) Thus: you need to set the static IP address (on the new server) BEFORE this step --the router looks for existing IP addresses (in the local network)!
  • In the Application to forward dropdown menu Select httpAlt (or whatever Service Name you specified above)
  • Click the Add button

2c: To avoid possible DHCP clashes with the new (and old) server (that both use static internal IP addresses)

Advanced -> Routing .. IPv4 address distribution

In the row with DHCP Server in the Service column: click Edit

  • Set the Start IPV4 address. Say to 192.168.1.6

  • Note that the static IP address assigned to the new server ( 192.168.1.4) is less than the Start IPV4 address 192.168.1.6

  • Click Apply

  • Click Close

Step 3) Modifying Wamp and Windows configurartion files

I installed wamp under D:\wamp64. So if WAMP is installed somewhere else, change D:\wamp64 accordingly.

3a) Edit apache conf file

This can be found at D:\wamp64\bin\apache\apache2.4.51\conf where 2.4.51 is the apache version installed.

  • Changing the <Directory >

    Find the block that begins with <Directory /> and change to:

       <Directory>
       # AllowOverride none
       #  Require all denied
       Options FollowSymLinks
       AllowOverride None
       Order deny,allow
       Allow from all
       </Directory>
    

If you do not do this (if you do not have an Allow from all or similar line) -- 403 responses will be returned. I assume this can also be set by using .htaccess files?

  • Changing ports Apache will watch

    Find the Listen line and add

    Listen 8080

    Note that a preexisting Listen 0.0.0.0:80 means all ip addresss using port 80.

    It seems that Listen 8080 is a shortcut for Listen 0.0.0.0:8080 ?

  • Make sure the following lines are enabled (do not start with #)

     LoadModule vhost_alias_module modules/mod_vhost_alias.so
     Include conf/extra/httpd-vhosts.conf
    

3b: Edit httpd-vhosts.conf

Add to `d:\wamp64\bin\apache2.4.51\conf\extra\httpd-vhosts.conf`

<VirtualHost *:8080>
  ServerName example1.org
  ServerAlias example1.org *.example1.org
  ServerAdmin [email protected]
   DocumentRoot "D:/www1"
  <Directory "D:/www1">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require all granted
  </Directory>
</VirtualHost>

<VirtualHost *:8080>
  ServerName example2.net
  ServerAlias example2.net *.example2.net
  ServerAdmin [email protected]
   DocumentRoot "D:/wwwOther"
  <Directory "D:/wwwOther">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require all granted
  </Directory>
</VirtualHost>

Notes:

  • CAUTION: you must use / (not \) in DocumentRoot and Directory!! I wasted 45 minutes because I forgot this.

  • D:/www1 should contain the content for the example1.org domain

  • D:/wwwOther should contain the content for the example2.net domain

  • As noted in ServerName directive: *.a.b means all subdomains of a.b

Note: something like the following may already exist. I left it in (to support local testing):

    <VirtualHost *:80>
     ServerName localhost
     ServerAlias localhost
     DocumentRoot "${INSTALL_DIR}/www"
     <Directory "${INSTALL_DIR}/www/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
       AllowOverride All
       Require local
    </Directory>
   </VirtualHost>

3c: Edit Windows host file

For ease of internal testing, one can add lines to C:\windows\system32\drivers\etc\hosts This will resolve the ipname to an ip address -- its a check this first dns. But it might not work with Firefox.

For example:

127.0.0.1 localhost
192.168.1.4 myStuffLocal.org

Note that C:\windows\system32\drivers\etc\hosts. can only be modified by an administrator. I used Notepad in admin mode (RMB on the Notepad icon).

Restart Wamp, or to be sure restart Windows. Then go to some other computer (perhaps one not on the same internal network) and try it out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.