LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Squid Redirect (http://www.linuxquestions.org/questions/linux-server-73/squid-redirect-800628/)

txlombardi 04-07-2010 01:13 PM

Squid Redirect
 
I'm having some problems with a Squid redirect. The system:
Fedora 12 - fully updated as of April 6, 2010
Squid installed
SquidGuard installed
Transparent-Proxying installed (runs as a service)
IPTABLES running
Server has 2 NIC's
Server is configured as a bridge
Transparent proxy configured and working
Trying to setup a Captive Portal as detailed on the following site:

http://www.alexvanherwijnen.nl/blog/...ortal-for-free

All components for the Captive Portal are installed.
Here is the problem. The last item to do for the Captive Portal was modify squid.conf, which was done. Immediately, when restarting the Squid service, I got the following error (several errors shown, but each instance is from one attempt to stop and start the squid service):
squid: ERROR: Could not send signal 0 to process 2983: (3) No such process
squid: ERROR: Could not send signal 0 to process 3457: (3) No such process
squid: ERROR: Could not send signal 0 to process 7763: (3) No such process
squid: ERROR: Could not send signal 0 to process 7867: (3) No such process
Terminal window shows the following:
[root@pns-linux admin]# service squid stop
Stopping squid: [FAILED]
[root@pns-linux admin]# service squid status
squid dead but pid file exists
[root@pns-linux admin]#
What is causing the failure and errors is the following lines in the squid.conf file:
url_rewrite_program /var/www/html/scripts/redirect.php
url_rewrite_children 4
If I comment the two lines out, Squid and the transparent proxy works fine, but then there is no redirection for the Captive Portal. The redirect.php is there and it is set to allow execution. It is almost as if the url_rewrite_program is not there. I have looked in the file system for it, but found nothing. My guess is it is probably a procedure in a configuration file.

Any help would be appreciated. This has been dogging me for three days now.

Tony

TB0ne 04-07-2010 02:01 PM

Quote:

Originally Posted by txlombardi (Post 3927722)
I'm having some problems with a Squid redirect. The system:
Fedora 12 - fully updated as of April 6, 2010
Squid installed
SquidGuard installed
Transparent-Proxying installed (runs as a service)
IPTABLES running
Server has 2 NIC's
Server is configured as a bridge
Transparent proxy configured and working
Trying to setup a Captive Portal as detailed on the following site:

http://www.alexvanherwijnen.nl/blog/...ortal-for-free

All components for the Captive Portal are installed.
Here is the problem. The last item to do for the Captive Portal was modify squid.conf, which was done. Immediately, when restarting the Squid service, I got the following error (several errors shown, but each instance is from one attempt to stop and start the squid service):
squid: ERROR: Could not send signal 0 to process 2983: (3) No such process
squid: ERROR: Could not send signal 0 to process 3457: (3) No such process
squid: ERROR: Could not send signal 0 to process 7763: (3) No such process
squid: ERROR: Could not send signal 0 to process 7867: (3) No such process
Terminal window shows the following:
[root@pns-linux admin]# service squid stop
Stopping squid: [FAILED]
[root@pns-linux admin]# service squid status
squid dead but pid file exists
[root@pns-linux admin]#
What is causing the failure and errors is the following lines in the squid.conf file:
url_rewrite_program /var/www/html/scripts/redirect.php
url_rewrite_children 4
If I comment the two lines out, Squid and the transparent proxy works fine, but then there is no redirection for the Captive Portal. The redirect.php is there and it is set to allow execution. It is almost as if the url_rewrite_program is not there. I have looked in the file system for it, but found nothing. My guess is it is probably a procedure in a configuration file.

Well, the:
Quote:

squid dead but pid file exists
line jumps out. How did you stop squid the first time?? If you just killed it, the PID file is still there. Check in /var/lock (or look in the squid startup script), for where the squid PID file is kept. Delete it, then try to restart.

Looks like something has an old pid lockfile out there, that references the pids that don't exist anymore.

txlombardi 04-07-2010 07:05 PM

Thank you for the reply TB0ne.

As you can see from the lines I placed in my email, the service was stopped using "service squid stop" command. If the service was started with the url_rewrite_program uncommented in the squid.conf file, when stopping the service the error occurred. If the service was started with the url_rewrite_program commented out, there was no problem starting or stopping the service without error. The process was not killed.

Something is going on with the url_rewrite_program. Are you familiar with it?

Tony


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