简体   繁体   English

Windows男孩如何从* nix web开发开始?

[英]How best for a Windows boy to start with *nix web development?

I have been a Windows/M$ boy now for over 15 years and specialisted in web design for 10 years of that using Classic ASP and ASP.net. 我已经成为Windows / M $男孩超过15年,并且使用Classic ASP和ASP.net专门从事网页设计10年。 Trouble is all the latest funky languages that I want to play with (Django using Python, Rails, NitroJS) are *nix based and often run off Macs and all use Apache not a sniff of a IIS port/version. 麻烦是我想要使用的所有最新的时髦语言(使用Python,Rails,NitroJS的Django)都是基于* nix并经常运行Mac并且所有使用Apache而不是IIS端口/版本的嗅探。

I've played with Ruby on Rails alot as it runs happily on my XP Pro dev setup but when it comes to getting it up and running on a real live server using *nix I really really struggle. 我玩过Ruby on Rails很多,因为它在我的XP专业版开发设置中运行愉快,但是当它使用* nix在真实的实时服务器上运行并运行时,我真的非常努力。 I want to fill the void and hopefully straddle both camps but not sure where to start. 我想填补空缺,希望跨越两个阵营,但不知道从哪里开始。

How can I close the gap in my knowledge for getting web apps running on *nix systems? 如何才能缩小我在* nix系统上运行Web应用程序的知识差距? What do I need to know and where can I find out about it (books, links, etc.)? 我需要知道什么,我在哪里可以找到它(书籍,链接等)?

SSH, Tunnelling, chmod'ing...all greek to me :) SSH,隧道,chmod'ing ......对我来说都是希腊语:)

Edit: Thanks for all the great answers on this one, clearly struck a nerve. 编辑:谢谢你对这一个的所有好的答案,显然是一个神经。 Excellent advice all around. 各地的优秀建议。 I'm getting Ubuntu installed this weekend to have a play around, about time really :) 我本周末安装了Ubuntu来玩游戏,大约时间真的:)

It sounds like you need to get a handle on the *nix basics first. 听起来你需要首先处理* nix基础知识。 Everything else builds on that. 其他一切都建立在此之上。 For example, trying to configure your run-of-the-mill Apache with PHP/Python/Whatever setup will be pretty tough without that knowledge - if you can ssh into your server in the first place :) 例如,尝试使用PHP / Python配置您的普通Apache /如果没有这方面的知识,那将是非常艰难的 - 如果您可以首先进入您的服务器:)

With that in mind: http://www.amazon.com/Unix-Programming-Environment-Prentice-Hall-Software/dp/013937681X/ref=sr_1_1?ie=UTF8&s=books&qid=1262712609&sr=8-1 . 考虑到这一点: http//www.amazon.com/Unix-Programming-Environment-Prentice-Hall-Software/dp/013937681X/ref=sr_1_1?ie= UTF8& s= books& qid= 1262712609& sr=8-1 Oldie but goldie, and should be easily accessible to any programmer coming from other environments. Oldie但goldie,应该可以轻松访问来自其他环境的任何程序员。 Perhaps someone can recommend an updated version of this? 也许有人可以推荐这个更新版本?

I'd agree with some others here, that installing and actually using a *nix machine is a good place to start, if you want to get into *nix administration. 我同意这里的其他人的意见,如果你想进入* nix管理,安装和实际使用 * nix机器是一个很好的起点。 Even trying to host a simple FTP server will be a pain if you've never spent time with the systems. 如果你从未花时间在系统上,即使尝试托管一个简单的FTP服务器也会很痛苦。

If you have to choose, I'd advocate installing and using a linux distribution, rather than buying a Mac. 如果你必须选择,我主张安装和使用Linux发行版,而不是购买Mac。 Don't get me wrong; 别误会我的意思; I have nothing against Macs, but I've seen a LOT more linux servers than Mac servers. 我没有反对Macs,但我看到的Linux服务器比Mac服务器多了很多。 And I'm sure whatever client you're working with will appreciate you setting up a server with a free OS. 而且我确信无论您与哪个客户合作,都会感谢您使用免费操作系统设置服务器。

