Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Web development without internet?
4 points by hella on Dec 28, 2010 | hide | past | favorite | 8 comments
Let me preface this: I'm a noob.

Now: I've only ever developed by coding in eclipse, then uploading files via FTP to a domain. (Then I see the changes just by visiting the domain.)

I now this is probably a shitty way to do this. How should I be doing this? How can I develop even when I don't have internet? (In other words, how can I run/try website code without FTP/internet?)

Please be as detailed and creative as you'd lke.




- Use a distributed version control system. Set up f.ex. a Mercurial repository on bitbucket.org and start using it right away. You can commit changes offline (locally) without access and have control over your source revisions even if you don't push it to the repository. If you have no idea what I'm talking about, toread: http://en.wikipedia.org/wiki/Distributed_revision_control and http://hginit.com

Revision control is not technically needed to work, but you'll need it anyway ;) so start using right away

- Set up a local server, possibly a popular one for your technology of choice (keywords: localhost, apache, nginx, etc.) Set up database systems of you choice (mysql, postgresql, sqlite).

- Commit often, push when sure.

- On your remote server, grab code from your repository (clone it) to your working directory. Pull/update changes manually or set a cron job to do it from time to time, so you got your working copy online (better update manually if it's on production).

- Always keep a separate file for your localhost project settings, which you don't commit to the repository (ignore), so everything works fine with your settings locally, but works with another settings on the remote server.

good luck


These days, I typically edit stuff live on the hosting site. But I used to routinely write code offline by hand in Notepad, save a jillion different versions (mypage; mypage1; mypage1a; mypage1b; mypage2; mypage2a...etc...for versioning) and then only upload the one I liked at the end. I think I largely stopped doing that after I began using so many "includes" files because you really can't tell what it will look like without them. Now, I seem to be transitioning most of my sites to Wordpress, and, as far as I know, that also can't really be coded offline (though I guess I could write drafts of new content offline, so far, I really haven't).

If you are willing/able to code in Notepad, all you have to do is save it as .html instead of .txt and it will open as a webpage in your browser, without any internet access. It makes for a cool little sandbox.


when you develop on a "domain", you put the files on a server, which is a computer running a webserver (like apache e.g). a webserver is nothing but a program. so you can install a webserver (and database server, whatever you need) on your own computer as well. this way you can skip the ftp uploading part, which takes a lot of time. you only have to put the files you are working on, in a directory which the webserver handles. so if you save a file you can reload the browser...

this is a tutorial for installing apache on windows: http://httpd.apache.org/docs/2.0/platform/windows.html

hope that helps, martin


And if you want an easy WAMP stack, get wampserver: http://www.wampserver.com/en/


I wish I had found this a week ago. I just got finished setting up PHP, MySQL, and Apache on Windows 7 manually.


How does that compare to Uniserver and XAMPP?


I run a local dev environment with php and apache (mamp for os x). I also run mongodb locally, works like a charm.


UNIX: edit /etc/hosts

Windows: %SystemRoot%\system32\drivers\etc\hosts

Set foo.local to 127.0.0.1




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: