0
votes
1answer
114 views

Alias doesn't work in script with #!/usr/bin/env php

I've some PHP scripts which are starting with #!/usr/bin/env php. The default interpreter is PHP 4.4, but the scripts need PHP 5.3, so I created an alias in ~/.bashrc: alias ...
-1
votes
2answers
59 views

Way to aggregate large influxes of email [closed]

we are setting up a monitoring solution that'll utilize email notifications. However we have already seen that there are instances in which certain problems will affect large clusters of nodes ...
0
votes
2answers
29 views

Find PHP process that logs to file [duplicate]

I have started a PHP script via browser and due to a loop error the script continues to be executed even after closing the browser. I am noticing it since the script is logging error messages to my ...
0
votes
2answers
35 views

Script or Someway to Watch People Downloading Files from My Server (HTTP)

I am trying to figure out a way to in real time see people downloading files to ensure that the download from that person is successful. I cant seem to get the search string right to find what i need. ...
0
votes
1answer
63 views

How to use a common library of environment variables among different languages?

We have three main languages with which we perform system tasks: Bash, Ruby, and PHP, and Perl. Four, four main languages. We use managed environment variables to provide authorization info that ...
3
votes
2answers
195 views

How do I properly escape and interpolate variables in Bash?

I'm trying to write a one-liner to convert html entities present in some files (all html with UTF-8 encoding) I've tried recode HTML_4.0 file.htm but that also converts non-ASCII characters (it ...
0
votes
0answers
68 views

How can I block all wordpress admin access on a server?

I administer a server with lot of wordpress installations. Is there a way to block all admin-accounts with one script, or to add an extra password in the global apache configuration? I would like to ...
2
votes
1answer
375 views

Sending output from php script called from bash script to syslog

Sending output from php script called from bash script to syslog Im trying to create a bash script (to be called by a cron job) which calls a php file (which I have not made). Calling the php file is ...
0
votes
1answer
90 views

Running drupal as root in order for it to run bash scripts

I store a website on redhat and using drupal. There is a button on the site that activates a php script and that php script use exec to activate bash script on the server. Right now the script is not ...
0
votes
1answer
96 views

unix malicious scripts/ksh execution

I'm wondering whether my architecture poses a security risk. Details: The whole website is not ROOT owned but still, the APACHE user used instead has some pretty advanced permissions. I have a ...
0
votes
1answer
45 views

Find out where PHP is coming from? [closed]

If I type which php I get /Applications/MAMP/bin/php/php5.3.6/bin/php If I type where php I get /Applications/MAMP/bin/php/php5.3.6/bin/php /usr/bin/php And that's fine, but I am trying to ...
1
vote
3answers
474 views

Calling sudo within a script that was called with sudo prompts for password even with NOPASSWD

A PHP program I am working with (LConf) calls a script using sudo. I have allowed the user apache to run the script and have tested with sudo -u apache /usr/local/LConf/lconf_deploy.sh. I am being ...
3
votes
5answers
991 views

File transfer between two servers, no FTP, no web

I am looking to automate the transfer of file in a given directory from one server to another server. they are both on the same network, can ping each-other, and even ssh from one to another. ...
3
votes
2answers
936 views

Is there a way to make output from bash script visible in browser?

I have made a script for svn update for programmers. The script works fine from bash. Programmers want to execute it from browser (via theirs administrator site). Script is very simple (its only ...
0
votes
1answer
773 views

Installed PHP 5.4 via OS X binary, but `php` in terminal still uses 5.3 [closed]

I used a nice one-line command to install PHP 5.4 Mac OS X Lion, from php-osx.liip.ch. This is working perfectly in Apache – my local sites are now using PHP 5.4. But when I run php -v from the ...
3
votes
3answers
439 views

Running bash script with php under lower priority or limit CPU

I have a bash script which runs a set of php scripts. When it runs it takes an hour and pegs the CPU at 95-99%. This causes our lamp stack (mainly the apache process) problems and our website on the ...
3
votes
1answer
329 views

Bash Script To Simulate SMTP Mail Receipt

How would I create a Bash script that simulates SMTP mail receipt and then drops the result into a Maildir-formatted directory (so that Evolution mail reader could read it)? I just thought it would ...
0
votes
1answer
971 views

php5-fpm: bash script to check config before restart

I write a script to create new vhost on Nginx. That script creates Ningx vhost config file, vhost user and dirs, php-fpm pool file. At the end of the script, I would like to check if config is ok ...
2
votes
4answers
895 views

SSH not seeming to run in bash script called via web server

I have a simple shell script that: Makes a directory on the remote machine. Copies a .epub file to the remote machine's new directory. Runs kindlegen to convert the .epub to a .mobi. The remote ...
2
votes
1answer
529 views

How to identify and remove unused files / directories from an apache web server

New Customer. Old server. Unused Files & Directories abound. 5 specific core directories (attached to differing domains). 10-20 possible extraneous directories w/ files on the same level as the ...
1
vote
3answers
2k views

Time+ (CPU Time) column in top command is incorrectly reporting

The Time+ column in my top command is not reporting the correct time for a running php script. It fluctuates up and down first reporting something like TIME+ 22:39.35 php And then three seconds ...
1
vote
1answer
644 views

Can't change path location of PHP on mac os x snow leopard

I have XAMPP installed on my mac, and I want to make command line PHP use the same executable as XAMPP since I've customized that php's php.ini file. The php binary I want is located at: ...
-1
votes
1answer
317 views

Reading bash config file into php using shell_exec, but there's got to be a better way?

What's the best way to read data from a bash configuration file (containing variable assignments) into php? Currently, my php data reads the required bash variables by assigning php variables via ...
0
votes
1answer
617 views

Supervisor - how to get a program to run at intervals of time

Perhaps I'm misunderstanding with Supervisor does, but perhaps me asking this question will help clear that up. Basically, I have a Supervisor program in my /etc/supervisord.conf file that executes a ...
0
votes
2answers
171 views

Problem with loading .sh files call out by /usr/bin/php

When my web site is calling out a bash script with /usr/bin/php i'm geting this error Failed loading /projects/common/zend/lib/ZendOptimizer.so: /projects/common/zend/lib/ZendOptimizer.so: cannot ...
1
vote
3answers
2k views

How do I prevent PHP from executing shell commands?

how to prevent apache from executing bash scripts?? That any php script can't execute command in bash (for example command that will add links to my php and html files). Is there a way to do that?? ...
0
votes
3answers
2k views

PHP Execute Ping Command

I have asked this question before but with not much success. I guess i was confused and did not put my question properly. So here it goes again. Some points before i begin: I am running FC 14 I did ...
5
votes
1answer
4k views

Launching a PHP daemon from an LSB init script w/ start-stop-daemon

I'm writing an lsb init script (admittedly something I've never done from scratch) that launches a php script that daemonizes itself. The php script starts off like so: #!/usr/bin/env php <?php ...
0
votes
4answers
228 views

How do I rsync an entire folder based on the existence of a specific file type in that folder

I have a server set up that receives movies to a folder. I then serve these movies using DLNA. But in the initial folder where they end up all kind of files end up. Pictures, music, documents etc. I ...
0
votes
1answer
956 views

“Permission denied” in web server (CentOS on Mediatemple)

I've made another post regarding gitolite that I've resolved already but this is beginning to aggravate me. I can see that my files have read permissions but my error log continues to produce ...
0
votes
1answer
886 views

bash script to execute php file

I want to write something detecting where PHP is installed and then execute php after that eg: ./find_php.sh /path/to/php/file.php So I can get it to detect the php I want to use and stick it in a ...
1
vote
5answers
1k views

How to execute with /bin/false shell

I am trying to setup per-user fastcgi scripts that will run each on a different port and with a different user. Here is example of my script: #!/bin/bash BIND=127.0.0.1:9001 USER=user ...
0
votes
1answer
1k views

Restart apache process using shell script cannot find apache

I am trying to include a call to restart the apache2 server within an .sh script using PHP that runs daily to perform a maintenace routine on my server. I am able to kill the apache server and clear ...
3
votes
5answers
757 views

Difference of running scripts manually or with a cronjob

I have a PHP script that I want to run every 10 minutes, going through database records and creating/editing movies through MEncoder. I've set up cron job to accomplish this, but it doesn't work very ...
0
votes
4answers
682 views

How to secure bash scripts on apache?

How to close access for a few bash scripts that are used by my PHP-Apache-based website? I have an index.php file in my document root /var/www/. index.php is supposed to call some bash scripts which ...
0
votes
3answers
1k views

running a bash script as root to change the date, when called by a php script

I need to change the server date by running a bash script called by php. When i invoke the bash script from shell it works, but if i call it via php then it doesn't work. The bash script is run as ...
1
vote
1answer
811 views

running bash script as root with hardcoded password

Most probably this has already been answered in other threads, but I can't find the exact solution. I need to call a bash script via a php script which (bash) changes system time. I need to run that ...
1
vote
2answers
666 views

Apache 500 Error When Using Symlinks

Here is an excerpt of the deployment script I use to deploy php apps on my CentOS server. echo "Starting Deployment to $SITE_FOLDER (Relase Directory: $RELEASE_DIR)..." svn --username=$SVN_USER ...
0
votes
3answers
182 views

track down source of shell command

In our apache error log (/usr/local/apache/logs/error_log) for one of our servers we are seeing a shell command running quite often which is throwing an error, it looks like this: sh: list_price: ...