Introduction

This page describes site-specific configuration of various web services. The actual installation of apache, etc is covered by MDI.

Procedure

Apache2: configuration for all virtual hosts

Configuration for all virtual hosts has been moved into MDI.

Apache2: configuration for the default virtual host

  1. Set up logging by editing /etc/apache2/sites-available/default and making the following settings:

    ErrorLog ${APACHE_LOG_DIR}/default-error.log
    CustomLog ${APACHE_LOG_DIR}/default-access.log combined 
  2. Formerly, some steps were needed to deny access to the 'It works!' page, but this is no longer necessary.

Apache2: configuration for other virtual hosts

For each desired virtual host complete this procedure.

  1. Create a basic configuration file by editing /etc/apache2/sites-available/<web-site-name> to contain only:

    <VirtualHost *:80>
    
        DocumentRoot /var/www/<web-site-name>
        ServerName <web-site-name>
        ServerAdmin webmaster@localhost
        CustomLog /var/log/apache2/<web-site-name>-access.log combined
        ErrorLog /var/log/apache2/<web-site-name>-error.log
        LogLevel warn
        ServerSignature On
        <Directory /var/www/<web-site-name>>
            Order allow,deny
            Allow from all
        </Directory>
        
    </VirtualHost> 
  2. Run the commands:

    cp -ar /var/www/default /var/www/<web-site-name>
    a2ensite <web-site-name>
    service apache2 reload 

MoinMoin: compiling and installing

