Subdomains through ISPConfig for different purposes

Discussion in 'Tips/Tricks/Mods' started by wustl_2008, Jun 21, 2006.

  1. wustl_2008

    wustl_2008 New Member

    I have searched through the threads and found several relevant threads but have had no luck in figuring out EXACTLY what I need to do to accomplish the following.

    I am trying to run Plone/Zope for a lot of my sites and I need to have the domain use Rewrite rules and ProxyPass in order to render the information from http://example.com:8800/plone_site as http://example_domain2.com I have tried a lot of things but cannot get this to work for the life of me - is there any specific way to go about doing something like this? I've tried the directives I need in the Apache directives part of the site and have gotten the rewrite rule to work but ProxyPass rules seem to simply render an error as if the page doesn't exist at all? Any ideas / help appreciated.

    I'm also trying to figure out how to create a subdomain for my webmail interface. I've seen several posts about this but I can't seem to decipher how to install a package for a NEW domain - the packages seemed to be installed for a global setting and show up inside the tools link (I'm using roundcube for my webmail). Is there specific process to go through in order to get https://webmail.example.com to display https://myserver.com:81/roundcubewebmail

    As I'm sure you noticed both of these problems go hand-in-hand with very similar goals. If I can solve one I'm sure the other will fall right in line with it.

    Any advice appreciated as I'm new to ISPConfig (but a long-time apache veteran). I've tried creating my own servername rules in an extra include for apache2.conf with no luck as well.

    wustl_2008
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    In ISPConfig you can put your directives and custom rewrite rules in the apache directives window of the website, you dont have to use additional apache includes.
     
  3. wustl_2008

    wustl_2008 New Member

    Till,

    I tried that before too and didn't have any luck with that but I'll see what happens when I try again ;) Thanks for the tip though.

    wustl_2008
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    If your config gets commented out by ISPConfig, you can try the following procedure to debug the problem.

    1) Make a backup of the file Vhost_ispconfig.conf

    2) Open Vhost_ispconfig.conf in an editor, search for the vhost of your website and remoce the comments in front of the directives.

    3) run "httpd -t" to get the error message from apache.

    4) Either fix the error or restore your backup of Vhost_ispconfig.conf.

    This procedure does not affect your running webserver as long as you dont restart it during the test.
     
  5. wustl_2008

    wustl_2008 New Member

    Thanks Till. That is a great idea. I finally got all my subdomains setup and have got webmail, phpmyadmin, and my Zope/Plone applications loading through them SOMETIMES. I can't figure out why half the time they load but the other half they don't? The only thing I can think of is if something in my DNS records is possibly wrong perhaps the queries are not getting to where they should be?

    I've noticed that my nameserver records are setup by my two IPs I put in, so instead of NS ns1.mydomain.com I'm getting NS1 [IP address]. Is this a common problem in ISPConfig or did I probably set something up wrong or does it really matter?

    Any other ideas as to why my subdomains only work part of the time is also greatly appreciated. ISPConfig seems like a great interface and I'd love to figure these minor bugs out so I can avoid having to do all these records by hand again ;)

    Thanks,

    wustl_2008
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    This sounds like a problem I had some time ago, my primary and secondary nameservers where not in sync, one server provided the right IP, the other provided an old IP address. Try to query both nameservers with dig if they return the correct IP address.

    The syntax is:

    dig @ns1.yournameserver.com www.yourdomian.com
    dig @ns2.yournameserver.com www.yourdomian.com

    You must set the nameservers under management > server > settings on the DNS tab.
     
  7. wustl_2008

    wustl_2008 New Member

    DNS Settings Update....

    Till,

    Thanks for the great ideas. I've noticed that my DNS records are not updating when I make changes within ISPConfig. I finally (after hours of playing around and debugging) realized that a day or so ago I changed the DNS user & group names under Managment -> Server -> Settings -> DNS. I changed these to the 'bind' user as some of the other files and they seem to be getting updated now. I'll post again when I find out if this solved the problem or not (probably 24 - 48 hours to let the changes take effect). If anyone knows how to speed up the DNS cache flushing / spreading process or whatever I'm obviously a pretty pathetic newb in the DNS realm (so many years doing web development & server admin and I've managed to dodge this hectic stuff, now I know why!)

    Thanks,

    wustl_2008
     
  8. nenad

    nenad ISPConfig Developer ISPConfig Developer

    Hi, did you try to change "DNSManager" ---> Options: Refresh, Expire, TimeToLive, Retry ? Try within ISPConfig, or at your DNSservice provider if you are using External DNS.

    BTW Which Ditro are you using? Which Zope and Plone are you using? I need some help for seting up exactly what you did (subdomains for Zope/Plone)
     
  9. wustl_2008

    wustl_2008 New Member

    I didn't try the DNSManager -> Options: Refresh, Expire, TimeToLive, Retry. I got so frustrated with ISPConfig not working with my DNS settings (I had to uninstall and reinstall ISPConfig a few times so I'm guessing I screwed up somewhere - but I have too much data to just try and do a clean install again or I would). Anyway, I went to an external DNS management solution and my websites and subdomains are working perfectly by just adding my subdomains as websites. ISPConfig is an amazing tool and I'm very glad to have it to save me time on my apache config files. After changing my Nameservers to point to my external DNS management tool's NS records I had instant subdomains working perfectly all the time within a half hour ;)

    I'm running ISPConfing (most recent release, 2.2.3 iirc?) on Ubuntu 6.06 with Python 2.3.5, Zope 2.8.7, Plone 2.1.3 AND with Python 2.4.3, Zope 2.9.3, Plone 2.5. I'll be posting a blog about how I accomplished this hopefully this weekend, but for now you may find this link http://www.zettai.net/Support/Howto/Zope27Python23Install helpful to setup more than one instance of Python/Zope/Plone at once if you're interested.

    To setup ISPConfig I created a NEW website for EVERY subdomain. I started by creating the main site: domain.com
    Then I created new sites for each subdomain:
    mail.domain.com
    zope.domain.com
    zdev.domain.com

    For the zope domains I added the following ProxyPass rules in the "Apache Directives" box for the subdomain website:

    ProxyPass / http://www.your-domain.com:8080/Vir...our-domain.com:80/plone_site/VirtualHostRoot/
    ProxyPassReverse / http://www.your-domain.com:8080/Vir...our-domain.com:80/plone_site/VirtualHostRoot/

    To get this to work in ISPConfig I had to go into the /etc/apache2/ and some subdirectory related to proxy or includes and then find a file named "proxy.conf". In this file there is a command that I think ISPConfig adds (not certain if it is ISPConfig or just that way by default) that says something like:

    <Proxy *>
    deny, allow
    Deny all
    </Proxy>

    I found a tutorial on another website showing that Proxy has to be enabled for the specific IP and site you want... I don't have the link handy but if you can't find the reference for this let me know and I'll try to find the link. Essentially you're trying to allow Proxy passing for only your IP address the zope site is on..... Search on "zope proxy apache" or something like that and you may find it (it was a tutorial on zope.org if I remember right).

    I'm not sure if ISPConfig adds "mod_proxy" into Apache by default. I configured my server with the "Perfect Setup Ubuntu 6.06" guide from Howto Forge. If you can't find any proxy stuff enabled (google on how to check for mod_proxy) - I think you can enable it easily by doing something like: sudo a2enmod mod_proxy and then restarting apache2.

    I hope this gives you the list of bugs I ran into and potential solutions. I'll probably try to write a tutorial about this for plone.org if I get the chance (after I post my personal blog version with links so I can remember what I did). Let me know if you run into any problems and I'll do whatever I can to help! Plone/Zope run perfectly via my zope.domain.com all day now ;)

    wustl_2008
     
    Last edited: Jun 28, 2006
  10. nenad

    nenad ISPConfig Developer ISPConfig Developer

    Thank you for your informations regarding to Zope/Plone.

    As for DNS, yes, it could be quite hard to set it up via ISPConfig, especially if there is only one domain. There are suggestions that there has to be two domains, one www.techical.com (with DNS) and other website domain www.websites-domain.com , where techical.com domain is used for DNS purposes. However it is possible to set up DNS servers to work flawlessly with only one domain, but using manual non-standard (ISPConfig) setup.

    Anyway, you have chosen probably the best solution: use of external DNS services.
     
  11. falko

    falko Super Moderator ISPConfig Developer

    Have a look at the Expire, Refresh, TTL, etc. settings that are explained in this tutorial: http://www.howtoforge.com/traditional_dns_howto :)
    Also check out this one: http://www.howtoforge.com/ispconfig_dns_godaddy
     
  12. nenad

    nenad ISPConfig Developer ISPConfig Developer

    Is that tutorial that you were talking about this one?

    http://www.zope.org/Members/anser/apache_zserver

    I am using Debian Sarge with ISPConfig...

    in which apache config file should I put:



     
    Last edited: Jun 27, 2006
  13. falko

    falko Super Moderator ISPConfig Developer

    Code:
    ProxyPass /Zope/ http://fightclub.org:8080/
    ProxyPassReverse /Zope/ http://fightclub.org:8080/
    goes to the appropriate <Directory> section at the end of your main Apache configuration (before Vhosts_ispconfig.conf is included.
     
  14. wustl_2008

    wustl_2008 New Member

    Apache - Zope stuff

    That's not the one I was talking about, but it is similar in concept. I'll see if I can find it soon as I get a chance (been swamped with server transfers right now).


    The ProxyPass directives go through ISPConfig - not in the apche config files. You click on the website you want directed to a Zope/Plone site (full domain or subdomain are all websites in ISPConfig). At the bottom of the main page for any website you'll see a textbox for Apache Directives. This is where you're proxypass stuff will be entered.

    My ProxyPass setup is like this for a subdomain:
    ProxyPass / http://servername.com:8800/VirtualHostBase/http/zope.yourdomain.com:80/VirtualHostRoot/
    ProxyPassReverse / http://servername.com:8800/VirtualHostBase/http/http/zope.yourdomain.com:80/VirtualHostRoot/

    And like this for a full domain (entire domain uses one zope site):
    ProxyPass / http://servername.com:8800/VirtualHostBase/http/yourdomain.com:80/plone_instance_name/VirtualHostRoot/
    ProxyPassReverse / http://servername.com:8800/VirtualHostBase/http/http/yourdomain.com:80/plone_instance_name/VirtualHostRoot/

    The first example shows how I access ALL my zope sites on a specific Zope port. Anything I can access on port 8800 with my normal setup (servername.com:8800) is now accessible from zope.mydomain.com

    So the ZMI management interface (usu. from http://servername.com:8800/manage) is now accessible at: http://zope.mydomain.com/manage

    The second example is setting up a domain name to be served completely by a specific Plone instance. So I want to render the Plone site at:
    http://servername.com:8800/ploneSite
    for the domain
    http://mydomain.com

    Hope this helps! Let me know if you have any other questions. Zope behind Apache with ISPConfig has been a breeze once I figured out that subdomains are their own website within ISPConfig and that my ProxyPass rules went inside the Apache Directives box!
     
  15. nenad

    nenad ISPConfig Developer ISPConfig Developer

    OK, but what should I do with this:

    LoadModule proxy_module libexec/apache/libproxy.so
    AddModule mod_proxy.c

    How to check or load or install apache module for proxy?
     
  16. nenad

    nenad ISPConfig Developer ISPConfig Developer

    This is what happened when I entered Proxypass directive into ISPConfig (2.2.3) apache directive box:

    # ProxyPass / http://server.201.web-hosting.co.yu...web-hosting.co.yu:80/default/VirtualHostRoot/ # NOT SUPPORTED!

    The "NOT SUPPORTED" line was added by ISPConfig, comments "#" too

    ---------------------------------------------------------------------

    server201:~# a2enmod proxy
    Module proxy installed; run /etc/init.d/apache2 force-reload to enable.
    server201:~#

    It seems that proxy module is installed?
    ---------------------------------------------------------------------

    Hmmmm it seems that this have to be done too

    server201:~# /etc/init.d/apache2 force-reload
    Forcing reload of web server: Apache2.
    server201:~# a2enmod proxy
    This module is already enabled!
     
    Last edited: Jun 29, 2006
  17. falko

    falko Super Moderator ISPConfig Developer

    What's the output of
    Code:
    ls -la /etc/apache2/mods-available
    and
    Code:
    ls -la /etc/apache2/mods-enabled
    ?
     
  18. nenad

    nenad ISPConfig Developer ISPConfig Developer

    I resolved issue with
    /etc/init.d/apache2 force-reload

    or I didn't ? It seems that apache is doing redirect, ISPConfig is not complaining any more, but accepts directives...
    but plone is still not working, what is not ISPConfig/Apache problem ...

    server201:~# ls -la /etc/apache2/mods-available
    total 248
    drwxr-xr-x 2 root root 4096 2006-06-27 00:41 .
    drwxr-xr-x 9 root root 4096 2006-05-28 16:52 ..
    -rw-r--r-- 1 root root 66 2005-09-05 13:16 actions.load
    -rw-r--r-- 1 root root 60 2005-09-05 13:16 asis.load
    -rw-r--r-- 1 root root 70 2005-09-05 13:16 auth_anon.load
    -rw-r--r-- 1 root root 68 2005-09-05 13:16 auth_dbm.load
    -rw-r--r-- 1 root root 74 2005-09-05 13:16 auth_digest.load
    -rw-r--r-- 1 root root 130 2005-09-05 13:16 auth_ldap.load
    -rw-r--r-- 1 root root 62 2005-09-05 13:16 cache.load
    -rw-r--r-- 1 root root 70 2005-09-05 13:16 cern_meta.load
    -rw-r--r-- 1 root root 61 2005-09-05 13:16 cgid.conf
    -rw-r--r-- 1 root root 60 2005-09-05 13:16 cgid.load
    -rw-r--r-- 1 root root 58 2006-05-28 16:52 cgi.load
    -rw-r--r-- 1 root root 58 2006-05-28 16:52 cgi.load.28-05-06_16-51-49
    -rw-r--r-- 1 root root 37 2005-09-05 13:16 dav_fs.conf
    -rw-r--r-- 1 root root 64 2005-09-05 13:16 dav_fs.load
    -rw-r--r-- 1 root root 58 2005-09-05 13:16 dav.load
    -rw-r--r-- 1 root root 66 2005-09-05 13:16 deflate.load
    -rw-r--r-- 1 root root 72 2005-09-05 13:16 disk_cache.load
    -rw-r--r-- 1 root root 66 2005-09-05 13:16 expires.load
    -rw-r--r-- 1 root root 72 2005-09-05 13:16 ext_filter.load
    -rw-r--r-- 1 root root 72 2005-09-05 13:16 file_cache.load
    -rw-r--r-- 1 root root 66 2005-09-05 13:16 headers.load
    -rw-r--r-- 1 root root 60 2005-09-05 13:16 imap.load
    -rw-r--r-- 1 root root 66 2006-05-28 16:52 include.load
    -rw-r--r-- 1 root root 66 2006-05-28 16:52 include.load.28-05-06_16-51-49
    -rw-r--r-- 1 root root 60 2005-09-05 13:16 info.load
    -rw-r--r-- 1 root root 60 2005-09-05 13:16 ldap.load
    -rw-r--r-- 1 root root 70 2005-09-05 13:16 mem_cache.load
    -rw-r--r-- 1 root root 90 2005-09-05 13:16 mime_magic.conf
    -rw-r--r-- 1 root root 72 2005-09-05 13:16 mime_magic.load
    -rw-r--r-- 1 root root 64 2005-02-11 12:29 mod_python.load
    -rw-r--r-- 1 root root 19 2006-05-28 16:52 perl.conf
    -rw-r--r-- 1 root root 19 2006-05-28 16:52 perl.conf.28-05-06_16-51-49
    -rw-r--r-- 1 root root 60 2006-05-28 16:52 perl.load
    -rw-r--r-- 1 root root 60 2006-05-28 16:52 perl.load.28-05-06_16-51-49
    -rw-r--r-- 1 root root 135 2006-05-28 16:52 php4.conf
    -rw-r--r-- 1 root root 135 2006-05-28 16:52 php4.conf.28-05-06_16-51-49
    -rw-r--r-- 1 root root 59 2006-05-28 16:52 php4.load
    -rw-r--r-- 1 root root 59 2006-05-28 16:52 php4.load.28-05-06_16-51-49
    -rw-r--r-- 1 root root 840 2005-09-05 13:16 proxy.conf
    -rw-r--r-- 1 root root 78 2005-09-05 13:16 proxy_connect.load
    -rw-r--r-- 1 root root 70 2005-09-05 13:16 proxy_ftp.load
    -rw-r--r-- 1 root root 103 2005-03-23 15:43 proxy_html.load
    -rw-r--r-- 1 root root 72 2005-09-05 13:16 proxy_http.load
    -rw-r--r-- 1 root root 316 2005-09-05 13:16 proxy.load
    -rw-r--r-- 1 root root 66 2006-05-28 16:52 rewrite.load
    -rw-r--r-- 1 root root 66 2006-05-28 16:52 rewrite.load.28-05-06_16-51-49
    -rw-r--r-- 1 root root 66 2005-09-05 13:16 speling.load
    -rw-r--r-- 1 root root 3545 2006-05-28 16:52 ssl.conf
    -rw-r--r-- 1 root root 3545 2006-05-28 16:52 ssl.conf.28-05-06_16-51-49
    -rw-r--r-- 1 root root 58 2006-05-28 16:52 ssl.load
    -rw-r--r-- 1 root root 58 2006-05-28 16:52 ssl.load.28-05-06_16-51-49
    -rw-r--r-- 1 root root 64 2006-05-28 16:52 suexec.load
    -rw-r--r-- 1 root root 64 2006-05-28 16:52 suexec.load.28-05-06_16-51-49
    -rw-r--r-- 1 root root 70 2005-09-05 13:16 unique_id.load
    -rw-r--r-- 1 root root 244 2006-05-28 16:52 userdir.conf
    -rw-r--r-- 1 root root 244 2006-05-28 16:52 userdir.conf.28-05-06_16-51-49
    -rw-r--r-- 1 root root 66 2006-05-28 16:52 userdir.load
    -rw-r--r-- 1 root root 66 2006-05-28 16:52 userdir.load.28-05-06_16-51-49
    -rw-r--r-- 1 root root 70 2005-09-05 13:16 usertrack.load
    -rw-r--r-- 1 root root 74 2005-09-05 13:16 vhost_alias.load
    ---------------------------------------------------------------------
    server201:~# ls -la /etc/apache2/mods-enabled
    total 12
    drwxr-xr-x 2 root root 4096 2006-06-29 13:16 .
    drwxr-xr-x 9 root root 4096 2006-05-28 16:52 ..
    lrwxrwxrwx 1 root root 36 2006-05-28 15:01 cgi.load -> /etc/apache2/mods-available/cgi.load
    lrwxrwxrwx 1 root root 40 2006-05-28 15:20 include.load -> /etc/apache2/mods-available/include.load
    lrwxrwxrwx 1 root root 33 2006-06-27 00:41 mod_python.load -> ../mods-available/mod_python.load
    lrwxrwxrwx 1 root root 37 2006-05-28 15:02 perl.conf -> /etc/apache2/mods-available/perl.conf
    lrwxrwxrwx 1 root root 37 2006-05-28 15:02 perl.load -> /etc/apache2/mods-available/perl.load
    lrwxrwxrwx 1 root root 37 2006-05-28 15:01 php4.conf -> /etc/apache2/mods-available/php4.conf
    -rw-r--r-- 1 root root 133 2006-05-28 15:19 php4.conf~
    lrwxrwxrwx 1 root root 37 2006-05-28 15:01 php4.load -> /etc/apache2/mods-available/php4.load
    lrwxrwxrwx 1 root root 38 2006-06-29 13:16 proxy.conf -> /etc/apache2/mods-available/proxy.conf
    lrwxrwxrwx 1 root root 43 2006-06-27 00:40 proxy_html.load -> /etc/apache2/mods-available/proxy_html.load
    lrwxrwxrwx 1 root root 38 2006-06-29 13:16 proxy.load -> /etc/apache2/mods-available/proxy.load
    lrwxrwxrwx 1 root root 40 2006-05-28 15:20 rewrite.load -> /etc/apache2/mods-available/rewrite.load
    lrwxrwxrwx 1 root root 36 2006-05-28 15:20 ssl.conf -> /etc/apache2/mods-available/ssl.conf
    lrwxrwxrwx 1 root root 36 2006-05-28 15:20 ssl.load -> /etc/apache2/mods-available/ssl.load
    lrwxrwxrwx 1 root root 39 2006-05-28 15:20 suexec.load -> /etc/apache2/mods-available/suexec.load
    lrwxrwxrwx 1 root root 40 2006-05-28 14:44 userdir.conf -> /etc/apache2/mods-available/userdir.conf
    lrwxrwxrwx 1 root root 40 2006-05-28 14:44 userdir.load -> /etc/apache2/mods-available/userdir.load
     
  19. wustl_2008

    wustl_2008 New Member

    Nenad,

    The proxy directive for Plone is very picky as it adds in VirtualHostBase and VirtualHostRoot. Check a few posts above and make sure you use the one that is appropriate for your situation. If you want you can post your ProxyPass directives so I can see if they look right?

    How do you know the proxy redirect is working and that it is Plone? If you go to your domain (or subdomain) what is the output of it? What kind of error are you getting.

    It definitely seems like you've got the proxy stuff enabled in Apache - have you checked /apache2/mods-available/proxy.conf or /apache2/proxy.conf to make sure that * is not disallowed? I think I posted earlier with the change that needs to be made there to allow ProxyPass to receive requests for your Zope IP?

    Also, to make sure that Plone/Zope are working just navigate to the http://[IP]:[port]/[plone_instance] that you have Zope and Plone running on. If those load while you are doing these tests you'll know Plone and Zope are doing their part - and that they are not the problem.

    -Steven
     
    Last edited: Jun 29, 2006
  20. nenad

    nenad ISPConfig Developer ISPConfig Developer

    I just realised that prxy was DISABLED:

    <IfModule mod_proxy.c>

    #turning ProxyRequests on and allowing proxying from all may allow
    #spammers to use your proxy to send email.

    ProxyRequests Off

    <Proxy *>
    Order deny,allow
    Deny from all
    #Allow from .your_domain.com
    </Proxy>

    # Enable/disable the handling of HTTP/1.1 "Via:" headers.
    # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
    # Set to one of: Off | On | Full | Block

    ProxyVia On

    # To enable the cache as well, edit and uncomment the following lines:
    # (no cacheing without CacheRoot)

    CacheRoot "/var/cache/apache2/proxy"
    CacheSize 5
    CacheGcInterval 4
    CacheMaxExpire 24
    CacheLastModifiedFactor 0.1
    CacheDefaultExpire 1
    # Again, you probably should change this.
    #NoCache a_domain.com another_domain.edu joes.garage_sale.com

    </IfModule>

    What should I change there?

    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    And I found this too:
    http://www.zope.org/Members/ajlouie/proxypassdebian

     
    Last edited: Jun 29, 2006

Share This Page