Servers, Coding, Developing. Any tips?

  • Thread starter Omnis
  • 32 comments
  • 1,707 views

Omnis

Not Even A Real Mod
Staff Emeritus
38,942
United States
Application hell
MP-Omnis
b5igdpq.jpg

I'm learnding!

So in my down time I've become interesting in learning how to make my own website, how to run my own web server, how to program, linux, all that nerd stuff. In other words, I'm starting to hack the gibson.

2pSsgUX.jpg

gotta start somewhere...

I had an elementary grasp of HTML just from working backwards through web pages from when the internet was far less complex. Never understood CSS or any of that other stuff though. Luckily, there are sites today like Codecademy where I'm going through the learning modules and becoming familiar with what they're teaching. Didn't realize how easy CSS was until today.

I put ubuntu linux on an old laptop a few months ago, and I like it a lot. But that's because it's got a nice GUI so I'm not completely lost. I keep hearing about how powerful linux is and how all the GUI stuff is really a handicap, so really learning the command line has also sparked my interest.

But let's go back to Codecademy and its languages for a moment:
Already scratched HTML/CSS off the list. What's next? Should I follow this order learning stuff? Or do javascript then PHP? What about Python and Ruby? Do those help with learning linux? Give me some guidance here.

Ultimately what I'd like to do is set up some kind of website that people can visit, and then create a back-end that clients can hook into to run a series of video presentations. Is there an API that already helps me do this? Think of it like a remotely-controlled, indefinitely looping powerpoint, except with video. I guess I could just hire someone to make this or some service to do this for me, but, (a) I'm broke, and (b) I'd like to learn how to do it myself.

Then there's the server itself. Is it even cost effective to run your own unit? Can you get something for under 100 bucks or in a <10W TDP that will do the trick? What kind of hardware is required for, say, something like I described above (streaming HD video all day to tens of, if not near a hundred clients) as opposed to just something that will host a handful of websites or small blogs?

I appreciate anyone that would like to help me out and would also like to open the discussion for anyone trying to learn how to code or program or server or anything like that.
 
I don't know anything about most of what you mentioned except for linux command line (bash) stuff. I don't have any good strategies for learning linux, I just learned as I went along in college and then at my job for the past 17yrs.
Happy to try to answer questions about commands or pipelines or shell scripts and such. 👍

Good luck and cool ideas.
 
Definitely add bash to the list of programming languages, preferably near the top of the list, if you wish to learn linux. Javascript and PHP go along with HTML/CSS, while Python and Ruby are more of general purpose programming languages. If you want to completely blow your mind you could add perl to the list.

Unix (linux) has an enormous number of small utility programs that are generally designed to do one thing and do it well; no monolithic apps like you have in Windows. These are designed to work together; the design philosophy of unix is building blocks that are easily made to work with each other. Unfortunately the learning curve on this is fairly steep. But it's well worth learning; good luck with it!
 
What is the difference with bash and shell? Bash is actually a language? I've only ever heard it used with bin/bash or whatever to get root.

I'm only half sure that what I just wrote made any sense. My understanding of linux is not due to me understanding it, but just knowing what I'm told to type into it. Is there anything interactive that can help me with this?
 
Bash is a shell. You can use any of a number of shells in unix, popular ones being sh, bash, csh, and tcsh; there are many more. Contrast this with ms-dos where command.com was pretty much the only game in town although there were little-known alternatives such as 4dos, and command.com's modern equivalent, cmd.exe.

Although bash et al are mostly thought of as command interpreters, they are in fact full-blown programming languages with conditional execution, looping constructs, variables, arrays and the whole ball of wax. In fact csh gets its name from the fact it's similar to the C programming language.
 
So what's the difference between bash and sudo? Is sudo just a bash command? Explain it to me like I'm five.
 
So what's the difference between bash and sudo? Is sudo just a bash command? Explain it to me like I'm five.
Bash (& csh, etc) is a framework one uses to issue commands. Sudo is superficially similar in that one uses it to also issue commands. However one uses sudo to issue a single command (as another user, usually but not always root). Sudo will do no variable replacement on the command, will take no action based on the result of the command, or anything along those lines; any variable replacement on the command line is performed by bash not sudo.

Not sure if this clarified anything or just muddied it further.

I suspect that many people nowadays, particularly on ubuntu-based systems, open a command shell (or bash window if you prefer) only to issue commands that require root privilege via sudo. I currently have no less than six bash windows open right now, because I do a lot of the stuff I do from the command line. BTW "bash window" is a bit of a misnomer; they're really xterm windows running bash.
 
Almost done with my LAMP stack. Except I went with nginx. All I have to do is the database. Would've been done today, but I had to do everything three times to find where I made a mistake. Let me tell you... the problems a missing semi-colon can cause!
 
