Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
f(w) = (strlen(w) > 10 ? word(w, 1) . "\n" . word(w, 2) : w)
set title "CLUSTER 1"
set terminal png truecolor size 960, 720
set output 'cluster2.png'
set bmargin at screen 0.1
set key top center
set grid
set style data histograms
set style fill solid 1.00 border -1
set boxwidth 0.7 relative
set yrange [0:]
set format y "%g%%"
set datafile separator ","
plot "/var/www/cgi-bin/CLUSTER_1.txt" using 2:xtic(f(stringcolumn(1))) title " CPU consumption (%) ", \
'' using 3 title " RAM consumption (%)", \
'' using 0:($2+1):(sprintf("%g%%",$2)) with labels notitle, \
'' using 0:($3+1):(sprintf(" %g%%",$3)) with labels notitle
This graph should be generated when I click on the button :
A guess:
The apache user doesn't have write permissions in the directory, so it can't open the output file.
That would be typical. Create a new directory, owned by the apache user, then direct the output to that new directory. You can then display it from there once it's generated.
You really don't want to clutter up your cgi directory with the output of your script, anyway.
A guess:
The apache user doesn't have write permissions in the directory, so it can't open the output file.
That would be typical. Create a new directory, owned by the apache user, then direct the output to that new directory. You can then display it from there once it's generated.
You really don't want to clutter up your cgi directory with the output of your script, anyway.
Hello,
Thank you for your answer !
When you say " Create a new directory, owned by the apache user ", you mean : create a directory in my cgi-bin and make " chown apache:apache my_new_directory " ? If is that, it doesn't work :
I change the path of the output in my gnuplot script to " set output /var/www/cgi-bin/cluster1.png " to "set output /var/www/cgi-bin/my_new_directory " and this is my error_lor :
But I think I missed somethings and for the moment, my technical level is still weak, which doesn't help matters ! I'm a beginner in apprenticeship, so I continue to study !
Looks like the same error, yes?
I’m still guessing here...is the user running apache called apache?
Code:
ps aux | grep httpd
to see what it is. sometimes it defaults to www-data
Also, the output file name should be as you posted it last, including the file name...there’s no path in the script you posted.
BUT. Displaying the gnuplot command on the second page won't execute it. The script run by the form on the first page (GNUGRAPH.sh) needs to run gnuplot, then display the png in the second page.
Looks like the same error, yes?
I’m still guessing here...is the user running apache called apache?
Code:
ps aux | grep httpd
to see what it is. sometimes it defaults to www-data
Also, the output file name should be as you posted it last, including the file name...there’s no path in the script you posted.
BUT. Displaying the gnuplot command on the second page won't execute it. The script run by the form on the first page (GNUGRAPH.sh) needs to run gnuplot, then display the png in the second page.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.