pannix wrote:
What are the advantages and disadvantages of installing from source versus from repository versus from ppa?
- repository: easy, reliable, old version,
- ppa: easy, recent version
- source: difficult, recent version, DIY,
When installing from repository or ppa and choosing the nginx-full or nginx-extras, you pretty much have everything installed that you could possibly need. That is how I see it, for later versions when I know what I need and not, I can always switch to installing from source.
On production systems based on a well-maintained binary-based Linux distribution such as Debian and Ubuntu, it is generally a bad idea to compile your own programs if there's already the same program in the repository. Self-compiled programs are difficult to keep up-to-date, because you need to watch each of the official web sites for security updates. This is particularly important for Internet-facing programs such as nginx, and web programming languages such as PHP. Packages in the repository often look old, and they actually are old when it comes to features. But they usually incorporate many of the bug fixes and all of the security fixes found in later versions. (Even PPAs often fall behind on security updates. Choose your PPAs carefully. Check that the maintainer has a history of keeping his PPA up-to-date.)
Also, Self-compiled programs may be more difficult to troubleshoot, because you might experience crashes that nobody else is experiencing. If a program from the repository crashes, on the other hand, lots of people will end up having the same experience and it will be much easier to look up the issue on Google. Moreover, self-compiled programs might break when other programs and libraries from the repository are updated, especially when upgrading your OS to the next version.
Benefits of compiling include having access to more recent versions, and perhaps a bit more performance due to being optimized for your machine's architecture. But you need to weigh the pros and the cons. Sometimes the programs you need might not be in the repositories at all. I used to compile APC and PHP-Memcached before they became officially included in Debian and Ubuntu. I also used to compile Redis, but I don't need to do that anymore, either. I still need to compile PHP-Redis.
pannix wrote:
I have been learning with Ubuntu server. Are there any advantages for switching to Debian?
Debian is usually considered more stable, but in reality there is very little difference between Debian and Ubuntu on the server. Most of the difference that people talk about have to do with the graphical interface, which is largely irrelevant in a server. So it comes down to preference.
For example, I prefer Debian because that's what I've been using for the last few years. The last time I set foot in an Ubuntu machine, I found it annoying that it tried to steer me away from calling init scripts directly. But the init scripts still work fine, and someone who is used to recent Ubuntu versions might find it more intuitive to call "start nginx" than "/etc/init.d/nginx start".
pannix wrote:
PS: What is the importance of the hostname? I forgot to change it and now it is li666-666(.members.linode.com) (changed the numbers). Everything works. If you will be hosting multiple domains (mydomain1.com to mydomain9.com) on that server, how do you choose the hostname for the server? Just pick 1? mydomain5.com or do you use a subdomain vps.mydomain5.com?
If it's just a web server, it doesn't matter. All modern web servers use virtual hosting, so you only need to specify your domain(s) in your web server configuration files. Apache tends to complain if it can't find the full hostname, but it doesn't affect performance in any way. As for nginx, it couldn't care less.
The hostname becomes much more important if you want to send mail. Your hostname should match your reverse DNS (which it does by default), or other mail servers will treat you as a spammer. But even in that case, you can tell your MTA (such as Postfix) to use its own hostname, different from server's hostname. DNS servers often work the same way.