As others have mentioned, Ubuntu is a great distribution to play with, if you've never used Linux before. 正如其他人所提到的,如果您以前从未使用过Linux,那么Ubuntu是一个很好的发行版。 Once you've spent some time with Ubuntu, feel free to try out some other distributions, like Ubuntu Server Edition or Fedora . 一旦你花了一些时间在Ubuntu上,随意尝试一些其他的发行 ,如Ubuntu Server EditionFedora Oh, and make sure to back up your data before repartitioning your hard drive and installing Linux. 哦,并确保在重新分区硬盘和安装Linux之前备份数据。 That's important. 这很重要。

Once you are comfortable using Ubuntu (or whatever you install), one of the first things you're going to need to do is learn a few basic command line utilities. 一旦你习惯使用Ubuntu(或者你安装的任何东西),你需要做的第一件事就是学习一些基本的命令行实用程序。 This article from Oracle is a great place to start. Oracle的这篇文章是一个很好的起点。 If you want to learn a few more details, they have more articles in their series. 如果您想了解更多细节,他们的系列文章会有更多

If you ever run into troubleshooting issues running Linux, use the support forums . 如果您遇到运行Linux的故障排除问题,请使用支持论坛 They are an invaluable resource. 它们是宝贵的资源。 If you want some more formal reading (which you will), try Essential System Administration or Linux Administration for Beginners . 如果您想要更正式的阅读(您可以),请尝试使用Essential System AdministrationLinux Administration for Beginners I think both will be much cheaper and more up to date than some of the other books listed here. 我认为两者都会比这里列出的其他一些书更便宜,更新。

If you want to learn how to host a web server on a *nix machine, I would definitely recommend learning about system administration in general. 如果您想学习如何在* nix机器上托管Web服务器,我肯定会建议您学习一般的系统管理。 Sure, you don't need to know how to set up a cron job to host a web server, but it will make your life a lot easier in the long run. 当然,您不需要知道如何设置cron作业来托管Web服务器,但从长远来看,它将使您的生活变得更加轻松。


Other Details 其他详情

There is a partitioning tool available within Windows Vista and Windows 7 (and XP too?) that lets you repartition your hard drive. Windows Vista和Windows 7(以及XP也可以)中有一个分区工具,可以让您重新分区硬盘。 In Windows XP, you can find the partitioning tool at Start Menu > Control Panel > Administrative Tools > Computer Management > Storage > Disk Management. 在Windows XP中,您可以在“开始”菜单>“控制面板”>“管理工具”>“计算机管理”>“存储”>“磁盘管理”中找到分区工具。 Make sure you are viewing the Control Panel in Classic View. 确保您在经典视图中查看控制面板。 Once you've opened Disk Management, just right click on your main partition, and (after backing up data!) shrink your main partition. 打开磁盘管理后,只需右键单击主分区,然后(在备份数据后!)缩小主分区。 Now you've got some room to install Linux. 现在你有一些安装Linux的空间。

To install most Linux distributions, download the appropriate .iso file, burn it to a CD, and boot off the CD. 要安装大多数Linux发行版,请下载相应的.iso文件,将其刻录到CD,然后启动CD。 Use a program like ImgBurn to burn the file to a CD. 使用像ImgBurn这样的程序将文件刻录到CD。 From there, the installation is pretty simple. 从那里,安装非常简单。 Install Linux on whatever space you freed up earlier, while resizing partitions. 在调整分区大小的同时,在先前释放的任何空间上安装Linux。 If you notice Linux creating both a swap partition and a regular partition, don't worry; 如果您注意到Linux同时创建了交换分区和常规分区,请不要担心; that's totally normal (Windows makes a swap file, Linux uses a swap partition). 这是完全正常的(Windows生成交换文件,Linux使用交换分区)。

