View Full Version : mod_proxy / rewrite rules
KenKnight
11th January 2007, 00:00
Hi all,
I'm trying to test the mod_proxy stuff here. My goal is to have a XP server running apache behind my linux box and then if the URL has /app in it, it will pull from the xp server for my dynamic content applications I'm writing.
The reason for this is the engine that I'm using has more features and is more powerful on the windows side vs the linux side.
So in ISPconfig for my site, as a test, I added the following to the apache directives area;
======================================
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /app http://192.168.11.1
ProxyPassReverse /app http://192.168.11.1
=======================================
However, after a save and check again, I get 'NOT SUPPORT' messages with my stuff commented out. So my question is, how do I accomplish this?
Thanks,
Ken
PS. I'm basically sending it to my router website as a test.
falko
11th January 2007, 20:52
Is mod_proxy enabled in your Apache configuration?
KenKnight
13th January 2007, 05:39
Hi Falko,
Thanks for replying. Doh! No I didn't have it enabled. I issued a a2enmod proxy which appears to be the mod_proxy.so module.
After enabling it, it still did not work, so I decided to try some different settings. By using the Directory directive. Still no joy.
Any thoughts?
Thanks,
Ken
martinfst
13th January 2007, 12:28
As you are on a local LAN (and probably not direct Internet link), you could try ProxyRequests On
KenKnight
14th January 2007, 06:36
Thanks Martin. . . nope, didn't work.
======== edit ===============
Hi all,
Looks like the problem is that my ISPconfig is not updating the Vhosts file. Any reason why it would stop writing to the file??
Thanks,
Ken
till
14th January 2007, 12:28
You can locate the error as described here:
http://www.howtoforge.com/forums/showthread.php?t=7719
KenKnight
22nd January 2007, 00:25
Thanks till. Still no go on getting ISPConfig to update the vhosts file.
How can I "Force" ISPConfig to rewrite the entire file?
Thanks,
Ken
till
22nd January 2007, 00:32
You can not force it or it will break your apache configuration. Thats why ISPConfig does not update it.
Please locate the error as described in the thread I posted above:
1) Make a backup of /etc/apache2/vhosts/Vhosts_ispconfig.conf
2) Rename the latest file /etc/apache2/vhosts/Vhosts_ispconfig.conf_.... that has a date appended to /etc/apache2/vhosts/Vhosts_ispconfig.conf
3) run
httpd -t
and post the output.
KenKnight
22nd January 2007, 01:04
Hi Till,
Sadly there is no "latest file with a date appended to it" available to rename to Vhosts_ispconfig.conf.
Ken
till
22nd January 2007, 01:12
Please go to the directory where the Vhost_ispconfig.conf file is and execute:
ls -la Vhosts_ispconfig.conf*
and post the output here.
Please post also the output of:
ls -la /root/ispconfig/.ispconfig_lock
and:
ps aux | grep wconf
KenKnight
22nd January 2007, 02:04
Here ya go,
server1:/etc/apache2/vhosts# ls -la Vhosts_ispconfig.conf*
-rw-r--r-- 1 root root 8799 2007-01-21 17:56 Vhosts_ispconfig.conf
-rw------- 1 root root 9275 2007-01-14 00:03 Vhosts_ispconfig.conf.save
server1:/etc/apache2/vhosts# ls -la /root/ispconfig/.ispconfig_lock
ls: /root/ispconfig/.ispconfig_lock: No such file or directory
server1:/etc/apache2/vhosts# ps aux | grep wconf
root 19908 0.0 0.2 2556 1168 ? S Jan19 0:00 /bin/bash /root/ispconfig/sv/ispconfig_wconf
root 31148 0.0 0.1 1756 588 pts/0 R+ 19:04 0:00 grep wconf
Thanks,
Ken
till
22nd January 2007, 09:22
Thats all ok so far. Do you get any errors in the file /home/admispconfig/ispconfig/ispconfig.log ?
Please try to restart ISPConfig:
/etc/init.d/ispconfig_server restart
KenKnight
22nd January 2007, 17:26
I made a change to one of my sites optional apache directives by just putting in a comment line and saved it. Here is the results in the log;
22.01.2007 - 10:20:31 => INFO - /root/ispconfig/scripts/lib/config.lib.php, Line 1230: cp -fr /etc/httpd/vhosts/Vhosts_ispconfig.conf /etc/httpd/vhosts/Vhosts_ispconfig.conf~
22.01.2007 - 10:20:31 => INFO - /root/ispconfig/scripts/lib/config.lib.php, Line 2414: httpd -t &> /dev/null
22.01.2007 - 10:20:31 => INFO - /root/ispconfig/scripts/lib/config.lib.php, Line 2421: httpd syntax ok
22.01.2007 - 10:20:31 => WARN - /root/ispconfig/scripts/lib/classes/ispconfig_system.lib.php, Line 706: WARNING: could not /etc/init.d/httpd reload &> /dev/null
I noticed that its trying to reload httpd.. shouldn't that be apache2?
Should I put a symlink to apache2 or do we need to investigate further?
Oh also, the comment I made in ISPConfig did not show up in the actual vhosts file.
Thanks,
Ken
falko
23rd January 2007, 18:57
I noticed that its trying to reload httpd.. shouldn't that be apache2?
Should I put a symlink to apache2 or do we need to investigate further?
Which distribution are you using? What's the output of ls -la /etc/init.d/?
KenKnight
24th January 2007, 20:17
running The Perfect Setup: Debian Sarge 3.1 and just upgraded to ISPconfig 2.2.9 a week or two ago.
total 380
drwxr-xr-x 2 root root 4096 2007-01-22 10:27 .
drwxr-xr-x 77 root root 4096 2007-01-22 17:46 ..
-rwxr-xr-x 1 root root 3583 2006-07-28 05:07 apache2
-rwxr-xr-x 1 root root 1074 2002-01-18 03:13 atd
-rwx------ 1 root root 3176 2007-01-19 18:47 bastille-firewall
-rwx------ 1 root root 3176 2006-10-22 23:59 bastille-firewall.backup_01_19_2007__18_47_15
-rwxr-xr-x 1 root root 1621 2006-12-13 12:37 bind9
-rw-r--r-- 1 root root 2593 2004-09-10 11:00 bootclean.sh
-rwxr-xr-x 1 root root 1529 2005-01-04 17:43 bootlogd
-rwxr-xr-x 1 root root 1371 2004-09-10 11:00 bootmisc.sh
-rwxr-xr-x 1 root root 935 2004-09-10 11:00 checkfs.sh
-rwxr-xr-x 1 root root 7160 2004-09-10 11:00 checkroot.sh
-rwxr-xr-x 1 root root 5366 2005-02-05 04:17 console-screen.sh
-rwxr-xr-x 1 root root 696 2006-11-29 05:47 courier-authdaemon
-rwxr-xr-x 1 root root 1734 2006-11-02 05:47 courier-imap
-rwxr-xr-x 1 root root 1955 2006-11-02 05:47 courier-imap-ssl
-rwxr-xr-x 1 root root 1571 2006-11-02 05:47 courier-pop
-rwxr-xr-x 1 root root 1923 2006-11-02 05:47 courier-pop-ssl
-rwxr-xr-x 1 root root 1096 2004-07-28 10:12 cron
-rwxr-xr-x 1 root root 7823 2005-01-08 19:16 discover
-rwxr-xr-x 1 root root 729 2005-03-23 13:04 dns-clean
-rwxr-xr-x 1 root root 3888 2006-04-11 07:48 exim4
-rwxr-xr-x 1 root root 5592 2005-12-21 20:56 fetchmail
-rwxr-xr-x 1 root root 5823 2006-10-08 08:52 glibc.sh
-rwxr-xr-x 1 root root 811 2004-09-10 11:00 halt
-rwxr-xr-x 1 root root 1399 2007-01-07 17:17 HFCS-Server1
-rwxr-xr-x 1 root root 165 2004-09-10 11:00 hostname.sh
-rwxr-xr-x 1 root root 3344 2005-03-19 20:51 hotplug
-rwxr-xr-x 1 root root 359 2005-03-20 09:09 hotplug-net
lrwxrwxrwx 1 root root 7 2007-01-22 10:27 httpd -> apache2
-rwxr-xr-x 1 root root 3499 2005-09-18 03:04 hwclockfirst.sh
-rwxr-xr-x 1 root root 3638 2005-09-18 03:04 hwclock.sh
-rwxr-xr-x 1 root root 2240 2005-05-02 09:57 ifupdown
-rwxr-xr-x 1 root root 802 2005-04-04 09:33 ifupdown-clean
-rwxr-xr-x 1 root root 658 2005-04-10 18:35 initrd-tools.sh
-rwx------ 1 root root 3731 2007-01-19 18:47 ispconfig_server
-rwxr-xr-x 1 root root 2923 2005-02-04 14:30 keymap.sh
-rwxr-xr-x 1 root root 1346 2005-05-25 14:21 klogd
-rwxr-xr-x 1 root root 775 2004-07-05 02:46 lpd
-rwxr-xr-x 1 root root 798 2004-08-18 14:43 makedev
-rwxr-xr-x 1 root root 1420 2007-01-07 17:16 MantaManager
-rwxr-xr-x 1 root root 1320 2005-01-26 15:55 module-init-tools
-rwxr-xr-x 1 root root 864 2004-12-19 05:40 modutils
-rwxr-xr-x 1 root root 1033 2004-09-10 11:00 mountall.sh
-rwxr-xr-x 1 root root 1619 2004-09-10 11:02 mountnfs.sh
-rwxr-xr-x 1 root root 4872 2004-09-10 11:00 mountvirtfs
-rwxr-xr-x 1 root root 4368 2006-05-11 11:55 mysql
-rwxr-xr-x 1 root root 6128 2006-10-08 03:06 mysql.dpkg-dist
-rwxr-xr-x 1 root root 2051 2006-10-08 03:06 mysql-ndb
-rwxr-xr-x 1 root root 1980 2006-10-08 03:06 mysql-ndb-mgm
-rwxr-xr-x 1 root root 2503 2006-10-01 17:23 networking
-rwxr-xr-x 1 root root 1984 2005-01-05 07:38 nfs-common
-rwxr-xr-x 1 root root 1573 2006-10-13 20:24 ntp
-rwxr-xr-x 1 root root 659 2005-08-26 06:26 ntpdate
-rwxr-xr-x 1 root root 2305 2005-03-06 18:29 nviboot
-rwxr-xr-x 1 root root 2354 2006-09-10 16:41 openbsd-inetd
-rwxr-xr-x 1 root root 1076 2005-03-20 03:04 portmap
-rwxr-xr-x 1 root root 2974 2006-12-17 22:23 postfix
-rwxr-xr-x 1 root root 2024 2006-12-07 02:40 postgrey
-rwxr-xr-x 1 root root 1452 2006-06-03 23:57 ppp
-rwxr-xr-x 1 root root 189 2006-06-03 23:57 pppd-dns
-rwxr-xr-x 1 root root 1039 2004-04-13 01:26 procps.sh
-rwxr-xr-x 1 root root 4232 2007-01-02 05:00 proftpd
-rwxr-xr-x 1 root root 2556 2005-05-11 06:29 quota
-rwxr-xr-x 1 root root 1160 2005-05-11 06:29 quotarpc
-rwxr-xr-x 1 root root 2235 2004-09-10 11:00 rc
-rwxr-xr-x 1 root root 1190 2004-09-10 11:00 rcS
-rw-r--r-- 1 root root 846 2004-09-10 11:00 README
-rwxr-xr-x 1 root root 197 2004-09-10 11:00 reboot
-rwxr-xr-x 1 root root 457 2004-09-10 11:00 rmnologin
-rwxr-xr-x 1 root root 1931 2006-10-22 23:05 saslauthd
-rwxr-xr-x 1 root root 5937 2006-12-13 16:23 saslauthd.dpkg-dist
-rwxr-xr-x 1 root root 433 2006-11-08 14:53 screen-cleanup
-rwxr-xr-x 1 root root 358 2004-09-10 11:00 sendsigs
-rwxr-xr-x 1 root root 591 2004-09-10 11:00 single
-rwxr-xr-x 1 root root 2111 2004-09-10 11:00 skeleton
-rwxr-xr-x 1 root root 5275 2006-12-12 17:08 slapd
-rwxr-xr-x 1 root root 1548 2006-06-03 10:43 spamassassin
-rwxr-xr-x 1 root root 1891 2004-11-28 10:33 ssh
lrwxrwxrwx 1 root root 8 2006-10-22 22:23 stop-bootlogd -> bootlogd
-rwxr-xr-x 1 root root 2102 2006-10-22 22:55 sysklogd
-rwxr-xr-x 1 root root 509 2004-09-10 11:00 umountfs
-rwxr-xr-x 1 root root 1291 2004-09-10 11:00 umountnfs.sh
-rwxr-xr-x 1 root root 1381 2004-09-10 11:00 urandom
-rwxr-xr-x 1 root root 1486 2006-10-23 00:44 WebDev10
-rwxr-xr-x 1 root root 1963 2006-10-02 15:41 xfree86-common
THanks,
Ken
falko
25th January 2007, 21:13
Does it say apache2 or httpd in the isp_server table in the ISPConfig database? If it's httpd, either change it to apache2 or create a symlink /etc/init.d/httpd to /etc/init.d/apache2.
KenKnight
26th January 2007, 04:38
I created a symlink after I made the post the other day.
For whatever reason its still not updating the vhosts file and I just found out the other day that the SSL is not working on the system either. The ports.conf has 443 in it and I've got the 443 virtual host definition for the same domain name in the vhosts.
thanks,
Ken
martinfst
26th January 2007, 10:14
If you have an error, the vhosts file is not updated and ISPConfig falls back to the previous (working) version, leaving behind a vhosts file with a date/time stamp attached.
To see what's wrong, stop apache2, switch the configfiles vhosts with vhosts_datetime and test with httpd -t. You'll then get to see where your error is.
KenKnight
26th January 2007, 17:29
Thanks Martin. Sadly, there is no Vhosts_ispconfig.datetimestamp file being generated by ISPConfig as I mention earlier. I have copied the current vhosts to the format needed by the httpd check, and it comes back with a Syntax OK.
Thanks,
Ken
KenKnight
26th January 2007, 22:59
Hi all,
I setup another debian/ispconfig box and created a virtual host on it. I then used the Vhosts_ispconfig.conf for that box as a template and recreated all the entries on my original box. There were huge differences and I'm not sure if it was because I'd upgraded the original from 2.2.6 to 2.2.9 or what, however, I put the new vhosts in place and restarted apache. Made a change in ISPconfig and nothing happened. And amazingly my ssl is still not working on the virtual server I have it turned on for.
I'm going to reinstall ISPConfig and see what happens.
Thanks,
Ken
KenKnight
27th January 2007, 00:29
Ok, reinstalled ispconfig and here's some interesting info that happened at the end.
cp: cannot stat `/etc/proftpd.conf': No such file or directory
Warning: fopen(/etc/proftpd.conf): failed to open stream: No such file or direct
ory in /root/install_ispconfig/install.php on line 91
Warning: filesize(): stat failed for /etc/proftpd.conf in /root/install_ispconfi
g/install.php on line 92
Warning: fclose(): supplied argument is not a valid stream resource in /root/ins
tall_ispconfig/install.php on line 97
Connected successfully to MySQL server
Es ist schon eine Datenbank mit dem Namen db_ispconfig vorhanden!
Restarting some services...
[Fri Jan 26 17:25:15 2007] [warn] VirtualHost 192.168.10.12:443 overlaps with Vi
rtualHost 192.168.10.12:443, the first has precedence, perhaps you need a NameVi
rtualHost directive
[Fri Jan 26 17:25:15 2007] [warn] NameVirtualHost 192.168.10.12:80 has no Virtua
lHosts
Stopping Postfix Mail Transport Agent: postfix.
Starting Postfix Mail Transport Agent: postfix.
Stopping ftp server: proftpd.
Starting ftp server: proftpd - setting default address to 127.0.0.1
.
Starting ISPConfig system...
/root/ispconfig/httpd/bin/apachectl startssl: httpd started
FreshClam is already running!
ISPConfig system is now up and running!
Congratulations! Your ISPConfig system is now installed. If you had to install q
uota, please take the steps described in the installation manual. Otherwise your
system is now available without reboot.
Please direct your browser to
All my virtual hosts are resolving on port 80 properly, however, the ssl is not.
Any suggestions based on what you see there?
SOME PROGRESS:: I did a find / grep command and found that the ISPConfig is now updating a Vhosts file in /etc/httpd/vhosts/Vhosts_ispconfig.conf , But still including the /etc/apache2/vhosts/Vhosts_ispconfig.conf in apache2.conf. I changed the include to point to the one that is being updated and everything accept the ssl is now working and updating properly.
Any ideas on the SSL?
Thanks,
Ken
falko
27th January 2007, 14:35
What's the output of updatedb
locate proftpd.conf?
What's in Vhosts_ispconfig.conf? What's the output of httpd -t and netstat -tap? Any errors in Apache's error log or SSL error log?
KenKnight
27th January 2007, 18:06
server1:~# updatedb
server1:~# locate proftpd.conf
/etc/proftpd.conf
/etc/proftpd.conf.orig
/etc/proftpd/proftpd.conf
/etc/proftpd/proftpd.conf.dpkg-dist
/etc/proftpd/proftpd.conf.proftpd-new
/etc/proftpd/proftpd.conf.proftpd-old
/usr/share/proftpd/templates/proftpd.conf
/var/lib/dpkg/info/proftpd.conffiles
/var/lib/dpkg/info/proftpd.config
server1:~#
server1:~# httpd -t
Syntax OK
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 localhost.localdo:60000 *:* LISTEN 1243/postgrey.pid -
tcp 0 0 *:imaps *:* LISTEN 14480/couriertcpd
tcp 0 0 *:pop3s *:* LISTEN 15097/couriertcpd
tcp 0 0 *:4900 *:* LISTEN 4469/manta
tcp 0 0 *:ldap *:* LISTEN 21341/slapd
tcp 0 0 *:4999 *:* LISTEN 4451/mantamanager
tcp 0 0 *:mysql *:* LISTEN 17977/mysqld
tcp 0 0 *:rfe *:* LISTEN 4451/mantamanager
tcp 0 0 *:pop3 *:* LISTEN 15048/couriertcpd
tcp 0 0 *:imap2 *:* LISTEN 14456/couriertcpd
tcp 0 0 *:www *:* LISTEN 25049/apache2
tcp 0 0 *:81 *:* LISTEN 12178/ispconfig_htt
tcp 0 0 *:ftp *:* LISTEN 10622/proftpd: (acc
tcp 0 0 server1.helpcons:domain *:* LISTEN 14143/named
tcp 0 0 localhost.locald:domain *:* LISTEN 14143/named
tcp 0 0 *:ssh *:* LISTEN 1554/sshd
tcp 0 0 *:smtp *:* LISTEN 10696/master
tcp 0 0 localhost.localdoma:953 *:* LISTEN 14143/named
tcp 0 0 *:https *:* LISTEN 25049/apache2
tcp 0 248 server1.helpconsult:ssh 192.168.10.1:2315 ESTABLISHED2163/0
tcp 0 0 localhost.localdo:48963 localhost.localdo:60000 ESTABLISHED2231/smtpd
tcp 0 0 localhost.localdo:60000 localhost.localdo:48963 ESTABLISHED1243/postgrey.pid -
Thanks falko!
Ken
falko
28th January 2007, 21:13
What's in Vhosts_ispconfig.conf?
What's the output of ls -la /etc/proftpd.conf?
KenKnight
30th January 2007, 19:37
Hi Falko,
I've pretty much given up on the current server and have since create a vmware version to transfer everything to. I'm not going to take the normal route of pulling the db_ispconfig sql database over. I'm going to recreate the all the entries one by one in ispconfig on the new server with all the users and then untar the www.tar.gz and use chown Num:Num to get the UID:GID's to match up properly
My main question now, and this may be better served in a new thread, but what is the proper way to upgrade to php5 in ver 2.2.9? I've tried for the last four days and every time it screws up apache to the point that it simply downloads the php script.
Thanks,
Ken
PS. On one of my tries recreating everything one by one, I wound up with a couple dozen Vhosts_ispconfig.conf_26-01-07_xx-xx-xx files. Should I wait ten seconds after each modification to give the cron job time to integrate changes?
till
30th January 2007, 23:21
The besat way is to use the packages from dotdeb.org. I posted this in your new thread too.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.