Direct url-access to my projects on vmWare/Debian 6 / Apache2 from Windows 7
Direct url-access to my projects on vmWare/Debian 6 / Apache2 from Windows 7
I am a web-programmer and I was looking for a solution to host my local projects on Linux, working from Windows 7.
So I installed VMWare Workstation, and created a virtual machine with OS Debian 6 Squeeze. After that I configured the internet connection with NAT, setup apache2, mysql and php.
Now I can access my sites from Windows by IP "http://192.168.195.222/somepoject" or by hostname (I edited hosts file in Windows) "http://myvirt/somepoject" and all seems great. But the problem is that I want to access every project (for which I created a virtual host in Debian) directly by its hostname (hostname of virtual host), for example "http://someproject.local" instead of "http://192.168.195.222/someproject".
1 Answer
1
I thinks you want to have an absolute URL for each project on localhost.
If true, you can set any project on specific port.
For this, input this code in your httpd.conf :
For project one:
<VirtualHost 127.0.0.1:8080>
DocumentRoot /home/poject1
</VirtualHost>
Listen 127.0.0.1:8080
For project two:
<VirtualHost 127.0.0.1:9090>
DocumentRoot /home/poject2
</VirtualHost>
Listen 127.0.0.1:9090
Finally, you can access to project one with /home/poject1 root path, with this URL:
http://127.0.0.1:8080/
And you can access to project two with /home/poject2 root path, with this URL:
http://127.0.0.1:9090/
Thanks
Hi, thank you for your solution! I configured httpd.conf like you said. Now i can access my project in debian by url 127.0.0.1:8080 but I still cannot access it from Windows by url 192.168.195.222:8080 What should I do?
– Void Floyd
Nov 26 '12 at 0:20
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Don't forget the hosts file, he is on Windows 7.
– Samantha P
Nov 25 '12 at 23:27