Plesk 12 scheduled task error - apache

I am trying to set a cron job where it will run php script and mail the results to user. However I am getting a permission denied error when the script is run.
/bin/sh: /var/www/vhosts/domain.com/httpdocs/bdmail.php: Permission denied
This is the code I am using in the command line:
/var/www/vhosts/domain.com/httpdocs/bdmail.php
I would be grateful if someone could highlight my error. I have setup a new task in plesk and it looks correct to me. Thanks
OS: CentOS 6 with Parallels Plesk Panel 12 (64-bit)

You should create scheduled task that calls the script interpreter with the path to the script as an option. For example:
/usr/bin/php /var/www/vhosts/domain.com/httpdocs/bdmail.php
instead of just
/var/www/vhosts/domain.com/httpdocs/bdmail.php

Related

Output file creation error with pentaho and task schedule windows

I have configured a machine with windows server 2016 and pentaho CE 7.0
I have already developed several Jobs and Transformations with their respective .BAT.
My problem occurs when I run the Jobs from the Windows Task Scheduler, which indicates the following error in the log:
Error opening new file 2020/07/08 13:43:36 - Microsoft Excel Writer.0
ERROR (version 7.0.0.0-25, build 1 from 2016-11-05 15.35.36 by buildguy) : java.io.IOException: Error creating output file! Parent
directory [file:///W:/Prueba] does not exist.
I already confirmed that the route exists and the most frustrating thing is that if I run the .BAT with a double click I get to the route.
Check for permissions ! it seems probably your script dont have correct permission to write in that folder.

Getting "permission denied" for executing python script from PHP

I have apache server installed on redhat linux.
I have a PHP script that needs to call a python wrapper script that calls another python script which has a function to execute some database queries.
So, my php script is in location /var/www/html: If I execute the python script from this location command line the script works fine. However, If I run the exact same command through exec inside PHP, I get "permission denied".
The whoami at /var/www/html gives my linux user id.
Inside php script
exec("whoami")
returns apache.
and
echo get_current_user();
returns my linux user id. Which is understandable since get_current_user returns the owner of the php script. How should I fix this problem? Is the problem because user "apache" does not have access to the script? User "smeeta" does have access to execute the script.
Any guidance here is highly appreciated.

Access denied error using vsts

I'm trying to create a wcf service in a lab using vsts.
I have created a build definition that works using a msbuild task. It then uses robocopy to copy the relevant dlls to a remote directory inside a lab using the Publish Artifacts step.
However, I need the content to be created as a windows service, and started after it has been published. It seems like something is running since I see a created log file about 9 minutes after a successful publish, but i cannot see my service inside the services menu, or in IIS.
When I try to run a bat script (using the run script step) that does an sc create, I get an access denied error even though on the vsts build definition I have given the step permission to modify the environment.
This is the full error:
2018-05-17T13:00:13.7702615Z ##[section]Starting: Run script GloBill/InstallBackEnd.bat
2018-05-17T13:00:13.7705444Z ==============================================================================
2018-05-17T13:00:13.7705561Z Task : Batch Script
2018-05-17T13:00:13.7705655Z Description : Run a windows cmd or bat script and optionally allow it to change the environment
2018-05-17T13:00:13.7705748Z Version : 1.1.3
2018-05-17T13:00:13.7705824Z Author : Microsoft Corporation
2018-05-17T13:00:13.7705924Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613733)
2018-05-17T13:00:13.7706023Z ==============================================================================
2018-05-17T13:00:13.7775377Z ##[command]C:\agent\_work\1\s\GloBill\InstallBackEnd.bat
2018-05-17T13:00:13.8030595Z
2018-05-17T13:00:13.8031049Z C:\agent\_work\1\s>sc create GloBillBackEnd ../Services/GloBill.WS.exe
2018-05-17T13:00:13.8048684Z [SC] OpenSCManager FAILED 5:
2018-05-17T13:00:13.8048781Z
2018-05-17T13:00:13.8048901Z Access is denied.
2018-05-17T13:00:13.8048957Z
2018-05-17T13:00:13.8064609Z ##[error]Process completed with exit code 5.
2018-05-17T13:00:13.8073202Z ##[section]Finishing: Run script GloBill/InstallBackEnd.bat
I'm running out of ideas.
The problem was that I was trying to deploy a release from a hosted agent that resided on another machine.
I had to configure a new agent solely for deploying, then i had to tweak my installation script a little by adding the -executionpolicy bypass command.
Here is the new script:
(%1 is the file path)
Powershell.exe -executionpolicy bypass -File %1 -username Username -password ****** -exepath *exe* -serviceName *svcName*

Cannot set-up MyPHPadmin in Apache

I just started using Apache, but when I try to run myPHPadmin, I get this error message:
1 - Can't create/write to file '/var/folders/w1/5yx2p9mj7w9bm67gdwhqxwsr0000gn/T/#sql1ba_3_0.MYI' (Errcode: 13)
Another post in the Stack Overflow suggested changing the permissions on the XAMPP file, my.cnf, with this command:
sudo chmod 600 my.cnf
I tried running the code in Mac Terminal, but the result was "No such file or directory."
Does anyone know what I should try next?
This is a permission problem on your datadir (where MySQL wants to write files). Normally, at MySQL installation, correct permissions are set for the user who runs mysqld.
Are you sure that MySQL was installed correctly as part of XAMPP installation?

Calling Bitkeeper command from telnet

I am calling a perl script in build machine 1 to connect to build machine 2 and call a perl script in build machine 2. The module I am using is Net::Telnet.
Recently I upgraded my bitkeeper in Build machine 2. Since then I am getting the license agreement form of Bitkeeper in the background. So my script is as good as paused till I kill the prompt's process from task manager.
If I kill the process, the bitkeeper clone command will fail and hence my entire build will fail. I am not able to bring this sneaky bkgui.exe process to front and accept the license agreement once and for all.
Can you please help me in solving this problem?
Observations:
I am not getting the license error when I open a command prompt in build machine 2 and call the same script which was called from telnet.
I ran 'whoami' command in my script running in build machine 2 and found it to be administrator.
'C:\WINDOWS\system32\tlntsvr.exe' is running and the USER is 'NT AUTHORITY\SYSTEM'.
When I call telnet from command line of buildmachine 1 and call the script in buildmachine 2, even then the bk command get executed successfully.
I want to run my bitkeeper command in build machine 2 from build machine 1.
You can try the bk legal -pT command. See bk help legal for usage.