How to set up local server for development?

心不动则不痛 提交于 2021-02-07 14:54:49

问题


I have a computer that's running Windows 7, that I do most of my development on. I have a spare laptop running Ubuntu. They are both connected to the same wifi, and I'm developing in Rails. Is there a way that I can use my spare laptop (Ubuntu) as a local server for development and testing that I would be able to connect to through my other computer (Windows 7)?

If it's not possible, how would I use my computer (Windows 7) as a local server for testing in Rails? I have XAMPP installed, I just don't really know how to use it.


回答1:


First Install LAMP in Ubuntu. This is one of the thousands of links that explain How to do it. https://help.ubuntu.com/community/ApacheMySQLPHP

Second Add Sites to Ubuntu Server. Again this is one of the many links that explain how to do it. http://tuxtweaks.com/2009/07/how-to-configure-apache-linux/comment-page-1/#comment-1984

Finally open your server only locally,I mean Localhost for your home network. To do that edit the file /etc/hosts and add at the end of the file

127.0.0.1  mysite

replace "mysite" for the name of your site and reload apache

sudo /etc/init.d/apache2 reload

You can access to http://mysite from any computer in your home network



来源:https://stackoverflow.com/questions/11276916/how-to-set-up-local-server-for-development

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!