I'm toying with a new setup at home, and not sure if what I'm trying to do is possible or not.

I've got my domain's DNS pointed to my WAN IP and being answered by Apache on an Ubuntu 14.04 server on port 80 and everything there works fine. However, I want to mix it up a little bit and here's what I would want to accomplish.

Virtual hosts running on the apache server listening on name-based routing. Something like:

wp.me.com -> forwarded to my Ubuntu server and fed Wordpress from Apache
fw.me.com -> forwarded to server and redirected to to access my firewall
wifi.me.com -> forwarded to server and redirected to to access WiFi
dev.me.com -> forwarded to server and fed from a separate directory in Apache

Is this something I can accomplish with VirtualHosts?


Yes you can,

The first VirtualHost will point to your Wordpress site, the other VirtualHosts will be setup as Reverse Proxy to your other internal devices.


<VirtualHost *:443>
    Servername fw.me.com
    ProxyPass /
    ProxyPassReverse /

See http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

And if you are exposing your internal stuff to the outside world, make sure you properly secured your Apache (ie. username/password protection, IP level access etc.)

  • I would assume the user has a sub domain fw to work this out ? and instead of sub domain can it be different URL example: http://me.com/fw – Ciasto piekarz Jan 29 '17 at 17:51

This can also be done with apache rewrite rules for cases when you are not forwarding tomcat as described by Lambert.

RewriteCond %{HTTP_HOST} ^wp.me.com$

RewriteRule ^(.*)$ http://your.apache.wordpress.com/$1 [R=301,L]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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