238 reputation
215
bio website bharath.lohray.com
location Vista, CA
age 30
visits member for 3 years, 5 months
seen Nov 19 at 16:50

...


Oct
16
comment How to move /var to another existing partition?
My home is a software raid md device. How can I make sure that md0 comes up before binding occurs?
Aug
26
comment Is a large RAID-Z array just as bad as a large RAID-5 array?
With change in disk sizes and performances, would you still recommend the same rule of thumb? (2014)
Nov
4
comment Executing a command as apache
I was only looking at the Apache Logs. I did not even have a sudo log. Once I configured sudo to start logging, I saw the error - sorry, you must have a tty to run sudo @ sudoers_policy_main(). I had faced this error before, except that time I had seen this show up in apache error logs. once I made an exception for apache to be ale to run without a tty, the above script worked. @JennyD - Thanks for that pointer :-)
Feb
8
comment Will including the CSS & JS in the HTML improve page load times and / or server performance?
How can I server a CSS + JS file?
Feb
8
comment Will including the CSS & JS in the HTML improve page load times and / or server performance?
Anything I try on a local test server will not seem to make any difference. I am not sure how to simulate hundreds of hits to test and notice some difference.
Apr
30
comment Adding RAM to a virtual machine without restart
This is more for a desktop OS being virtualized. If I am running multiple OS and shut down one, I would like to dedicate the RAM to other running OS. The OS is most likely going to be running some code (simulation) that may run for 10s of hours to days.
Apr
19
comment Apache ErrorDocument in an alias
I indeed had wwww instead of www Thanks to @Imo for pointing it out.
Apr
19
comment Apache ErrorDocument in an alias
Thank you! As lame as it is. The typo of wwww was the only thing that stopped this from working :-) Phew! I wasted 2 hours trying to troubleshoot this before surrendering it to ServerFault.
Apr
16
comment Init script & the green [ OK ]
Thank you for the suggestion. While this will help me with the fast CGI, I would still like to know how to write init scripts. I tried reading a few, but am not able to replicate their behavior.
Apr
12
comment Run a script as root from apache
serverfault.com/a/111102/85585 is an answer I found that helps me get rid of the requiretty from sudoers on per user basis. And this restarted the service too!
Apr
12
comment Run a script as root from apache
More observation: using php passthru ("ls -al"); works fine, but sudo ls -al does not return anything from that line. The rest of the script works fine. apache error log has the message sudo: sorry, you must have a tty to run sudo for each attempted sudo.
Apr
12
comment Run a script as root from apache
I had incron working for a while. It restarted dnsmasq a few times on changing the hosts file - I could see the results in ps aux and the /var/log/cron, but after a while, it stopped responding to changes in the hosts file. incrond was still running (visible in ps aux) and requests to reload user tables (incrontab -d) did show up on the log. The only way to get incrond to respond again for a short while was to restart it :-( Any tips on getting around this?
Apr
12
comment Run a script as root from apache
I tried your solution. I wrote a script that had sudo service dnsmasq restart when I execute this script as sudo -u apache restartScript, it restarts the service fine. However, when I restart it from the browser, it does not work :-( running whoami returns apache, but the service restart fails :-( I wrote a C program that behaves the exact same way. What could be wrong?
Apr
11
comment EC2 login as EC2 user other than root
I discovered that is is essential to enable root login on instance storage instances as there is no way to fix anything if one is locked out! Worst - I once messed my sudoers file and had to terminate the instance. stackoverflow.com/a/4336527/482176 is a good answer too.
Apr
11
comment Browser does not render phpinfo()
I will have to wait for 2 days to mark my own answer correct.
Apr
10
comment Browser does not render phpinfo()
I see a blank page. And on checking for the source, I see some incomplete HTML. I also tried to check it from my phone and do not see any HTML rendering.
Apr
10
comment Run a script as root from apache
Good idea. The thought of providing passwordless su access for just a single script had not occurred to me - lack of experience I recon.
Apr
10
comment Run a script as root from apache
Well, I could not sudo yum install it. Had to compile and install it. Make put he binaries in wired places that did not exists and are not in the PATH!
Apr
9
comment Run a script as root from apache
Any idea if I can install it on an EC2 instance without compiling it from source ?
Apr
9
comment Run a script as root from apache
@MadHatter - Would it be a security risk? Couldn't anyone get root access by ticking apache into executing sudo bash?