These instructions cover MoinMoin version 1.5.8.

  1. Install the following packages and their prerequisites:
    • python2.5
  2. Download the sources from MoinMoin.

  3. Define some variables:

    MOINVER=1.5.8                           #  installing which MoinMoin?
    PYTHONVER=2.5                           #  using which python?
    export PREFIX=/usr/local
    MOINSWROOT=$PREFIX/opt/moin-$MOINVER
    MOININSTANCESROOT=/var/local/moin       # or somewhere else?
    FARMCONFIG=$MOININSTANCESROOT/farmconfig.py 
  4. In a temporary directory run the commands:

    tar xzf <downloads-archive-path>/moin-$MOINVER.tar.gz
    cd moin-$MOINVER
    python$PYTHONVER setup.py --quiet install --prefix=$MOINSWROOT
    mkdir $(dirname $FARMCONFIG)
    cp $MOINSWROOT/share/moin/config/wikifarm/farmconfig.py $FARMCONFIG 
  5. Edit $MOINSWROOT/share/moin/server/moin.cgi and change the first line to read:

    #!/usr/bin/env pythonPYTHONVER
    

    and then run:

    perl -pi -e "s@PYTHONVER@$PYTHONVER@g" $MOINSWROOT/share/moin/server/moin.cgi 
  6. Edit $MOINSWROOT/share/moin/server/moin.cgi and comment out the following lines and add the ones that follow:

    ##sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')
    sys.path.insert(0, 'MOINSWROOT/lib/pythonPYTHONVER/site-packages')
    ##sys.path.insert(0, '/path/to/wikiconfig')
    sys.path.insert(0, 'MOININSTANCESROOT/MOININSTANCENAME')
    ##sys.path.insert(0, '/path/to/farmconfig')
    sys.path.insert(0, 'MOININSTANCESROOT') 
    

    and then run:

    perl -pi -e "s@^(sys.*)MOINSWROOT@\$1$MOINSWROOT@g; s@MOININSTANCESROOT@$MOININSTANCESROOT@; s@PYTHONVER@$PYTHONVER@;" $MOINSWROOT/share/moin/server/moin.cgi 
  7. Edit $MOINSWROOT/share/moin/server/moin.fcg and change the first line to read:

    #!/usr/bin/env pythonPYTHONVER
    

    and then run:

    perl -pi -e "s@PYTHONVER@$PYTHONVER@g" $MOINSWROOT/share/moin/server/moin.fcg 
  8. Edit $MOINSWROOT/share/moin/server/moin.fcg and comment out the following lines and add the ones that follow:

    ## sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')
    sys.path.insert(0, 'MOINSWROOT/lib/pythonPYTHONVER/site-packages')
    ##sys.path.insert(0, '/path/to/wikiconfig')
    sys.path.insert(0, 'MOININSTANCESROOT/MOININSTANCENAME')
    ## sys.path.insert(0, '/path/to/farmconfig')
    sys.path.insert(0, 'MOININSTANCESROOT')
    

    and then run:

    perl -pi -e "s@^(sys.*)MOINSWROOT@\$1$MOINSWROOT@g; s@MOININSTANCESROOT@$MOININSTANCESROOT@; s@PYTHONVER@$PYTHONVER@;" $MOINSWROOT/share/moin/server/moin.fcg 
  9. Run:

    apt-get install libapache2-mod-fastcgi 
  10. If you intend to use only your own templates then hide the system templates from users with the command:

    cd $MOINSWROOT/share/moin/underlay/pages
    echo *Template | xargs -n 1 echo | egrep -v 'HomepageTem|Category' | while read X; do 
        mv "$X" /var/tmp/"$X".unused-moin-template
    done 
  11. Edit /etc/apache2/conf.d/moin and add:

    #  For all [http://moinmo.in MoinMoin] instances to share
    Alias /wiki/ "MOINSWROOT/share/moin/htdocs/" 

    and then run:

    perl -pi -e "s@MOINSWROOT@$MOINSWROOT@g; s@MOININSTANCESROOT@$MOININSTANCESROOT@" /etc/apache2/conf.d/* 
  12. Edit $FARMCONFIG and comment out the entry for 'mywiki'.

  13. Run the following commands:

    mkdir -p $MOININSTANCESROOT/ 

MoinMoin: creating and configuring an instance

This section explains how to create a wiki instance. This is to be done for each wiki you want in each virtual host in which you want it.

These instructions cover MoinMoin version 1.5.8.

  1. Define the variables defined at the start of this section if not already defined, plus the following:

    WEBSITENAME=www.yoursite.org   #  e.g. WEBSITENAME=dione.no-ip.org
    MOININSTANCENAME=YourWiki      #  e.g. MOININSTANCENAME=AlexisWiki 
  2. Run the following commands:

    mkdir $MOININSTANCESROOT/$MOININSTANCENAME/
    cp -r $MOINSWROOT/share/moin/data $MOINSWROOT/share/moin/underlay $MOINSWROOT/share/moin/server/moin.cgi $MOINSWROOT/share/moin/server/moin.fcg $MOININSTANCESROOT/$MOININSTANCENAME/
    perl -pi -e "s@MOININSTANCENAME@$MOININSTANCENAME@g" $MOININSTANCESROOT/$MOININSTANCENAME/moin.cgi $MOININSTANCESROOT/$MOININSTANCENAME/moin.fcg
    cp $MOINSWROOT/share/moin/config/wikiconfig.py $MOININSTANCESROOT/$MOININSTANCENAME/$MOININSTANCENAME.py
    perl -pi -e "s@MOINSWROOT@$MOINSWROOT@g; s@MOININSTANCESROOT@$MOININSTANCESROOT@; s@MOININSTANCENAME@$MOININSTANCENAME@g" $MOININSTANCESROOT/$MOININSTANCENAME/$MOININSTANCENAME.py
    chown -R www-data $MOININSTANCESROOT/$MOININSTANCENAME/ 
  3. Edit /etc/apache2/sites-available/$WEBSITENAME and add:

    #  For MOININSTANCENAME Moin instance with normal CGI
    ScriptAlias /MOININSTANCENAME "MOININSTANCESROOT/MOININSTANCENAME/moin.cgi"
    #  For MOININSTANCENAME Moin instance with fast CGI
    #FastCgiServer MOININSTANCESROOT/MOININSTANCENAME/moin.fcg -idle-timeout 60 -processes 1
    #ScriptAlias /MOININSTANCENAME "MOININSTANCESROOT/MOININSTANCENAME/moin.fcg" 

    and then run:

    perl -pi -e "s@MOINSWROOT@$MOINSWROOT@g; s@MOININSTANCESROOT@$MOININSTANCESROOT@; s@MOININSTANCENAME@$MOININSTANCENAME@g" /etc/apache2/sites-available/$WEBSITENAME 
  4. Run the command:

    service apache2 reload 
  5. Edit $FARMCONFIG and add the following line in the following context:

    wikis = [
        ...
        ("MOININSTANCENAME",    r".*MOININSTANCENAME.*"),
        ...
    ] 

    and then run:

    perl -pi -e "s@MOINSWROOT@$MOINSWROOT@g; s@MOININSTANCESROOT@$MOININSTANCESROOT@; s@MOININSTANCENAME@$MOININSTANCENAME@g" $FARMCONFIG 
  6. Run the following command and verify sensible output:

    w3m -dump http://$WEBSITENAME/$MOININSTANCENAME/ 

MoinMoin: compiling and installing

These instructions cover MoinMoin version 1.9.3.

  1. Install the following packages and their prerequisites:
    • python2.5
    • libapache2-mod-wsgi
  2. Download the sources from MoinMoin.

  3. Define some variables:

    MOINVER=1.9.3                                #  installing which MoinMoin?
    PYTHONVER=2.5                                #  using which python?
    export PREFIX=/usr/local
    MOINSWROOT=$PREFIX/opt/moin-$MOINVER
    MOININSTANCESROOT=/var/local/moin/$MOINVER   #  or somewhere else?
    FARMCONFIG=$MOININSTANCESROOT/farmconfig.py 
  4. In a temporary directory run the commands:

    tar xzf <downloads-archive-path>/moin-$MOINVER.tar.gz
    cd moin-$MOINVER
    python setup.py --quiet install --prefix=$MOINSWROOT
    mkdir $(dirname $FARMCONFIG)
    cp $MOINSWROOT/share/moin/config/wikifarm/farmconfig.py $FARMCONFIG 
  5. Edit $MOINSWROOT/share/moin/server/moin.cgi and comment out the following lines and add the ones that follow:

    sys.path.insert(0, 'MOINSWROOT/lib/pythonPYTHONVER/site-packages')
    sys.path.insert(0, 'MOININSTANCESROOT')
    

    and then run:

    perl -pi -e "s@MOINSWROOT@$MOINSWROOT@g; s@PYTHONVER@$PYTHONVER@g; s@MOININSTANCESROOT@$MOININSTANCESROOT@g" $MOINSWROOT/share/moin/server/moin.wsgi 
  6. Edit $MOINSWROOT/share/moin/config/wikifarm/mywiki.py and make only the following settings:

        page_front_page = u"MyStartingPage"
        data_dir = 'MOININSTANCESROOT/MOININSTANCENAME/data/'
        data_underlay_dir = 'MOININSTANCESROOT/MOININSTANCENAME/underlay/'
        sitename = u'MOININSTANCENAME' # [Unicode]
        interwikiname = u'MOININSTANCENAME' # [Unicode] 

    and then run:

    perl -pi -e "s@MOININSTANCESROOT@$MOININSTANCESROOT@g" $MOINSWROOT/share/moin/config/wikifarm/mywiki.py 

  1. Edit /etc/apache2/conf.d/moin and add:

    Alias /moin_static193/ "MOINSWROOT/lib/python2.5/site-packages/MoinMoin/web/static/htdocs/" 

    and then run:

    perl -pi -e "s@MOINSWROOT@$MOINSWROOT@g" /etc/apache2/conf.d/moin 
  2. Edit $FARMCONFIG and comment out the entry for 'mywiki'.

MoinMoin: creating and configuring an instance

This section explains how to create a wiki instance. This is to be done for each wiki you want in each virtual host in which you want it.

These instructions cover MoinMoin version 1.9.3.

  1. Define the variables defined at the start of this section if not already defined, plus the following:

    WEBSITENAME=www.yoursite.org   #  e.g. WEBSITENAME=dione.no-ip.org
    MOININSTANCENAME=YourWiki      #  e.g. MOININSTANCENAME=AlexisWiki 
  2. Run the following commands:

    mkdir $MOININSTANCESROOT/$MOININSTANCENAME/
    cp -r $MOINSWROOT/share/moin/data $MOINSWROOT/share/moin/underlay $MOININSTANCESROOT/$MOININSTANCENAME/
    cp $MOINSWROOT/share/moin/config/wikifarm/mywiki.py $MOININSTANCESROOT/$MOININSTANCENAME.py
    perl -pi -e "s@MOININSTANCENAME@$MOININSTANCENAME@g;" $MOININSTANCESROOT/$MOININSTANCENAME.py
    chown -R www-data $MOININSTANCESROOT/$MOININSTANCENAME/ $MOININSTANCESROOT/$MOININSTANCENAME.py 
  3. Edit /etc/apache2/sites-available/$WEBSITENAME and add:

    WSGIScriptAlias /MOININSTANCENAME "MOINSWROOT/share/moin/server/moin.wsgi" 

    and then run:

    perl -pi -e "s@MOINSWROOT@$MOINSWROOT@g; s@MOININSTANCENAME@$MOININSTANCENAME@g" /etc/apache2/sites-available/$WEBSITENAME 
  4. Run the command:

    service apache2 reload 
  5. Edit $FARMCONFIG and add the following line in the following context:

    wikis = [
        ...
        ("MOININSTANCENAME",    r".*MOININSTANCENAME.*"),
        ...
    ] 

    and then run:

    perl -pi -e "s@MOININSTANCENAME@$MOININSTANCENAME@g" $FARMCONFIG 
  6. Run the following command and verify sensible output:

    w3m -dump http://$WEBSITENAME/$MOININSTANCENAME/ 

MoinMoin: further configuration of the AlexisWiki instance

These instructions cover MoinMoin version 1.5.8.

  1. Run:

    find $MOININSTANCESROOT/$MOININSTANCENAME -type d -iname '*home*' -exec rm -fr {} \; 
  2. Edit $MOININSTANCESROOT/$MOININSTANCENAME/$MOININSTANCENAME.py and set:

    page_front_page = u"MyStartingPage" 
  3. Install the sand theme according to the following sub-procedure:
    1. Untar it in a temporary directory.
    2. Run:

      mv sand-theme/sand.py $MOINSWROOT/lib/python$PYTHONVER/site-packages/MoinMoin/theme/
      mv sand-theme $MOINSWROOT/share/moin/htdocs/ 
    3. Run:

      cp $MOINSWROOT/lib/python$PYTHONVER/site-packages/MoinMoin/theme/sand.py /var/local/moin/$MOININSTANCENAME/data/plugin/theme 
      (This appears to be missing from the theme's documentation.)
    4. Add the following to $MOININSTANCESROOT/$MOININSTANCENAME/$MOININSTANCENAME.py:

      force_theme = 1 
    5. Add the following to $MOININSTANCESROOT/$MOININSTANCENAME/$MOININSTANCENAME.py:

      theme_default = 'sand' 
    6. Edit $MOINSWROOT/share/moin/htdocs/sand/css/print.css and add the following:

      ul#pagelocation {
              display: none;
      } 
      (This will prevent the rather pointless and incongruous display of the page title as a list bullet.)
  4. Disable the GUI editor by editing $MOINSWROOT/lib/python$PYTHONVER/site-packages/MoinMoin/theme/__init__.py, locating the function showBothEditLinks, inserting the following after the initial comments:

    return False 
    (The official way to disable the GUI editor didn't work for me.)
  5. Copy a 50x50 image to $MOINSWROOT/share/moin/htdocs/$MOININSTANCENAME.jpg and add the following line to $MOININSTANCESROOT/$MOININSTANCENAME/$MOININSTANCENAME.py:

    logo_string = u'<img src="/wiki/AlexisWiki.jpg" alt="AlexisWiki logo">' 
  6. Set up discussion pages according to the following sub-procedure:
    1. Install http://moinmo.in/MacroMarket/PageComment2?action=AttachFile&do=view&target=PageComment2-0981.py as $MOININSTANCESROOT/$MOININSTANCENAME/data/plugin/macro/PageComment2.py

    2. Edit $MOININSTANCESROOT/$MOININSTANCENAME/data/plugin/macro/PageComment2.py, locate the definition of the function commentformsection, change the border-width style property to 0px.

    3. Edit all the Template pages and consider adding the following near the bottom:

  7. Set up various CMS-like features according to the following sub-procedure:
    1. In $MOININSTANCESROOT/$MOININSTANCENAME/$MOININSTANCENAME.py make the following settings:

      acl_rights_default = u'All:read' 
      acl_rights_before  = u'AlexisHuxley,OtherWebMaster:read,write,admin,delete,revert'
      #acl_rights_after   = ... 

      (Don't deviate from this; ACL configuration MoinMoin is appalling; these settings were take from HelpOnAccessControlLists.)

    2. Edit $MOININSTANCESROOT/$MOININSTANCENAME/data/plugin/action/userform.py containing:

      from MoinMoin.Page import Page
      from MoinMoin import wikiaction
      
      def execute(pagename, request):
          if 'create' in request.form:
              return Page(request, pagename).send_page(request, msg="Creating user accounts disabled.")
          wikiaction.do_userform(pagename, request) 
  8. Set up Gallery2 according to the following sub-procedure:
    1. Install the following packages and their prerequisites:
      • python-imaging
    2. Install http://moinmoin.wikiwikiweb.de/ParserMarket/Gallery2?action=AttachFile&do=get&target=EXIF.py as $MOININSTANCESROOT/$MOININSTANCENAME/data/plugin/parser/EXIF.py

    3. Install http://moinmoin.wikiwikiweb.de/ParserMarket?action=AttachFile&do=get&target=Gallery2-1.5.4-16.py as $MOININSTANCESROOT/$MOININSTANCENAME/data/plugin/parser/Gallery2.py

    4. Install http://moinmoin.wikiwikiweb.de/ActionMarket?action=AttachFile&do=get&target=gallery2image-1.5.4-14.py as $MOININSTANCESROOT/$MOININSTANCENAME/data/plugin/action/gallery2image.py

    5. Disable surge protection by adding the following to $MOININSTANCESROOT/$MOININSTANCENAME/$MOININSTANCENAME.py:

      surge_action_limits = { } 
    6. Install the following packages:
      • unzip
    7. Download http://moinmo.in/ParserMarket/Gallery2?action=AttachFile&do=view&target=Gallery2_img.zip, unzip it into a temporary directory and run:

      mv img $MOINSWROOT/share/moin/htdocs/img 
  9. Set up Gallery according to the following sub-procedure:
    1. Install http://moinmo.in/MacroMarket/Gallery?action=AttachFile&do=get&target=Gallery-087.py as $MOININSTANCESROOT/$MOININSTANCENAME/data/plugin/macro/Gallery.py

  10. Set up showCSV according to the following sub-procedure:
    1. Install http://moinmo.in/MacroMarket/ShowCSV?action=AttachFile&do=get&target=ShowCSV.py as $MOININSTANCESROOT/$MOININSTANCENAME/data/plugin/macro/ShowCSV.py

  11. Set up MyMoinMacros according to the following sub-procedure:

    1. Download the python scripts from MyMoinMacros

    2. Install them in $MOININSTANCESROOT/$MOININSTANCENAME/data/plugin/macro.
    3. In order to display the MyMoinMacros correctly, install the following packages and their prerequisites:

      • w3m
  12. Be sure to again correct permissions by running:

    chown -R www-data $MOININSTANCESROOT/$MOININSTANCENAME/ 
    (Without this you may get errors about non-existent modules.)
  13. At this point I could move the 'pages' and 'user' directories out of the way and symlink to where the populated versions of these directories are.
  14. In order that various pages under Computing can refer to the location of source bundles, DEBs and RPMs with the hostnames abstracted, add the following to $MOININSTANCESROOT/$MOININSTANCENAME/data/intermap.txt:

    #  For local aliases
    SourceRepo http://dione.no-ip.org/sources/
    RedhatRepo http://dione.no-ip.org/redhat/
    DebianRepo http://dione.no-ip.org/debian/pool/ 

MoinMoin: further configuration of the SuzieWiki instance

These instructions cover MoinMoin version 1.5.8.

  1. Edit $MOININSTANCESROOT/$MOININSTANCENAME/$MOININSTANCENAME.py and set:

    page_front_page = u"MyStartingPage" 
  2. Install the sand theme according to the following sub-procedure:
    1. Untar it in a temporary directory.
    2. Run:

      mv simplemoin/simplemoin.py $MOINSWROOT/lib/python$PYTHONVER/site-packages/MoinMoin/theme/
      mv simplemoin $MOINSWROOT/share/moin/htdocs/ 
    3. Run:

      cp $MOINSWROOT/lib/python$PYTHONVER/site-packages/MoinMoin/theme/simplemoin.py /var/local/moin/$MOININSTANCENAME/data/plugin/theme 
      (This appears to be missing from the theme's documentation.)
    4. Add the following to $MOININSTANCESROOT/$MOININSTANCENAME/$MOININSTANCENAME.py:

      force_theme = 1 
    5. Add the following to $MOININSTANCESROOT/$MOININSTANCENAME/$MOININSTANCENAME.py:

      theme_default = 'simplemoin' 
  3. Be sure to again correct permissions by running:

    chown -R www-data $MOININSTANCESROOT/$MOININSTANCENAME/ 
    (Without this you may get errors about non-existent modules.)
  4. At this point I could move the 'pages' and 'user' directories out of the way and symlink to where the populated versions of these directories are.

Subversion

  1. Install the following packages and their prerequisites:
    • subversion
    • libapache2-svn
  2. Define the following variables:

    WEBSITENAME=www.yoursite.org   #  e.g. WEBSITENAME=dione.no-ip.org 
  3. Add the following to /etc/apache2/sites-available/$WEBSITENAME:

    <Location /svn>
        DAV svn
        SVNPath /staging/svnrepos/main
        Order allow,deny
        Allow from all
        AuthType Digest
            AuthName "Subversion Service"
            AuthUserFile /etc/apache2/subversion.htdigest
            <LimitExcept GET PROPFIND OPTIONS REPORT>
                Require valid-user
            </LimitExcept>
    </Location> 

    suitably adjusting SVNPath, AuthName and AuthUserFile.

  4. Run the commands:

    a2enmod auth_digest
    service apache2 reload 
  5. If you have a repository to recreate/reload then do that now in the directory specified by SVNPath.
  6. You might want to create /var/www/$WEBSITENAME/robots.txt containing:

    User-agent: *
    Disallow: /svn/ 
  7. You might want to create users using a command like the following example:

    touch /staging/svn-repos/conf/htdigest      #  only needed if doesn't exist yet
    htdigest /staging/svn-repos/conf/htdigest "dione.no-ip.org Subversion Repository" alexis 
  8. Visit the URL http://$WEBSITENAME/svn/.

ViewVC

  1. Install one of the following packages and their prerequisites:
    • viewvc
    • enscript
  2. Edit /etc/viewvc/viewvc.conf and make the following settings:

    root_parents = /staging/svnrepos/ : svn
    root_as_url_component = 0
    use_localtime = 1 
    (Adjust according to your local configuration!)
  3. Define the following variables:

    WEBSITENAME=www.yoursite.org   #  e.g. WEBSITENAME=dione.no-ip.org 
  4. Add the following to /etc/apache2/sites-available/$WEBSITENAME:

    ScriptAlias /viewvc /usr/lib/cgi-bin/viewvc.cgi
    <Location /viewvc>
        Order allow,deny
        Allow from all
    </Location> 

    suitably adjusting AuthName and AuthUserFile.

  5. Run the commands:

    service apache2 reload 
  6. Visit the URL http://$WEBSITENAME/viewvc/svn/.

  7. Once tested, then you should probably add a suitable 'Authtype' stanza at the bottom of the '<Location>' stanza.

Proxying Transmission Web access

  1. Install the following packages and their prerequisites:
    • libapache2-mod-proxy-html
  2. Run:

    a2enmod proxy
    a2enmod proxy_http 
  3. Add a stanza like this one to /etc/apache2/sites-enabled/<your-site-name>

    RedirectMatch ^/bt[/]?$ /transmission/web/
    <Location "/transmission">
        ProxyPass http://bt.pasta.net:9091/transmission
        ProxyPassReverse http://bt.pasta.net:9091/transmission
        Order allow,deny
        Allow from all
    </Location> 
  4. Run:

    service apache2 reload 
  5. Once tested, then you should probably add a suitable 'Authtype' stanza at the bottom of the '<Location>' stanza.

Proxying I2P

  1. Install the following packages and their prerequisites:
    • libapache2-mod-proxy-html
  2. Run:

    a2enmod proxy
    a2enmod proxy_http
    a2enmod proxy_html
    a2enmod headers
    a2enmod rewrite
     1. Add a stanza like this one to /etc/apache2/sites-enabled/<''your-site-name''> {{{
    RewriteEngine on
    RewriteRule ^/summaryframe.jsp /i2p/summaryframe.jsp [R]
    ProxyPass /i2p/ http://lasagne.pasta.net:7657/
    ProxyHTMLURLMap http://lasagne.pasta.net:7657/ /i2p/
    <Location /i2p/>
        ProxyPassReverse /
        SetOutputFilter proxy-html
        ProxyHTMLURLMap / /i2p/
        RequestHeader    unset  Accept-Encoding
        Order allow,deny
        Allow from all
    </Location> 

    This will forward requests for http://<your-site-name>/i2p/whatever to http://lasagne.pasta.net:7657/whatever. (The rewrite engine is needed because, for reasons I don't currently understand, mod_proxy_html fails to prepend '/i2p/' to '/summaryframe.jsp' in the HTML it massages.)

  3. Run:

    service apache2 reload 
  4. Once tested, then you should probably add a suitable 'Authtype' stanza at the bottom of the '<Location>' stanza.

Proxying Mailman

  1. Install the following packages and their prerequisites:
    • libapache2-mod-proxy-html
  2. Run:

    a2enmod proxy
    a2enmod proxy_http 
  3. Add a stanza like this one to /etc/apache2/sites-enabled/<your-site-name>

        <Location "/cgi-bin/mailman/">
            ProxyPass http://mail.pasta.net/cgi-bin/mailman/
            ProxyPassReverse http://mail.pasta.net/cgi-bin/mailman/
            Order allow,deny
            Allow from all
        </Location> 
  4. Run:

    service apache2 reload 
    (While it is possible to change the access URL from .../cgi-bin/mailman to something else, this path appears in the mails generated by mailman so to change it would effectively break some things.)
  5. No authentication is needed for this, since mailman does its own authentication.

Proxying Ganglia

  1. Install the following packages and their prerequisites:
    • libapache2-mod-proxy-html
  2. Run:

    a2enmod proxy
    a2enmod proxy_http 
  3. Add a stanza like this one to /etc/apache2/sites-enabled/<your-site-name>

    <Location "/ganglia">
        ProxyPass http://trending.pasta.net/ganglia
        ProxyPassReverse http://trending.pasta.net/ganglia
        Allow from All
        Order allow,deny
    </Location> 
  4. Run:

    service apache2 reload 
  5. No authentication is needed for this, since no changes may be made.

Public access to local Debian, Redhat and source repositories

  1. Add a stanza like these to /etc/apache2/sites-enabled/<your-site-name>

        #  Public access to Debian repository
        Alias /debian/ "/pub/mirrors/localpublic/"
        <Directory "/pub/mirrors/localpublic/">
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny                           
                Allow from All                         
        </Directory>
    
        #  Public access to source repository
        Alias /sources/ "/pub/computing/software/local/sources/localpublic/"
        <Directory "/pub/computing/software/local/sources/localpublic/">
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny                           
                Allow from All                         
        </Directory>
    
        #  Public access to redhat repository
        Alias /redhat/ "/pub/computing/software/local/redhat/localpublic/"
        <Directory "/pub/computing/software/local/redhat/localpublic/">
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny                           
                Allow from All                         
        </Directory> 
  2. Run:

    service apache2 reload 

Miscellaneous

  1. If there are htdigest files for (possibly proxied) services (e.g. Transmission, Subversion, Ganglia) then set them up.
  2. For Christmas webcam access, I added the following to the appropriate site's config file:

    #  Webcams
    <Location "/webcam0/">
        Order allow,deny
        ProxyPass http://fiori.pasta.net:9000/
        AuthType Basic
        Allow from all
    </Location>
    <Location "/webcam1/">
        Order allow,deny
        ProxyPass http://fiori.pasta.net:9001/
        AuthType Basic
        Allow from all
    </Location> 
  3. If pages have moved or been replaced then you might consider configuring automatic redirections. The author needs to add the following:

    #  This URL is quoted in my CV (in doc/pdf and on Monster)
    RedirectMatch permanent ^/computing/$ /AlexisWiki/Computing/
    
    #  Judith's pages have moved to a new virtual host
    RedirectMatch permanent /~judith/(.*)$ http://habgood.no-ip.org/$1
    
    #  Requests for these turn up in my logs sometimes
    RedirectMatch permanent ^/~alexis/ptyplumber /svn/attic/ptyplumber/trunk/bin/
    RedirectMatch permanent ^/~alexis/tmp/       /svn/smallstuff/trunk/doc/examples/shell/shell-lock-wrapper 
  4. To block deep-linking add a stanza like this one to /etc/apache2/sites-enabled/<your-site-name>

    RewriteEngine on
    RewriteCond %{THE_REQUEST}  \.(gif|jpg|jpeg|bmp|png) [NC]
    RewriteCond %{HTTP_REFERER} !^http://dione\.no-ip\.org(/)?.*$ [NC]
    RewriteCond %{HTTP_REFERER} !google [NC]
    RewriteCond %{HTTP_REFERER} !^-$ [NC]
    RewriteCond %{HTTP_REFERER} !^$ [NC]
    RewriteCond %{THE_REQUEST}  !/bandwidth-thief.jpg [NC]
    RewriteRule . /bandwidth-thief.jpg [R] 

    and save a suitable image to /var/www/<your-site-name>/bandwidth-thief.jpg.

  5. Many of the above steps affect /etc/apache2/sites-enabled/<your-site-name>; consider if the same changes need to be added to other files under the same directory.

  6. Review old apache configuration files to see if anything was missed.
  7. Review old crontab entries for all users; there may be some that need to be copied across (e.g. I have jobs which generate web view reports and which generate the SortedWebProxyList web page).

  8. If Apache logs are stored somewhere else (for archiving purposes) then you may need do something like:

    service apache2 stop
    mv /var/log/apache2 /var/log/apache2.off
    ln -s /staging/logs/apache2 /var/log/apache2
    service apache2 start 

See also


CategoryProcedure

ConfiguringWebServices (last edited 2012-03-14 15:05:45 by AlexisHuxley)