Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Web Dev environment advice

Options
  • 31-12-2011 5:21am
    #1
    Registered Users Posts: 23,212 ✭✭✭✭


    Apologies in advance for the long post.

    I am investigating the possibility of setting up a development environment for around 60 students in the college I work at.

    The course is going to be teaching IT students PHP/MySQL and I already have two servers up and running, with Red Hat Linux and a fully working Apache/PHP/MySQL install. I've tested it with a few basic PHP scripts.

    Now I am wondering what the norm is (my background is Oracle/Unix and while I have dabbled in PHP, it was about five years ago :o). I am not sure of the development process - this will initially be an introductory course, on HTML, moving swiftly on to JavaScript/PHP.

    First question - what development environment would you recommend? I am thinking Eclipse on a Windows client? Students have already used NetBeans, would that be usable?

    Second question - the mechanics of getting their PHP scripts to the web server. They can SFTP their files up to the server, but how would you suggest managing them dropping their files into /var/wwwroot/?

    Would it be /var/wwwroot/student1/file1.php
    /var/wwwroot/student2/file1.php
    /var/wwwroot/student3/file1.php

    Or is there a better way?

    Any other suggestions very welcome.


Comments

  • Registered Users Posts: 339 ✭✭duffman85


    If they're already used to netbeans already I would stick with it.
    I have used it a small bit with php for a college project and found it worked quite well.
    It integrates well with Xdebug for debugging which I found useful.

    lots of info about using it for php is here: http://netbeans.org/kb/trails/php.html?utm_source=netbeans&utm_campaign=welcomepage


  • Moderators, Society & Culture Moderators Posts: 9,689 Mod ✭✭✭✭stevenmu


    Do you need to use centralised shared web servers? An easier option might be to have each student run a VM image with it's own web server. You can prepare an image with the IDE, web server, database etc all pre-configured, and then just copy it to each student/developer workstation. That way there's no conflict with other students and if someone screws up their configuration (and they almost certainly will) you can just give them a fresh copy.


  • Registered Users Posts: 23,212 ✭✭✭✭Tom Dunne


    stevenmu wrote: »
    Do you need to use centralised shared web servers?

    Technically, no. Just exploring options, really.
    stevenmu wrote: »
    An easier option might be to have each student run a VM image with it's own web server. You can prepare an image with the IDE, web server, database etc all pre-configured, and then just copy it to each student/developer workstation. That way there's no conflict with other students and if someone screws up their configuration (and they almost certainly will) you can just give them a fresh copy.

    Yeah, we had thought of VMs, but they proved completely impractical with other subjects.

    If you can imagine a classroom with 20 computers, all of which are shared, it becomes a nightmare managing the VM images. Unless we gave each student a fresh VM image each class, and have them save their work onto the likes of Dropbox from within the VM image. That could be an option, I suppose.


  • Registered Users Posts: 2,023 ✭✭✭Colonel Panic


    How about something like XAMP and Notepad++. That gives you a self contained install of PHP, Apache and MySQL.


  • Registered Users Posts: 1,994 ✭✭✭lynchie


    If it was a one off setup for the students, then I would do the following.

    Use phpmyadmin to create 20 student databases and users for student1,student2 etc...
    Create 20 linux users /home/student1,/home/student2 etc with useradd -m
    Enable mod_userdir in apache and use the UserDir directive.
    Create public_html in each students home directory.
    Each student can upload their own files to /home/student1/public_html using sftp and can access their sites using http://myserver/~student1/test.php


  • Advertisement
  • Moderators, Society & Culture Moderators Posts: 9,689 Mod ✭✭✭✭stevenmu


    Tom Dunne wrote: »
    Technically, no. Just exploring options, really.



    Yeah, we had thought of VMs, but they proved completely impractical with other subjects.

    If you can imagine a classroom with 20 computers, all of which are shared, it becomes a nightmare managing the VM images. Unless we gave each student a fresh VM image each class, and have them save their work onto the likes of Dropbox from within the VM image. That could be an option, I suppose.
    Yeah if it became a case of managing VMs for X number of students for Y number of courses that would be a bit of a nightmare. A solid virtual server infrastructure which could support a lot of VMs which could be started and stopped as needed would be cool, but probably overkill for your current question :)


  • Registered Users Posts: 1,657 ✭✭✭komodosp


    Notepad++ I would have said... but then someone mentioned debugging using Netbeans so I have no idea how to do that (my idea of debugging is echoes and print_rs)


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    Depends on how fancy you want to go.

    If the course will also be focussing on the server environment as opposed to just straight-out scripting, then an individual server instance per-student is desirable. However the next best thing would be virtual hosts on apache.

    So each student would get their own "server" at student1.coursename.college.edu, each of which are all just virtual hosts on the same apache instance.

    This allows for a one-web-server-per-student setup that they can screw with all they like and gives the impression of a whole "website" each.

    Tbh, any of the solutions above are just as good, they're all fairly equivalent, it's all about how you want the environment to look. Everything would be scriptable so that users can be created and destroyed in a few seconds and the whole environment reset whenever necessary.


  • Registered Users Posts: 23,212 ✭✭✭✭Tom Dunne


    How about something like XAMP and Notepad++. That gives you a self contained install of PHP, Apache and MySQL.

    Not familiar with this, but I like it. I'll look into it.
    lynchie wrote: »
    If it was a one off setup for the students, then I would do the following.

    Use phpmyadmin to create 20 student databases and users for student1,student2 etc...
    Create 20 linux users /home/student1,/home/student2 etc with useradd -m
    Enable mod_userdir in apache and use the UserDir directive.
    Create public_html in each students home directory.
    Each student can upload their own files to /home/student1/public_html using sftp and can access their sites using http://myserver/~student1/test.php

    Now this sounds like exactly what I am looking for. Excellent stuff.
    seamus wrote: »
    Depends on how fancy you want to go.

    Well, you know me, Seamus, I demand nothing but the best. :)
    seamus wrote: »
    If the course will also be focussing on the server environment as opposed to just straight-out scripting, then an individual server instance per-student is desirable. However the next best thing would be virtual hosts on apache.

    No, they won't be focussing on the server environment. The intention is that they will just dump their files onto a server and test them using a web browser. So nothing more than that.

    We will be leaving the Sys Admin stuff to the Unix course.
    seamus wrote: »
    Tbh, any of the solutions above are just as good, they're all fairly equivalent, it's all about how you want the environment to look. Everything would be scriptable so that users can be created and destroyed in a few seconds and the whole environment reset whenever necessary.

    To be honest, how it looks isn't really too important. It's all about the learning. If I could get them to use NetBeans (which they would already be familiar with), along with SFTP'ing the files (which they would have done in the Unix systems course), the only new thing to learn for them would be the Web Dev stuff.

    So thanks all for the suggestions, I'll get researching a few of the above and let you know how I get on.


  • Registered Users Posts: 2,793 ✭✭✭oeb


    IDE wise, I would certainly recomend netbeans, I have been using it (As a professionaly PHP developer) as my primary IDE for about 5 years now (I switched from zend studio, and I never switched back). It integrates nicely with Git (My source control of choice).

    If you are going for a simple text editor, I would recomend Sublime2 over Notepad++ any day. It's not open source (But it has an unlimited fully functional trial period, it just pops up every few days asking you to buy).

    With regard to actual deployment of their work, it depends on how they want to do it. The quickest solution is XAMPP. It's a full Apache, Mysql & PHP stack that you just simply unzip and run the control panel. It comes pre-included with common tools like the Zend framework, PHPmyadmin etc.

    If you want to ensure that they are better prepared for the actual working life of a developer, I would be enclined to go with lynchie's solution. You can also run some kind of versioning on that server and teach them about commiting their work to a remote server.


  • Advertisement
Advertisement