You'll find there is a 32 and 64 bit edition of almost all the distributions mentioned. 您会发现几乎所有提到的发行版都有32位和64位版本。 The 32 bit editions tend to be slightly more compatible with certain hardware and programs; 32位版本往往与某些硬件和程序稍微兼容; the 64 bit editions take advantage of your hardware much better. 64位版本更好地利用了您的硬件。 For example, I run the 32 bit version of Ubuntu on my desktop, because there is (unfortunately) only a 32 bit driver available for the wireless card in it. 例如,我在桌面上运行32位版本的Ubuntu,因为(不幸的是)其中只有一个32位驱动程序可用于无线网卡。 Also, Amazon only offers their MP3 downloader program (lol), necessary to buy music from them, for 32 bit distributions. 此外,亚马逊只提供他们的MP3下载程序(lol),这是从他们那里购买音乐所必需的32位发行版。 On my laptop, I run a 64 bit distribution, as it is much more able to take advantage of my limited hardware. 在我的笔记本电脑上,我运行64位分发,因为它更能够利用我有限的硬件。

Here's how I did it: 我是这样做的:

  1. Got a Mac, started using it as my primary off-hours workstation for experimental side projects: iPhone apps, Automator scripts, Cocoa stuff, Ruby. 有了Mac,开始将它作为我的主要非工作时间工作站用于实验性项目:iPhone应用程序,Automator脚本,Cocoa东西,Ruby。
  2. Installed Mono on MacOS, started writing the ASP.net stuff I was already comfortable with in the Unix environment. 在MacOS上安装了Mono,开始编写我在Unix环境中已经习惯的ASP.net内容。
  3. Little by little, I began to use Windows less. 渐渐地,我开始少用Windows。 I made sure all of my .net projects were Mono-compliant, so I could shuttle code back and forth between the platforms. 我确保我的所有.net项目都符合Mono标准,因此我可以在平台之间来回传递代码。
  4. Profit? 利润?

It's not so much about how you learn Unix as it is how do you, a regular person with a full-time job and a life, slowly wade into Unix without going insane. 这不是关于你如何学习Unix,而是你如何,一个有全职工作和生活的普通人,慢慢地涉足Unix而不会疯狂。

I would recommend that you install a UNIX on a machine or a VM and start getting your hands dirty. 我建议您在计算机或VM上安装UNIX,然后开始弄清楚。 Ubuntu is a popular Gnu/Linux distro which is fairly easy to install and quite straightforward. Ubuntu是一款流行的Gnu / Linux发行版,它易于安装且非常简单。

There are too many books that come to mind but what really moved me from my old DOS days to UNIX (Solaris first) was Kernighan and Pike's "Unix Programming Environment". 想到的书太多了,但真正让我从旧的DOS时代转到UNIX(Solaris第一)的是Kernighan和Pike的“Unix编程环境”。 It's a little dated now but it does give you some nice insights into how people do things in the UNIX world. 它现在有点过时,但它确实为您提供了一些关于人们如何在UNIX世界中做事的深刻见解。

Once you're okay with doing things on the command line (should take a few weeks I imagine), you can try to deploy a Rails project on your machine, search for links and just imbibe whatever you need to get the job done. 一旦你可以在命令行上做事(我需要几周时间),你可以尝试在你的机器上部署一个Rails项目,搜索链接,然后吸收你完成任务所需的一切。 I think that's more effective than sitting down with a single book and trying to read it beginning to end to understand UNIX. 我认为这比坐在一本书上并尝试从头开始阅读它以理解UNIX更有效。

Good luck. 祝好运。

Ubuntu linux is a pretty easy place to start: https://help.ubuntu.com/community/Installation Ubuntu linux是一个非常简单的起点: https//help.ubuntu.com/community/Installation

Having a good introductory book will help. 有一本好的入门书将有所帮助。 I found Harley Hahn's Guide to Unix/Linux very useful back when I started: http://www.harley.com/books/sg3.html 当我开始时,我发现Harley Hahn的Unix / Linux指南非常有用: http//www.harley.com/books/sg3.html

I'm in awe of how easy the ubuntu people have made things and having your own linux install to play with really helps. 我很敬畏ubuntu人们制作东西并拥有自己的linux安装非常容易。