Almost done with my LAMP stack. Except I went with nginx. All I have to do is the database. Would've been done today, but I had to do everything three times to find where I made a mistake. Let me tell you... the problems a missing semi-colon can cause!
Yes, the bolded. :grumpy:

LAMP stack, had to look that one up. Turns out I deal with LAMPs daily without even knowing the acronym. :dunce:
 
I wish I would've started learning all this stuff back when I was 13. I feel like this has opened up a whole new world for me.
 
For those who don't know, LAMPS = Linux, Apache, MySQL, and PHP. Apache is a web server, MySQL is a database, and PHP (sometimes perl or Python) is a "glue language" between the Apache front end and SQL backend.

Let me tell you... the problems a missing semi-colon can cause!

Along the same lines, if you think a girlfriend missing a period is bad, try missing a period in a COBOL program.
 
http://www.amazon.com/dp/0073133612/?tag=gtplanet-20

Best book out there for command line Unix/Linux. It also gives you some good history on things and is pretty damn funny in the process.

Honestly I'm not sure I would bother spending a lot of time learning vanilla JavaScript, but then again if you're coming into this with minimal programming experience I guess it couldn't hurt. There are a ton of popular JavaScript frameworks floating around out there right now (jQuery included), but it might be best to figure out which framework is best suited to the website idea you already have in mind.

My professional experience is all enterprise Java development with some JavaScript (specifically ExtJS) UI work under my belt as well. Don't know much about Python, Ruby, etc...

I've found that the key to programming is using your google-fu skills to find someone on stackoverflow who actually knows what they are doing. :lol:
 
Last edited:
Yes, that is what I've been relying on.

Unfortunately, I've spent the better part of a week trying to get my server going and it just doesn't work. I'm stuck. And that's before I even add my domain to the mix.

Can someone explain to me what a nameserver is and how I use one if I'm hosting my own site? I know how DNS works for browsing. Is it the same for hosting? Do I just plug in any old DNS address to hook my domain up to my ip?

I'm finding it difficult to do a lot of things because most of the guides take for granted that you know things already. This whole website back-end thing is completely new to me.

I could just pay for hosting, but the whole point of this little project was to learn something.
 
A nameserver takes a hostname on the internet (such as www.gtplanet.net) and turns it into an IP address (such as 66.228.33.25). As for connecting to a nameserver(s), you do it the same way as you would any other machine. Can the machine in question already connect to the internet? If so, you're good to go.

If you have your own domain, your registrar should take care of making the domain known to the root DNS servers.

If you want to set up your own nameserver it's not terribly difficult to do on a linux system. But your registrar still has to publish the connection between your domain and your IP address(es).
 
But it can be any old DNS server? Like google's or OpenDNS, for instance? I notice hosting companies advertise that they'll do it for you and keep your records and all that. What's that about? Is there some kind of record file I have to keep somewhere?

Oh, and I got nginx working again. But now php is broken. :banghead: At least I got the server part working with (hopefully) https so that I can test it.
 
Oh, and I got nginx working again. But now php is broken. :banghead: At least I got the server part working with (hopefully) https so that I can test it.

Have you tried leaning in close to the machine and quietly (but angrily) saying really bad swearwords? The technical efficacy of that approach is, I admit, unproven... but I've always found it a tremendous help.
 
It's ok, I just need to fix it. Basically, I followed a guide that was 2 years old and basically a bunch of ********. Thankfully I found some norwegian dude's blog and doing things as he explains has-- so far-- yielded better results.

edit: Forget my earlier post. I was thinking that resolvers could be used, but obviously they're just resolvers and not the real deal.
 
Last edited:
This is really pissing me off. It's 5am and I started working on this **** after the Heat game. I can't get my static html to work. I don't know what's wrong, but I'm getting ready to uninstall everything and start again from scratch. It really shouldn't be this hard.

Edit: nevermind! Got it! I had to chmod the directory where my website was. Linux u so silly.
 
Last edited:
I've had a facepalm or two over permissions issues myself, including while dinking with Apache's setup.

Apologies if you already know this, but:
There is a useful command called "tail", which shows the last ten lines of a file (by default; tail -20 will show the last 20 lines, etc). This command has a very useful option, -f. This will cause tail to continue to display lines as they are appended to a file. For instance, "tail -f /var/log/httpd/error_log" will monitor Apache's error log in realtime. The command "tail -f /var/log/httpd/access_log" may also be useful; I like to open a pair of xterm windows with those commands running in them when I'm dinking with the web server.

Your paths may differ but probably don't.
 
I prefer the 'less' utility to tail, for its search feature. "less /var/log/httpd/error_log" and then hit capital F to have it go into tail -f mode. After a bunch of lines have scrolled offscreen, hit ctrl-C to get out of tail -f mode and then you can immediately navigate backwards by pages (b key), or search backwards with the ? key followed immediately by the string you want to search for. The / key works the same to search forwards.

But @BobK's main point of consulting logs and knowing a few key strings to look for, as well as timestamps that are applicable, is very important in configuring services for linux.
 
So I brought some old towers in from storage. Wake up today and find millipedes all over my floor. Good thing I used the old laptop and didn't plug in these things. Would've had millipede salad.
 
I could help you with stuff like C and a little C# but those aren't what you want to learn since that's programming, I haven't taken my mandatory java class yet until the next spring semester. So if I were you I'd learn the others first and then find someone that can help teach you what you want with Ruby or Java, which should speed up your understanding. Of course dependent on where you are with that if any where yet which it doesn't loo like, but the amount you want to learn is quite a task I'd say.

As for what I've seen, python is one of the easier on that list to learn, but I really have no care nor wish to do any web server creating and so I've never tried it. I've only had friends do it and show me how easy the syntax is.
 
Last edited:
It's tough for me to guide you in the right direction because my understanding of your goals are pretty general right now; you're looking to take on a lot of things at once.

I would recommend taking a step back and focusing on one part of your project, either the front-end/application or the infrastructure. The server requirements for such a site probably aren't as demanding as you'd expect - the real challenge will be working with the streaming video files and players. That will all be accomplished higher up in the web stack (front-end and web-app development), so I think that's what you should spend your time on if you are serious about building this thing.

If that's what you want to do, a basic "shared" web hosting plan is all you need to get started, which you can get for a few dollars per month. I haven't used any shared hosting services recently; the only service I can recommend is Namecheap, but there are lot of other quality companies out there (check out WebHostingTalk.com and HostJury.com for other companies as well).

This will remove most of the Linux/sysadmin headaches so you can actually get started on building a working prototype of your software. I would recommend starting with PHP - it's looked down upon by some developers for some legitimate technical reasons, but you can ignore that and just enjoy all the resources out there for it.

If you already have a good grasp on HTML/CSS/JS, find a good PHP/MySQL book or tutorial on how to build a basic database-driven website. Follow their tutorials even if they aren't exactly like what you'll be doing - you will eventually come to see the inherent similarities with your own project and you can use the skills that you've learned to build your first working prototypes from that.
 
... find a good PHP/MySQL book or tutorial on how to build a basic database-driven website. Follow their tutorials even if they aren't exactly like what you'll be doing - you will eventually come to see the inherent similarities with your own project and you can use the skills that you've learned to build your first working prototypes from that.

This all over. PHP can be super-useful if you know what you want to use it for and do a bit of research on the things you shouldn't use it for :)
 
I'm learning Linux myself after learning C++ and java over the past year. It's fun.
 
So I finally got my own server up and running Wordpress. It's an AM1 socket, and it should pay for itself in a year or two. I started over from before since I quickly realized I needed a 64-bit system and I had screwed the laptop installation up so badly that it wasn't worth continuing. :lol:

That said, I've learned a ton and now it's time to start in with learning this front end stuff. Thanks for all the great advice, guys.
 
Thanks for the update, @Omnis, I've been wondering how the project was progressing.

Starting over from scratch is something I've done more than once. Part of the learning experience, I think. At least it's easier the second time around, plus a number of things that were puzzling issues at first now make more sense.
 
So I finally got my own server up and running Wordpress. It's an AM1 socket, and it should pay for itself in a year or two. I started over from before since I quickly realized I needed a 64-bit system and I had screwed the laptop installation up so badly that it wasn't worth continuing. :lol:

That said, I've learned a ton and now it's time to start in with learning this front end stuff. Thanks for all the great advice, guys.
To help learn your way around Linux, I recommend working with some virtual machines. You can take snapshots of them, reconfigure them, screw them up, try different distributions, and just learn in a safe sandbox of sorts. VirtualBox is the most popular free VM software, but if you want something with a bit more polish, try VMware or Parallels (I use Parallels on a Mac).

If you don't want to mess with VMs on your local computer and are willing to spend a few dollars (literally), check out Digital Ocean. You can create virtual machines running a wide array of popular Linux distributions on their servers, and play around with them as much as you want. Their smallest server packages are just $5 a month and billed hourly, so you can fire up a server and delete in a few days and it will only cost you a few cents.

(wrs.gtplanet.net is actually hosted on a Digital Ocean server in their NYC2 datacenter.)
 
Why do it virtual when you can do it actual? :D

This thing is great though. Doubles as an htpc for the living room.
 
Back