LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-16-2007, 04:51 PM   #1
lucastic
Member
 
Registered: Aug 2003
Location: Oz
Distribution: Gentoo - Debian
Posts: 202

Rep: Reputation: 30
problems restarting APACHE2 from PHP5


Hi all -

Im having a strange problem.

I have a php script that uses
system("sudo ....

to call a script that works perfectly except when it gets to the last stage where it attempts to restart apache2 (/etc/init.d/apache2 restart)

When the script tries to restart apache it crashes apache, and I have to manually restart it from the command line.

I assume the problem is due to the fact that I am trying to restart apache from the apache user (www-user).

Anyone know how I can get around this problem?

Thanks in advance..
 
Old 09-17-2007, 06:57 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
take a look at
man sudo
maybe you can restart apache if it is not listening on port 80 but a port number>600 (or so). Higher port numbers are not restricted to be used by root only. Are you sure you want to enable a web user to restart the server?? Strange anyway ;-)
 
Old 09-17-2007, 07:09 AM   #3
lucastic
Member
 
Registered: Aug 2003
Location: Oz
Distribution: Gentoo - Debian
Posts: 202

Original Poster
Rep: Reputation: 30
Hi - Thanks.

However I have found mod_vhost_alias which does exactly what I wanted with less steps. It allows new virtual domains without restarting apache!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FC5 + Apache2 + PHP5.1.2.5 problems MiroM Fedora 1 11-15-2006 05:39 AM
Apache2 and PHP5 SpiderIRE Linux - Software 3 09-30-2005 03:25 PM
Apache2 + PHP5.0.3 24jedi *BSD 1 07-21-2005 03:07 PM
How to/Problems - Apache2+PHP5+PostgreSQL8 schneider Linux - Software 1 02-02-2005 08:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration