1
vote
1answer
1k views

How to write a shell script restart apache if `server reached MaxClients`

Recently, My blog always shutdown, it use centos6.2+apache2.2+mysql5.5+php5.3. I have raised MaxClients in httpd.conf, but less useful. So is it possible to write a shell script (Run with crontab ...
4
votes
1answer
1k views

recovering deleted file held open by apache?

suppose an apache log file gets deleted but its held open by apache then this is what i am doing. pid=$(lsof | grep text.txt | awk '/deleted/ {print $2}') fd=$(lsof | grep text.txt | awk '/deleted/ ...
3
votes
2answers
10k views

Execute shell script from php, as root user?

Need to execute the following line from PHP: $res = shell_exec('sudo sh /home/nicklas/cronjobs/make_account.sh username password'); The problem is nothing happens on execution. If i try to ...
-4
votes
1answer
772 views

Changing IP address of Apache server using PHP statically

I want to statically assign the IP address of my Arch linux using php. I want to change the IP by using netmask,interface,broadcast,address & gateway. The user puts up the values into a html page. ...
2
votes
1answer
411 views

Writing a bash script for apache conf files

I'm trying to automate creating vhosts on my computer. This is merely a learning experience for bash scripting. I'm currently novice. I'm trying to learn more about awk, sed. No, this isn't homework. ...