You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Rodolfo De Nadai <ro...@ima.sp.gov.br> on 2007/09/14 21:32:54 UTC

[users@httpd] Direct script to specific port...

Is there a way to direct a specific script to run on a diferent port 
than the default configurated in http.conf??

Exemple:
default port is 80
script myscript.php should run on port 5128
all other scripts should run on port 80

thanks
-- 
* Rodolfo De Nadai *
* Analista de Sistema Jr. - Desenvolvimento *

	

	
	*Informática de Municípios Associados S.A.*
Seu governo mais inteligente
rodolfo.denadai@ima.sp.gov.br <ma...@ima.sp.gov.br>  - 
www.ima.sp.gov.br <http://www.ima.sp.gov.br/>
Fone: (19) 3739-6000 / Ramal: 1307 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Direct script to specific port...

Posted by Rodolfo De Nadai <ro...@ima.sp.gov.br>.
Joshua...
the page that you pass should solve my problem.... the item 3.20 i will 
test to see...

In future we will change this... but for now...

My script is simple... i use the php command *system *to execute the 
script...
So when the admin press Enable a call to the function system is 
executed... to stop the script, i flag a field on my database...
That's all...

thanks


Joshua Slive escreveu:
> On 9/17/07, Rodolfo De Nadai <ro...@ima.sp.gov.br> wrote:
>   
>> The script do nothing with the port...
>>
>> "using the apache port" it means that my apache default port is 80 and the script is blocking port 80 since i call my script throuth IE or Firefox
>>
>> If i confgure a virtual host to run on a different port, when apache is
>> restart it will try to access that port??? if this happend apache will
>> not go up because the script will be still using that port...
>>
>> Perhaps i'm not be myself very clear... my script works like a
>> "thread"... a have a button Enable/Disabled on my web site, when i press
>> the button my script run in a shell on my linux... this shell is open
>> with my apache user... my script in theory should run forever, except
>> when in the web site interface the administrator click on the Disabled
>> button...
>> The problem that came out in a few days ago... the guys of support add a
>> new host in apache and restart.... the child process script of the
>> apache process didn't stop... so when apache was restart couldn't up...
>> than after a few minutes the guys of support find that my script was
>> running and using port 80... but the script only access a MySQL database
>> and send default e-mails...
>>     
>
> You can't have infinitely-lived scripts run within the web server
> process. That just isn't supported by the web model. If you want an
> infinitely-lived script, you need to run it as a CGI and detach it
> from the web server as described here:
> http://www.htmlhelp.org/faq/cgifaq.3.html#8
>
> Again, this whole enabled/disabled button thing is not something that
> fits into the standard web model. If you need specific help with that,
> you need to describe specifically how it is implemented. One guess is
> that your script is blocking signals and therefore not dying correctly
> when the admin asks for a restart. But that is just a guess based on
> very little information.
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
>   

-- 
* Rodolfo De Nadai *
* Analista de Sistema Jr. - Desenvolvimento *

	

	
	*Informática de Municípios Associados S.A.*
Seu governo mais inteligente
rodolfo.denadai@ima.sp.gov.br <ma...@ima.sp.gov.br>  - 
www.ima.sp.gov.br <http://www.ima.sp.gov.br/>
Fone: (19) 3739-6000 / Ramal: 1307 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Direct script to specific port...

Posted by Joshua Slive <jo...@slive.ca>.
On 9/17/07, Rodolfo De Nadai <ro...@ima.sp.gov.br> wrote:
> The script do nothing with the port...
>
> "using the apache port" it means that my apache default port is 80 and the script is blocking port 80 since i call my script throuth IE or Firefox
>
> If i confgure a virtual host to run on a different port, when apache is
> restart it will try to access that port??? if this happend apache will
> not go up because the script will be still using that port...
>
> Perhaps i'm not be myself very clear... my script works like a
> "thread"... a have a button Enable/Disabled on my web site, when i press
> the button my script run in a shell on my linux... this shell is open
> with my apache user... my script in theory should run forever, except
> when in the web site interface the administrator click on the Disabled
> button...
> The problem that came out in a few days ago... the guys of support add a
> new host in apache and restart.... the child process script of the
> apache process didn't stop... so when apache was restart couldn't up...
> than after a few minutes the guys of support find that my script was
> running and using port 80... but the script only access a MySQL database
> and send default e-mails...

You can't have infinitely-lived scripts run within the web server
process. That just isn't supported by the web model. If you want an
infinitely-lived script, you need to run it as a CGI and detach it
from the web server as described here:
http://www.htmlhelp.org/faq/cgifaq.3.html#8

Again, this whole enabled/disabled button thing is not something that
fits into the standard web model. If you need specific help with that,
you need to describe specifically how it is implemented. One guess is
that your script is blocking signals and therefore not dying correctly
when the admin asks for a restart. But that is just a guess based on
very little information.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Direct script to specific port...

Posted by Rodolfo De Nadai <ro...@ima.sp.gov.br>.
The script do nothing with the port...

"using the apache port" it means that my apache default port is 80 and the script is blocking port 80 since i call my script throuth IE or Firefox

If i confgure a virtual host to run on a different port, when apache is 
restart it will try to access that port??? if this happend apache will 
not go up because the script will be still using that port...

