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
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 combinedFormerly, 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.
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>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.
- Install the following packages and their prerequisites:
- python2.5
Download the sources from MoinMoin.
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
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
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
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
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
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
Run:
apt-get install libapache2-mod-fastcgi
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 doneEdit /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/*
Edit $FARMCONFIG and comment out the entry for 'mywiki'.
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.
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
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/
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
Run the command:
service apache2 reload
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
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.
- Install the following packages and their prerequisites:
- python2.5
- libapache2-mod-wsgi
Download the sources from MoinMoin.
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
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
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
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
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
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.
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
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
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
Run the command:
service apache2 reload
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
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.
Run:
find $MOININSTANCESROOT/$MOININSTANCENAME -type d -iname '*home*' -exec rm -fr {} \;Edit $MOININSTANCESROOT/$MOININSTANCENAME/$MOININSTANCENAME.py and set:
page_front_page = u"MyStartingPage"
- Install the sand theme according to the following sub-procedure:
- Untar it in a temporary directory.
Run:
mv sand-theme/sand.py $MOINSWROOT/lib/python$PYTHONVER/site-packages/MoinMoin/theme/ mv sand-theme $MOINSWROOT/share/moin/htdocs/
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.)Add the following to $MOININSTANCESROOT/$MOININSTANCENAME/$MOININSTANCENAME.py:
force_theme = 1
Add the following to $MOININSTANCESROOT/$MOININSTANCENAME/$MOININSTANCENAME.py:
theme_default = 'sand'
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.)
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.)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">'
- Set up discussion pages according to the following sub-procedure:
Install http://moinmo.in/MacroMarket/PageComment2?action=AttachFile&do=view&target=PageComment2-0981.py as $MOININSTANCESROOT/$MOININSTANCENAME/data/plugin/macro/PageComment2.py
Edit $MOININSTANCESROOT/$MOININSTANCENAME/data/plugin/macro/PageComment2.py, locate the definition of the function commentformsection, change the border-width style property to 0px.
Edit all the Template pages and consider adding the following near the bottom:
- Set up various CMS-like features according to the following sub-procedure:
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.)
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)
- Set up Gallery2 according to the following sub-procedure:
- Install the following packages and their prerequisites:
- python-imaging
Install http://moinmoin.wikiwikiweb.de/ParserMarket/Gallery2?action=AttachFile&do=get&target=EXIF.py as $MOININSTANCESROOT/$MOININSTANCENAME/data/plugin/parser/EXIF.py
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
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
Disable surge protection by adding the following to $MOININSTANCESROOT/$MOININSTANCENAME/$MOININSTANCENAME.py:
surge_action_limits = { }- Install the following packages:
- unzip
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
- Install the following packages and their prerequisites:
- Set up Gallery according to the following sub-procedure:
Install http://moinmo.in/MacroMarket/Gallery?action=AttachFile&do=get&target=Gallery-087.py as $MOININSTANCESROOT/$MOININSTANCENAME/data/plugin/macro/Gallery.py
- Set up showCSV according to the following sub-procedure:
Install http://moinmo.in/MacroMarket/ShowCSV?action=AttachFile&do=get&target=ShowCSV.py as $MOININSTANCESROOT/$MOININSTANCENAME/data/plugin/macro/ShowCSV.py
Set up MyMoinMacros according to the following sub-procedure:
Download the python scripts from MyMoinMacros
- Install them in $MOININSTANCESROOT/$MOININSTANCENAME/data/plugin/macro.
In order to display the MyMoinMacros correctly, install the following packages and their prerequisites:
- w3m
Be sure to again correct permissions by running:
chown -R www-data $MOININSTANCESROOT/$MOININSTANCENAME/
(Without this you may get errors about non-existent modules.)- 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.
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.
Edit $MOININSTANCESROOT/$MOININSTANCENAME/$MOININSTANCENAME.py and set:
page_front_page = u"MyStartingPage"
- Install the sand theme according to the following sub-procedure:
- Untar it in a temporary directory.
Run:
mv simplemoin/simplemoin.py $MOINSWROOT/lib/python$PYTHONVER/site-packages/MoinMoin/theme/ mv simplemoin $MOINSWROOT/share/moin/htdocs/
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.)Add the following to $MOININSTANCESROOT/$MOININSTANCENAME/$MOININSTANCENAME.py:
force_theme = 1
Add the following to $MOININSTANCESROOT/$MOININSTANCENAME/$MOININSTANCENAME.py:
theme_default = 'simplemoin'
Be sure to again correct permissions by running:
chown -R www-data $MOININSTANCESROOT/$MOININSTANCENAME/
(Without this you may get errors about non-existent modules.)- 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
- Install the following packages and their prerequisites:
- subversion
- libapache2-svn
Define the following variables:
WEBSITENAME=www.yoursite.org # e.g. WEBSITENAME=dione.no-ip.org
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.
Run the commands:
a2enmod auth_digest service apache2 reload
- If you have a repository to recreate/reload then do that now in the directory specified by SVNPath.
You might want to create /var/www/$WEBSITENAME/robots.txt containing:
User-agent: * Disallow: /svn/
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
Visit the URL http://$WEBSITENAME/svn/.
ViewVC
- Install one of the following packages and their prerequisites:
- viewvc
- enscript
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!)Define the following variables:
WEBSITENAME=www.yoursite.org # e.g. WEBSITENAME=dione.no-ip.org
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.
Run the commands:
service apache2 reload
Visit the URL http://$WEBSITENAME/viewvc/svn/.
Once tested, then you should probably add a suitable 'Authtype' stanza at the bottom of the '<Location>' stanza.
Proxying Transmission Web access
- Install the following packages and their prerequisites:
- libapache2-mod-proxy-html
Run:
a2enmod proxy a2enmod proxy_http
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>Run:
service apache2 reload
Once tested, then you should probably add a suitable 'Authtype' stanza at the bottom of the '<Location>' stanza.
Proxying I2P
- Install the following packages and their prerequisites:
- libapache2-mod-proxy-html
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.)
Run:
service apache2 reload
Once tested, then you should probably add a suitable 'Authtype' stanza at the bottom of the '<Location>' stanza.
Proxying Mailman
- Install the following packages and their prerequisites:
- libapache2-mod-proxy-html
Run:
a2enmod proxy a2enmod proxy_http
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>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.)No authentication is needed for this, since mailman does its own authentication.
Proxying Ganglia
- Install the following packages and their prerequisites:
- libapache2-mod-proxy-html
Run:
a2enmod proxy a2enmod proxy_http
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>Run:
service apache2 reload
No authentication is needed for this, since no changes may be made.
Public access to local Debian, Redhat and source repositories
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>Run:
service apache2 reload
Miscellaneous
- If there are htdigest files for (possibly proxied) services (e.g. Transmission, Subversion, Ganglia) then set them up.
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>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
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.
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.
- Review old apache configuration files to see if anything was missed.
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).
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
