apacheurlxamppvhostsmklink

How to browse to website outside of htdocs from remote computer


I have read other answers here on this site, but they only answer part of my question. I have XAMPP for Windows 7.2.0-0 on my computer. I have partitioned my hard drive to add an E: drive. My htdocs folder is in C: drive and I have a FQDN pointing to my ip address; say (example.com).

Next I created a directory in E: named 'me'; which contains all the files for a functioning website.

Now, after following all the directions from cmcculloh, I can just type me.example.com in my browser and up pops the website, but this URL does not work from any other computer. Could someone help me to understand how I need to configure The 'httpd-vhosts.conf' & 'hosts' files; along with, what the proper URL address should be to view the website located in 'E:me' from a remote computer.

Here is what I have done in 'httpd-vhosts.conf':

    <VirtualHost *:80>
           DocumentRoot "E:/me"
           ServerName me.example.com
           ServerAlias me.localhost
           <directory E:/me>
             Require all granted
           </directory>
           ErrorLog "E:/me/logs/error.log"
           TransferLog "E:/me/logs/access.log"
    </VirtualHost>

I have tried many different variations with the server name and alias but none work any better.

Here is what I have done in 'hosts':

    127.0.0.1    me.example.com

Like I said this works in the browser of the computer that the server is on, but trying to view this site from another computer I get "This site can't be reached" "me.example.com's server IP address could not be found".

Am I 'barking up the wrong tree' by approaching it like this, or should I be researching how to add the contents of a separate drive to the htdocs folder. I am at a loss as to how this can be achieved. My hard drive is near full and I need to add more storage space, but have to figure this out before I purchase more hardware.


Solution

  • Solution by OP.

    To accomplish my goal of accessing the pages from a remote computer I had to use the command mklink /J. The example below created a directory named 'my' in my 'htdocs' linking to everything on my 'E:' drive.

        mklink /J C:\xampp\htdocs\my E:
    

    The only thing I don't like about it is that in order to view the webpage in E:/me, I have to type the URL example.com/my/me instead of example.com/me. I know it's not a big deal having to type the extra directory 'my' in the URL, but I just don't like the look of it. Also this negates the need to add 'VirtualHosts' and 'mapping'; although, I may have to do that anyway with '.htaccess' to keep users from accessing directories other than theirs.