Perhaps i'm not be myself very clear... my script works like a 
"thread"... a have a button Enable/Disabled on my web site, when i press 
the button my script run in a shell on my linux... this shell is open 
with my apache user... my script in theory should run forever, except 
when in the web site interface the administrator click on the Disabled 
button...
The problem that came out in a few days ago... the guys of support add a 
new host in apache and restart.... the child process script of the 
apache process didn't stop... so when apache was restart couldn't up... 
than after a few minutes the guys of support find that my script was 
running and using port 80... but the script only access a MySQL database 
and send default e-mails...


thanks


Joshua Slive escreveu:
> On 9/17/07, Rodolfo De Nadai <ro...@ima.sp.gov.br> wrote:
>   
>> Joshua, my script should be independent of apache when executing, but i
>> have to run my script throuth IE or Firefox, so it depends of the apache
>> to start and stop the script...
>>
>> And i can't run a PHP script over internet without using the apache
>> port... at least i'm not finding a way to do this in other way...
>>     
>
> You aren't defining what the heck you mean by "using the apache port".
> What do you need to use a port for? If you are simply sending data
> back to the client, then the answer you have already received are
> correct: simply configure apache to run on the port you want using
> virtual hosts.
>
> Anyway, if you aren't willing to specify exactly what this script is
> doing with the port, then I give up. Can't help you without more
> information.
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
>   

-- 
* Rodolfo De Nadai *
* Analista de Sistema Jr. - Desenvolvimento *

	

	
	*Informática de Municípios Associados S.A.*
Seu governo mais inteligente
rodolfo.denadai@ima.sp.gov.br <ma...@ima.sp.gov.br>  - 
www.ima.sp.gov.br <http://www.ima.sp.gov.br/>
Fone: (19) 3739-6000 / Ramal: 1307 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Direct script to specific port...

Posted by Joshua Slive <jo...@slive.ca>.
On 9/17/07, Rodolfo De Nadai <ro...@ima.sp.gov.br> wrote:
> Joshua, my script should be independent of apache when executing, but i
> have to run my script throuth IE or Firefox, so it depends of the apache
> to start and stop the script...
>
> And i can't run a PHP script over internet without using the apache
> port... at least i'm not finding a way to do this in other way...

You aren't defining what the heck you mean by "using the apache port".
What do you need to use a port for? If you are simply sending data
back to the client, then the answer you have already received are
correct: simply configure apache to run on the port you want using
virtual hosts.

Anyway, if you aren't willing to specify exactly what this script is
doing with the port, then I give up. Can't help you without more
information.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Direct script to specific port...

Posted by Rodolfo De Nadai <ro...@ima.sp.gov.br>.
Joshua, my script should be independent of apache when executing, but i 
have to run my script throuth IE or Firefox, so it depends of the apache 
to start and stop the script...

And i can't run a PHP script over internet without using the apache 
port... at least i'm not finding a way to do this in other way...

thanks


Joshua Slive escreveu:
>
>
> On 9/17/07, *Rodolfo De Nadai* <rodolfo.denadai@ima.sp.gov.br 
> <ma...@ima.sp.gov.br>> wrote:
>
>     I think this couldn't help me... because, if i restart apache and
>     the virtual hosts they will try to access a port that will be used
>     by my script...
>
>>>>     Is there a way to direct a specific script to run on a diferent port 
>>>>     than the default configurated in http.conf??
>>>>
>>>>           
>>     you can specify listening ports based on virtual hosts,rather than the application scripts.
>
>
> Your question is way under-specified in the first place. What does it 
> mean to have your script "run on a diferent (sic) port"? If your 
> script is interacting directly with the network (not through apache), 
> you should just be adjusting your script to use whatever port you want.
>
> Joshua.
>  
>
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.487 / Virus Database: 269.13.21/1012 - Release Date: 16/9/2007 18:32
>   

-- 
* Rodolfo De Nadai *
* Analista de Sistema Jr. - Desenvolvimento *

	

	
	*Informática de Municípios Associados S.A.*
Seu governo mais inteligente
rodolfo.denadai@ima.sp.gov.br <ma...@ima.sp.gov.br>  - 
www.ima.sp.gov.br <http://www.ima.sp.gov.br/>
Fone: (19) 3739-6000 / Ramal: 1307 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Direct script to specific port...

Posted by Joshua Slive <jo...@slive.ca>.
On 9/17/07, Rodolfo De Nadai <ro...@ima.sp.gov.br> wrote:
>
>  I think this couldn't help me... because, if i restart apache and the
> virtual hosts they will try to access a port that will be used by my
> script...
>
> Is there a way to direct a specific script to run on a diferent port
> than the default configurated in http.conf??
>
>        you can specify listening ports based on virtual hosts,rather than the application scripts.
>
>
Your question is way under-specified in the first place. What does it mean
to have your script "run on a diferent (sic) port"? If your script is
interacting directly with the network (not through apache), you should just
be adjusting your script to use whatever port you want.

Joshua.

Re: [users@httpd] Direct script to specific port...

Posted by Jeff Pang <pa...@gmx.de>.
-------- Original-Nachricht --------
> 
> Rodolfo De Nadai wrote:
> > Is there a way to direct a specific script to run on a diferent port 
> > than the default configurated in http.conf??
> >

you can specify listening ports based on virtual hosts,rather than the application scripts.
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Direct script to specific port...

Posted by Chris Howell <ch...@pyxisinnovation.com>.
You could try configuring Virtual hosts to run on different ports, 
running your different programs/scripts in each different host.

Rodolfo De Nadai wrote:
> Is there a way to direct a specific script to run on a diferent port 
> than the default configurated in http.conf??
>
> Exemple:
> default port is 80
> script myscript.php should run on port 5128
> all other scripts should run on port 80
>
> thanks

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org