Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 What is the best way for a web server to run command line scripts?
Index -> General Programming
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
BigBear




PostPosted: Thu Feb 07, 2013 9:38 am   Post subject: What is the best way for a web server to run command line scripts?

If you were to create a web application that will

prompt the user
to select compilers or compiler versions
to select compiler settings
to select a program to compile

and display the size of the compiled program with each of the compilers and settings.

I am thinking it will need to run either a python script or maybe even just a make script.

Which language/framework would you recommend?
Sponsor
Sponsor
Sponsor
sponsor
QuantumPhysics




PostPosted: Fri Feb 08, 2013 12:00 pm   Post subject: RE:What is the best way for a web server to run command line scripts?

Django = the web scripting side of python.
Tony




PostPosted: Fri Feb 08, 2013 1:08 pm   Post subject: RE:What is the best way for a web server to run command line scripts?

Flask is also a good web framework for Python.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
rdrake




PostPosted: Sat Feb 09, 2013 2:10 am   Post subject: Re: RE:What is the best way for a web server to run command line scripts?

Tony @ Fri Feb 08, 2013 1:08 pm wrote:
Flask is also a good web framework for Python.
Seconding.

Flask is much smaller and flexible. Combine it with sh and you have yourself a winner.
btiffin




PostPosted: Sun Feb 10, 2013 2:51 am   Post subject: RE:What is the best way for a web server to run command line scripts?

Old guy interrupting;
Go team Pocoo (Flask).

Old guy bragging;
Had a pull request accepted into Pygments, so I get to pretend to be a contributor to team Pocoo. Go Georg.

Cheers
Dan




PostPosted: Mon Feb 11, 2013 11:03 am   Post subject: RE:What is the best way for a web server to run command line scripts?

You have to be rather careful when having a web application execute commands that the user has some control over or you can run in to security issues rather fast.

If your web server is running as root, this could give them total access to the server. I highly recommend ensuring that your web server is chrooted or not running as root and you take care to escape any input coming from the user.

If you are allowing users to upload code to be complied and then executing that code, I highly recommend to take steps to ensure they can't cause any damage. chrooting or running the code in a VM might be a good option but you might also want to consider separating the front end web application from the backend that complies and runs the program.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: