From Bottleneck.org
< Website
Contents |
Notes
- All software is installed as user _sys
- Tarballs are held in ~_sys/tarballs
- Compiles are performed in ~_sys/compiles
- All software is installed under /opt/local/software-<version> and a symlink /opt/local/software is created to point to the current version.
Set up OS
System Software
- Perform an aptitude update to retrieve mirror lists
- Remove the following system software using aptitude remove
- mysql-server
- mysql-client
- php5 (and all associated libraries)
- apache2 (and all associated files)
- Add the following software with aptitude install
- openssh-server
Users and Groups
- Create groups
apache:x:89: local:x:90: users:x:100:
- Create users with useradd:
useradd -c "Description" -g [90|100] -m <userid>
- Users to create are:
srp:x:1000:100:Steven Patterson:/home/srp:/bin/bash _mysql:x:1001:90:mySQL database owner:/home/_mysql:/bin/bash _www:x:1002:90:Web sites content owner:/home/_www:/bin/bash _sys:x:1003:90:Software installation account:/home/_sys:/bin/bash
- Add the following user by hand to the passwd file and pwconv
apache:x:89:89:Web server user::
Filesystem Conventions
- Create a suitable /opt/local
mkdir /opt/local && chown :local /opt/local && chmod u=rwx,g=rwxs,o=rx /opt/local
- Create web content directory for <sitename> as user _www
mkdir ~/<sitename> mkdir ~/<sitename>/content mkdir ~/<sitename>/log mkdir ~/<sitename>/log/archives
Software Installation
OS Pre-Requisites
- Install the following packages using aptitude install:
- gcc
- g++
- ncurses
- libncurses5-dev
- make
- libxml2-dev
- imagemagick
- Perform an aptitude upgrade
mySQL
Build and Install
- Log in as _sys
- Configure mySQL with ./configure --prefix=/opt/local/mysql-5.0.51
- make && make install
- Create symlink
cd /opt/local/ ln -s mysql-5.0.51 mysql
Configuration
- Generate default databases
- The following is performed as user _mysql
cd mysql bin/mysql_install_db --basedir=/opt/local/mysql --datadir=/home/_mysql/dbs
- Secure the mySQL database directories
chmod go-rwx ~_mysql ~_mysql/dbs
- Set up mySQL accounts
/opt/local/mysql/bin/mysql -u root -p
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('<newpass>');
mysql> SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('<newpass>');
mysql> SET PASSWORD FOR 'root'@'<hostname>' = PASSWORD('<newpass>');
mysql> DROP USER ;
mysql> DROP USER @'localhost';
- Note, you can check which accounts exist as follows:
mysql> SELECT user,host FROM mysql.user;
- Drop the test databases
mysql> DROP DATABASE test;
Startup and Shutdown
- Create startup and shutdown scripts
- Startup takes this form:
/opt/local/mysql/bin/mysqld_safe --basedir=/opt/local/mysql --datadir=/home/_mysql/dbs --user=_mysql --bind-address=127.0.0.1 &
- Shutdown takes this form:
/opt/local/mysql/bin/mysqladmin -u root -p<mysqlrootpw> shutdown
Apache
Build and Install
- Configure:
./configure --prefix=/opt/local/apache-2.2.8
- Build and install
make && make install
- Create symlink
cd /opt/local ln -s apache-2.2.8 apache
Configuration
- Configure the following basics in /opt/local/apache/conf/httpd.conf
Listen 80 User apache Group apache ServerAdmin webmaster@botteleneck.org ServerName <sitename>:80 # Real-time info on requests and configuration Include conf/extra/httpd-info.conf Include /home/_www/<sitename>/httpd.conf
- Configure /opt/local/apache/conf/extra/httpd-info.conf:
<Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from 88.96.26.224/255.255.255.248 </Location> ExtendedStatus On <Location /server-info> SetHandler server-info Order deny,allow Deny from all Allow from 88.96.26.224/255.255.255.248 </Location>
- Configure /home/_www/<sitename>/httpd.conf with the following basics:
<VirtualHost <sitename>:80>
Options Indexes
DocumentRoot "/home/_www/<sitename>/content"
ServerAlias <sitename>
ErrorLog "/home/_www/<sitename>/log/error_log"
CustomLog "/home/_www/<sitename>/log/access_log" common
</VirtualHost>
<Directory "/home/_www/<sitename>/content">
Order allow,deny
Allow from all
</Directory>
PHP
Build and Install
- Configure as follows:
./configure --prefix=/opt/local/php-5.2.5 --with-apxs2=/opt/local/apache/bin/apxs --with-mysql=/opt/local/mysql
- Build and install
make && make install
- Create symlink:
cd /opt/local ln -s php-5.2.5 php
Configuration
- Configure /opt/local/php/lib/php.ini
cp ~/compiles/php-5.2.5/php.ini-recommended /opt/local/php/lib/php.ini
- Alter php.ini to set the following
output_buffering = Off safe_mode_gid = On max_execution_time = 300 ; Maximum execution time of each script, in seconds upload_max_filesize = 6M
- Alter /opt/local/apache/conf/httpd.conf to add the following if not already there:
LoadModule php5_module modules/libphp5.so
- Alter /opt/local/apache/conf/httpd.conf to add the following to <IfModule dir_module>:
DirectoryIndex index.php index.html
- Alter /opt/local/apache/conf/httpd.conf to add the following to <IfModule mime_module>:
AddHandler php5-script php AddType text/html php
MediaWiki
Build and Install
- Copy MediaWiki install to appropriate content directory as _www
(cd ~_sys/compiles && tar -cf - mediawiki-1.11.0)|(cd ~/<sitename>/content && tar -xvf -) mv ~/<sitename>/content/mediawiki-1.11.0 ~/<sitename>/content/<mediawiki_content_dirname>
- Set up for initial configuration:
chmod a+w ~/<sitename>/content/<mediawiki_content_dirname>/config
Configuration
- Visit http://<sitename>/<mediawiki_content_dirname>/ and follow the configuration script, accepting defaults unless indicated below:
| Parameter | Value |
|---|---|
| Wiki Name | bottleneck.org |
| Contact Email | webmaster@bottleneck.org |
| Admin Username | srpnor |
| Password | <password> |
| Database Name | bn_mediawiki |
| DB Username | bn_mediawiki |
| DB Password | <password> |
| Superuser Account | <tick> |
| Superuser Name | root |
| Superuser Password | <password> |
- Secure configuration
cd ~/<sitename>/content/<mediawiki_content_dirname> cp config/LocalSettings.php . chmod go-rwx config
CopperMine
Build and Install
- Copy CopperMine install to appropriate content directory as _www
(cd ~_sys/compiles && tar -cf - cpg1416/)|(cd ~/<sitename>/content && tar -xvf -) mv ~/<sitename>/content/cpg1416 ~/<sitename>/content/<coppermine_content_dirname>
- Set up permissions for file uploads and configuration:
su - cd ~_www/<sitename>/content/<coppermine_content_dirname> chown :apache albums/ albums/edit/ albums/userpics/ include/ logs/ plugins/ chmod ug=rwx,o=rx albums/ albums/edit/ albums/userpics/ include/ logs/ plugins/
- Create a suitable mySQL database
/opt/local/mysql/bin/mysql -u root -p mysql> CREATE DATABASE bn_coppermine; mysql> CREATE USER bn_copperming IDENTIFIED BY '<password>'; mysql> GRANT ALL ON bn_coppermine.* TO bn_coppermine;
Configuration
- Visit http://<sitename>/<coppermine_content_dirname>/ and follow the configuration script, accepting defaults unless indicated below:
| Parameter | Value |
|---|---|
| User Name | srpnor |
| Password | <password> |
| Email Address | webmaster@bottleneck.org |
| mySQL Database Name | bn_coppermine |
| mySQL Username | bn_coppermine |
| mySQL Password | <password> |
| ImageMagick Path | /usr/bin |
- Secure configuration
su - cd ~_www/<sitename>/content/<coppermine_content_dirname> chmod g-w include
Look and Feel
Configure MediaWiki Metadata
- Edit MediaWiki:Userlogin to read "Login"
- Edit MediaWiki:Logout to read "Logout"
- Edit MediaWiki:Toolbox to read "Site Tools"
- Edit MediaWiki:Personaltools to read "User Tools"
- Edit MediaWiki:Mainpage to read "Home"
- Edit MediaWiki:Categories to read "Tags"
- Edit MediaWiki:categoriespagetext to read "The following tags exist"
- Edit MediaWiki:category-empty to read "There are no articles or media tagged with this word."
- Edit MediaWiki:category-media-count to read "There are $1 files with this tag."
- Edit MediaWiki:category-media-header to read "Media tagged with "$1""
- Edit MediaWiki:category_header to read "Articles tagged with "$1""
- Edit MediaWiki:categoryarticlecount to read "There are $1 articles tagged with this word."
- Edit MediaWiki:categorypage to read "View list of tagged articles"
- Edit MediaWiki:mostlinkedcategories to read "Most linked to tags"
- Edit MediaWiki:ncategories to read "$1 tags"
- Edit MediaWiki:pagecategories to read "Tagged with"
- Edit MediaWiki:subcategories to read "Related Tags"
- Edit MediaWiki:subcategorycount to read "There are $1 tags related to this tag."
- Edit MediaWiki:uncategorizedcategories to read "Stand-alone tags"
- Edit MediaWiki:unusedcategories to read "Unused tags"
- Edit MediaWiki:unusedcategoriestext to read "The following tag pages exist although no other article or tag make use of them."
- Edit MediaWiki:wantedcategories to read "Wanted tag pages"
Apply Stylesheets
Note: Details of the skin and theme customisations are not included here, please see the extracted files for further information.
- Extract the site integration graphics and tools and the _www user:
cd ~/<sitename>/content tar -xvf ~srp/website/current/integration.tar
- Change LocalSettings.php as follows:
$wgDefaultSkin = 'bottleneck';
- Extract the MediaWiki skin as the _www user:
cd <mediawiki_content_dir> tar -xvf ~srp/website/current/mediawiki-skin.tar
- Extract the Coppermine theme as the _www user:
cd ../<coppermine_content_dir> tar -xvf ~srp/website/current/coppermine-theme.tar
- Set default Coppermine theme in Coppermine config under "Themes Settings > Theme" to "bottleneck"
Configure Coppermine Presentation
- Set the following configuration parameters:
| Parameter | Value |
|---|---|
| General Settings | |
| Gallery Name | Gallery |
| Gallery Description | (nothing) |
| URL of your coppermine gallery folder | http://<sitename>/<coppermine_content_dir> |
| URL of your home page | /<coppermine_content_dir>/ |
| Enable help icons | Yes - Everyone |
| Theme Settings | |
| Custom menu link name | Image Copyright |
| Custom menu link URL | /<mediawiki_content_dir>/Photography/Copyright |
| Album List View | |
| Number of albums to display | 20 |
| Size of thumbnails in pixels | 100 |
| The content of the main page | breadcrumb/catlist/alblist/lastup,3 |
| Show first level album thumbnails in categories | No |
| Show number of linked files | Yes |
| Thumbnail View | |
| Number of rows on thumbnail page | 10 |
| Image View | |
| Width of table for file display | 650 |
| Show film strip | No |
| Files and Thumbnails | |
| Quality for JPEGs | 75 |
| Max width or height of an intermediate picture/video | 600 |
| Max size for uploaded files | 4096 |
| Max width or height for uploaded pictures/videos | 4096 |
- Edit Groups to set the following permissions:
- For all groups, quota = 0
- For all groups, no ratings, ecards or comments permissions
- Allow public album uploads for administrators and registered users, without approval. Deny and require approval for guests.
- Deny personal galleries for all. Set approval on for guests, and off for all others.
Configure URL Aliases
- Edit /home/_www/<sitename>/httpd.conf to add the following to the <VirtualHost> container:
Alias /site /home/_www/<sitename>/content/<mediawiki_content_dir>/index.php Alias /gallery /home/_www/<sitename>/content/<coppermine_content_dir>/
- Edit MediaWiki's LocalSettings.php to set the following:
$wgArticlePath = "/site/$1"; $wgUsePathInfo = true;
- This allows site pages to be referenced as http://<sitename>/site/<pagename>
Functional Configuration
Web Server
- Configure your robots.txt in the diretory /home/_www/<sitename>/content as follows:
User-agent: * Disallow: /<MediaWiki_Content_dir>/ Disallow: /site/Special:Search Disallow: /site/Special:Random
MediaWiki
- Set the following settings in LocalSettings.php:
$wgEnableUploads = true;
$wgStrictFileExtensions = false;
$wgCheckFileExtensions = false;
# Warn about files > 100M
$wgUploadSizeWarning = 107374182;
$wgNamespacesWithSubpages = array(
NS_MAIN => true,
NS_TALK => true,
NS_USER => true,
NS_USER_TALK => true,
NS_PROJECT => true,
NS_PROJECT_TALK => true,
NS_IMAGE_TALK => false,
NS_MEDIAWIKI_TALK => false,
NS_TEMPLATE => true,
NS_TEMPLATE_TALK => true,
NS_HELP => true,
NS_HELP_TALK => true,
NS_CATEGORY_TALK => false
);
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['createpage'] = false;
$wgGroupPermissions['*']['cratetalk'] = false;
$wgRawHtml = true;
$wgNamespacesToBeSearchedDefault= array(
NS_MAIN => true,
NS_TALK => false,
NS_USER => true,
NS_USER_TALK => false,
NS_PROJECT => false,
NS_PROJECT_TALK => false,
NS_IMAGE => false,
NS_IMAGE_TALK => false,
NS_MEDIAWIKI => false,
NS_MEDIAWIKI_TALK => false,
NS_TEMPLATE => false,
NS_TEMPLATE_TALK => false,
NS_HELP => false,
NS_HELP_TALK => false,
NS_CATEGORY => true,
NS_CATEGORY_TALK => false
);
- Set the following permissions on the directory <MediaWiki_Content_dir>/images:
chown :apache . ./deleted chmod ug=rwx,o=rx . ./deleted
CopperMine
- Set the following settings in CopperMine configuration:
| Parameter | Value |
|---|---|
| Image View | |
| No | |
| Files and Thumbnails Advanced Settings | |
| Default mode for directories | 0775 |
| Default mode for files | 0664 |
Integration
- Untar search.php from the integration tarball.
Content
MediaWiki
- Create InterWiki links to allow transparent redirection to Gallery pages:
INSERT INTO interwiki SET iw_prefix='gal_album', iw_url='http://<sitename>/gallery/thumbnails.php?album=$1', iw_local=1, iw_trans=0; INSERT INTO interwiki SET iw_prefix='gal_main', iw_url='http://<sitename>/gallery/$1', iw_local=1, iw_trans=0;
Coppermine Categories
- Configure the following categories in Coppermine:
- General Portfolio
- Cars and Motorsport
- Events
- Holidays
- Albums should be created in these categories on a per-event basis, or in the case of a the general portfolio, by subject matter (Landscapes, Portraits, etc)
- When batch uploading images, upload to a folder albums/<category>/<album>/<yyyymmddN>/ where N is an increasing digit for uniqueness within a given day. This will allow albums to be added to without confusion during the batch upload processing.
Bugs
MediaWiki
wgBreakFrames undefined
The fix for this is to edit skins/common/wikibits.js and comment out the following:
/* if (wgBreakFrames) {
// Un-trap us from framesets
if (window.top != window) {
window.top.location = window.location;
}
} */
wgContentLanguage undefined
Edit skins/common/wikibits.js and change the following line:
var ts_europeandate = wgContentLanguage != "en"; // The non-American-inclined can change to "true"
becomes:
var ts_europeandate = true;