vtcoders / AntennaRange

Supports a Web-based portal to operate and analyze antenna measurements
Apache License 2.0
4 stars 3 forks source link

Rock Web server serving pages and server CGI scripts #2

Open lanceman2 opened 4 years ago

lanceman2 commented 4 years ago

Have a look at: http://rock.sv.vt.edu/~tim23/AntennaRange/AntennaRangeWebpage/home.html

So it looks like Tim (tim32) started making web pages. For development you could all have your own version of the pages served from Rock from /home/USERNAME/public_html/ . USERNAME=tim23 in the above example.

You can also run CGI scripts on Rock, if you write them. For example, I wrote 4 simple example CGI scripts at http://rock.sv.vt.edu/~lance . All the scripts end in .cgi. The scripts try to be self explaining, and hence, are very insecure. One of the examples even writes a file. Not exactly what you want to do. My intent was not to be secure, but to show you how...

You can all write and create directories in /home/www-data/ as your login user. The CGI scripts that you make can also write to /home/www-data/ .

  1. If you are all writing CGI code you'll need to come up with a directory hierarchy in /home/www-data/
  2. Any files or directories that you wish to have your CGI script write to will need be owned by group www-data. You need to run somthing like:
    chown :www-data FILENAME
    to make these files writable by the web server running the CGI scripts.

So that's a python and many bash example server CGI scripts. You all have your own CGI playground in /home/USERNAME/public_html/

You can all have your own encapsulated version of the "Rock" service in your home directory and use (as it looks like you're doing) github to share between them. I'd avoid using URL's in the pages that are not "relative", otherwise that will break this file sharing/friendly development model. You may structure the layout of files anyway you like, but remember you do not want "private" server data kept in "public" directories like /home/USERNAME/public_html/

I'm not suggesting that the CGI scripts in this "Service" be written in BASH. You can use any language.

We can always make a "Production" version of the Rock service from a special directory that we choose.

Enjoy...

lanceman2 commented 4 years ago

Rock guacamole at http://rock.sv.vt.edu:8080/guacamole No, I'm not putting the passwords here.