Go Back   The UNIX and Linux Forums > Special Forums > Web Programming


Web Programming Discuss Web Programming and Web Server Administration, including LAMP, Apache, MySQL, HTML, SEO, and other Web APIs and topics.

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 09-04-2012
Registered User
 
Join Date: Dec 2011
Posts: 14
Thanks: 5
Thanked 0 Times in 0 Posts
Get command-output to webpage from solaris-10-OS invoked from html webpages

Hello,
I am a middleware administrator and as an admin I need to monitor a number of middleware instances (weblogic servers). But since it is a not the forum for that i would like to put my problem in simple terms and need guidance on that.
I need to use apache webserver on Solaris 10 zones to host a html site. The buttons on the html page will invoke shell-scripts/weblogic-mbean-commands/WLST-scripts using CGI , to get the required output on the webpage.
Apache htaccess will be required for authentication.

The restriction is that all the components should be free. Only Solaris 10 is affordable here.
Is it a feasible+practical solution ?
Is there any other better solution to this(which wont require any licensing products )?
Need your guidance.
Thanks,
Poga
Sponsored Links
    #2  
Old 09-10-2012
Registered User
 
Join Date: Oct 2010
Location: Southern NJ, USA (Nord)
Posts: 3,786
Thanks: 8
Thanked 469 Times in 449 Posts
CGI ouput goes to the web page by default, ok as content type text/plain but that is usually a bit drab; ok in a frame, maybe. Command output needs a little post-processing to be friendly to the middle of a text/html page in a <PRE> element.
Code:
echo '<PRE>'
 
( echo '$ command_line'
 
  command_line 2>&1
  echo '$'
 )| sed '
    s/\&/&amp;/g
    s/"/\&quot;/g
    s/</\&lt;/g
    s/>/\&gt;/g
 '
 
echo '</PRE>
<HR>'

This might suffice for canned or minimal-input scripts. I you need to process input of any complexity, you probably want PERL or JAVA or such, as you need a URL-decode for input. There are wrappers and servers that put the form variables somewhere in the environment, so shell can more easily process them. I wrote one -- everything is a shell scripted service, form variable x becomes environmental variable $h_x. The log file is executable and starts with the f0llowing prefix so it is a service that can dump itself!
Code:
#!/bin/tail -n+2
Content-type: text/plain
 
==== Start of Log ====


Last edited by DGPickett; 09-10-2012 at 05:19 PM..
Sponsored Links
    #3  
Old 09-12-2012
Registered User
 
Join Date: Dec 2011
Posts: 14
Thanks: 5
Thanked 0 Times in 0 Posts
Thanks DGPickett for your valuable input.
Did a little bit of R&D from my part and found out that the best way to implement would be using PERL-CGI scripting. So working on that now
    #4  
Old 09-13-2012
Registered User
 
Join Date: Oct 2010
Location: Southern NJ, USA (Nord)
Posts: 3,786
Thanks: 8
Thanked 469 Times in 449 Posts
Yes, that's great for simple HTML. PERL can do sed substitutions. If you get confidential information or affect the server, you might want authentication and security. The scripts should be multi-user stable, like using $$ in temp file names or using pipes, and capable of running two at once or have a lock-out.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Send HTML body and HTML attachment using MUTT command vickramshetty Red Hat 2 05-11-2010 10:33 AM
Run shell commands via HTML webpage/button? zeekblack Shell Programming and Scripting 3 11-10-2008 11:15 AM
formatting output in html ebbtide Shell Programming and Scripting 4 08-03-2006 10:02 PM
which access right should set in my webpage index.html ? zp523444 UNIX for Advanced & Expert Users 1 11-13-2005 01:27 AM



All times are GMT -4. The time now is 11:39 AM.