A possible path into using linux at home: 在家中使用linux的可能途径:

  • Install Ubuntu from bootable CD 从可启动CD安装Ubuntu

    • download ISO file under windows 在windows下下载ISO文件
    • burn ISO file to CD under windows - use whatever software you like to do this 在Windows下将ISO文件刻录到CD - 使用您喜欢的任何软件来执行此操作
    • boot CD (ensure your BIOS lets you boot from CD) 启动CD(确保您的BIOS允许您从CD启动)
    • use CD to repartition windows machine so the unused space can accomodate Ubuntu 使用CD重新分区Windows机器,以便未使用的空间可以容纳Ubuntu

      • I've done this with windows vista on my laptop and was stunned by how easy it was to do... (Naturally, you should back up everything important on the laptop first of course...) 我已经在我的笔记本电脑上使用windows vista完成了这项操作,并对它的操作非常容易感到惊讶......(当然,你应该首先备份笔记本电脑上的所有重要信息......)
    • use the CD's option of inserting a boot menu that lets you choose windows or Ubuntu 使用CD的选项插入一个启动菜单,让您选择Windows或Ubuntu
  • install apache - will help you learn about web admin / sys admin 安装apache - 将帮助您了解web admin / sys admin
  • install php - will give you something a bit fun to play with 安装PHP - 会给你带来一些有趣的东西
  • try writing some basic bash scripts - like .bat files but far more powerful and a good starting point for sys admin concepts 尝试编写一些基本的bash脚本 - 比如.bat文件,但功能更强大,是sys管理概念的一个很好的起点

Since the early challenge will probably be using a command line interface, I would suggest starting with bash scripting; 由于早期的挑战可能是使用命令行界面,我建议从bash脚本开始; it's an easy language to pick up and similar to (but much more powerful than) DOS batch scripts. 它是一种易于学习的语言,与DOS批处理脚本相似(但功能更强大)。 Bash will get you started on the command line since it will make heavy use of both common and uncommon commands. Bash会让你开始使用命令行,因为它会大量使用常用命令和非常用命令。 This is an excellent guide for bash: http://tldp.org/LDP/abs/html/ 这是bash的优秀指南: http//tldp.org/LDP/abs/html/

A virtual machine is pretty much essential whether you're on Windows or Mac OS. 无论您使用的是Windows还是Mac OS,虚拟机都非常重要。 I use VirtualBox (free), but Parallels is also good (though commercial). 我使用VirtualBox(免费),但Parallels也很好(虽然商业)。 This will allow you to set up just about any type of linux/windows machine and destroy them with impunity. 这将允许您设置几乎任何类型的Linux / Windows机器并肆意破坏它们。

If you're looking to dip your toe in the pool, Cygwin is a good option. 如果您想在泳池中嬉戏,Cygwin是个不错的选择。 You can install it on you Windows box and begin learning the command line on a system that you're already familiar with. 您可以将它安装在Windows框中,并开始在您已熟悉的系统上学习命令行。 It gives you access to so many of the great *nix command line tools (less, tail, ssh, etc.). 它使您可以访问许多优秀的* nix命令行工具(less,tail,ssh等)。 It also gives you a way to use those tools on the Windows box that you use all day, every day. 它还为您提供了一种在Windows框中使用这些工具的方法,这些工具每天都在使用。

I still use it regularly when I have to use a Windows machine (SSH'ing into localhost is so much more powerful than launching a DOS command prompt) and when I finally switched away from Windows, I was so much better prepared because I'd been using the CLI and many of its tools regularly for quite a while. 我仍然经常使用它时,我不得不使用Windows机器(SSH'ing到本地主机的所以比发射一个DOS命令提示符下变得更加强大),当我终于从Windows切换的时候,我是这么多更好的准备,因为我一直在使用CLI及其许多工具。

The book Running Linux is great. 运行Linux这本书很棒。 A very handy reference when using Linux. 使用Linux时非常方便的参考。

Takes you from basic command line usage to administration and programming. 从基本命令行使用到管理和编程。 Covers pretty much everything you need to know. 几乎涵盖了您需要知道的一切。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM