Monthly Archives: July 2012

Gallery 3 installation / upgrade in Ubuntu

Installation

aptitude install apache2 mysql-server-5.1

su - www-data
cd /var/www/user
wget http://downloads.sourceforge.net/gallery/gallery-3.0.4.zip
unzip gallery-3.0.4.zip
mv gallery3 gallery
rm gallery-3.0.4.zip
cd gallery
mkdir var
chmod 777 var
exit

mysql -u root -p
SHOW DATABASES;
SELECT User FROM mysql.user;
CREATE DATABASE `user-gallery3`;
CREATE USER `user-gallery`;
SET PASSWORD FOR 'user-gallery' = PASSWORD('mysecretpassword');
GRANT ALL PRIVILEGES ON `user-gallery3`.* TO 'user-gallery'@'localhost' IDENTIFIED BY 'mysecretpassword';
FLUSH PRIVILEGES;
EXIT
rm -f ~/.mysql_history

/etc/apache2/sites-enabled/user-ssl

<VirtualHost *:443>
        ServerAdmin user@zviretnik.eu
        ServerName user.zviretnik.eu
        ServerAlias user-nick.zviretnik.eu
        DocumentRoot /var/www/user/wordpress/

        <Directory /var/www/user/gallery>
                Options -Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
                DirectoryIndex index.php
        </Directory>

        Alias /gallery /var/www/user/gallery

        ErrorLog /var/log/apache2/user.zviretnik.eu-ssl-error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/user.zviretnik.eu-ssl-access.log combined

        SSLEngine on
        SSLProtocol all -SSLv2
        SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM
        SSLCertificateFile /etc/ssl/user.zviretnik.cer
        SSLCertificateKeyFile /etc/ssl/private/user.zviretnik.key
        SSLCertificateChainFile /etc/ssl/startssl.sub.ca.pem
        SSLCACertificateFile /etc/ssl/startssl.root.cs.pem
        SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown

        CustomLog /var/log/apache2/user.zviretnik.eu-ssl-request.log \
         "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>

http://user.zviretnik.eu/gallery/installer/

rmdir /var/www/user/gallery/var/albums
ln -s /mnt/data/user/albums/ albums

Upgrade

/etc/init.d/apache2 stop

su - www-data
cd /var/www/user
wget http://downloads.sourceforge.net/gallery/gallery-3.0.4.zip
unzip gallery-3.0.4.zip
mv ./gallery/var ./gallery3/var
mv gallery gallery.old
mv gallery3 gallery
cd ./gallery
php index.php upgrade

Copy any custom or downloaded Themes or Modules from your old folder to the new one.

cd ..
rm gallery-3.0.4.zip
rm -rf gallery.old

/etc/init.d/apache2 start

Generate certificate StartSSL for virtual hosts in Apache

Generate certificate StartSSL for virtual hosts in Apache

openssl req -new -newkey rsa:2048 -nodes -out /etc/ssl/user.zviretnik.csr -keyout /etc/ssl/private/user.zviretnik.key -subj "/C=CZ/ST=cs/L=Praha/O=/CN=user.zviretnik.eu"
chmod 640 /etc/ssl/private/user.zviretnik.key

https://www.startssl.com/

copy StartSSL certificate to:
touch /etc/ssl/user.zviretnik.cer

Show content of CSR:
openssl req -in user.zviretnik.csr -noout -text

Repair splash screen of Ubuntu or Linux Mint

Quick Tip: Fix for Ugly Plymouth themes in Ubuntu / Mint
http://www.ubuntugeek.com/quick-tipplymouth-themes-in-ubuntu-10-04-lucid-lynx.html

Quick tip for those having trouble with their splash screens in Ubuntu / Mint.

To change the default splash screen:

sudo update-alternatives --config default.plymouth
sudo update-initramfs -u

To fix the delayed loading of the splash:

sudo -s
echo FRAMEBUFFER=y >>/etc/initramfs-tools/conf.d/splash
update-initramfs -u

Postfix satellite configuration

dpkg-reconfigure postfix

/etc/mailname

faix.homelinux.net

/etc/aliases

postmaster: root
webmaster: root
www-data: root
jan: jan.faix@gmail.com
wassana: fern.cht@gmail.com
root: jan.faix@gmail.com

newaliases

/etc/postfix/relay_passwd

mail.faix.cz mail:xxxxxxxx

chown root:root /etc/postfix/relay_passwd
postmap /etc/postfix/relay_passwd

/etc/postfix/main.cf

myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
myhostname = home-desktop
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = faix.homelinux.net, home-desktop, localhost.localdomain, localhost
relayhost = mail.faix.cz
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/relay_passwd
smtp_sasl_security_options =
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 800000000
message_size_limit = 100000000
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
mail_owner = postfix
mydomain = faix.homelinux.net
mynetworks = 127.0.0.0/8 192.168.122.0/24
compatibility_level = 2

/etc/init.d/postfix restart

SASL authentication:

apt-get install libsasl2-modules sasl2-bin

Set password for user “mail”:

add user "postfix" to group "sasl"
usermod -a -G sasl postfix

/etc/init.d/postfix restart
/etc/init.d/saslauthd restart