0

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.

5
  • "registered domain name pointing to my ip address" - well, 127.0.0.1 is the address to your own computer. In your local network this computer might have an address like 192.168.0.1. In real world your ip address will be something completely different and will change everytime you 'go online'. It's not a trivial task to host your own server. It might be better to host your site on a real dedicated web-server? Commented Apr 8, 2018 at 23:53
  • I have a static IP @Jeff Commented Apr 8, 2018 at 23:54
  • Do you reach your site by ip only (without domain)? Commented Apr 8, 2018 at 23:56
  • I can reach sites in htdocs with IP or domain, but not ones I placed in E: drive. @Jeff Commented Apr 8, 2018 at 23:58
  • Please post your solution as an answer of its own, not as an edit. Commented Apr 22, 2018 at 17:55

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

it said on mine "You don't have permission to access", already changed permissions

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.