Go to file
Sergey Bogdanov 6a1a2f3096 Update README
Signed-off-by: Sergey Bogdanov <sergey.bogdanov@oktetlabs.ru>
2024-01-10 15:33:46 +03:00
css Import the first public release 2021-12-20 12:32:51 +00:00
js Import the first public release 2021-12-20 12:32:51 +00:00
.gitignore Update .gitignore 2024-01-10 15:33:04 +03:00
LICENSE Import the first public release 2021-12-20 12:32:51 +00:00
NOTICE Import the first public release 2021-12-20 12:32:51 +00:00
README.md Update README 2024-01-10 15:33:46 +03:00
apache_diary.conf Update apache default config file 2024-01-10 15:30:30 +03:00
cgi.rb Import the first public release 2021-12-20 12:32:51 +00:00
confirm.html Import the first public release 2021-12-20 12:32:51 +00:00
create.mysql Import the first public release 2021-12-20 12:32:51 +00:00
diary.css Import the first public release 2021-12-20 12:32:51 +00:00
diary.html Import the first public release 2021-12-20 12:32:51 +00:00
diary.js Import the first public release 2021-12-20 12:32:51 +00:00
diary.rb Changed SQL queries for mysql2 ruby driver 2022-02-02 14:21:36 +00:00
diary_datamapper.rb Changed SQL queries for mysql2 ruby driver 2022-02-02 14:21:36 +00:00
diary_env.example.rb Fix diary_env.example.rb 2024-01-10 09:54:07 +03:00
diary_next.png Import the first public release 2021-12-20 12:32:51 +00:00
diary_policy.rb Changed SQL queries for mysql2 ruby driver 2022-02-02 14:21:36 +00:00
diary_prev.png Import the first public release 2021-12-20 12:32:51 +00:00
error.html Import the first public release 2021-12-20 12:32:51 +00:00
favicon.css Fix favicon.css syntax 2022-02-02 15:21:12 +00:00
footer.html Import the first public release 2021-12-20 12:32:51 +00:00
header.html Import the first public release 2021-12-20 12:32:51 +00:00
ldap_cache.rb Hide some deprecated warnings to logs 2024-01-10 12:07:35 +03:00
ldap_record.rb Add LDAP v3 protocol support 2022-01-17 11:50:26 +00:00
mycgi.rb Import the first public release 2021-12-20 12:32:51 +00:00
project.html Import the first public release 2021-12-20 12:32:51 +00:00
project.rb Changed SQL queries for mysql2 ruby driver 2022-02-02 14:21:36 +00:00
sql_cache.rb Changed SQL queries for mysql2 ruby driver 2022-02-02 14:21:36 +00:00

README.md

OKTET Labs. Diary Management Application

Installation

Packages

# Apache
apt install -y apache2 apache2-dev libapache2-mod-passenger
# For kerberos + ldap auth
apt install -y krb5-user libapache2-mod-auth-gssapi
# ruby
apt install -y ruby ruby-ldap ruby-dev ruby-mysql2 default-libmysqlclient-dev libdbd-mysql-perl memcached
# For ubuntu install
apt install -y libmysqlclient-dev
# For debian install
apt install -y libmariadb-dev-compat libmariadb-dev

# Enable mods (ssl if need)
a2enmod auth_gssapi
a2enmod authnz_ldap
a2enmod passenger
a2enmod cgid
a2enmod ssl

Passenger check

/usr/bin/passenger-config validate-install
/usr/sbin/passenger-memory-stats

Diary directory

mkdir -p /var/www/cgi-bin/diary
# Clone this repository to /var/www/cgi-bin/diary
cd /var/www/cgi-bin/diary
gem install dbi

Amrita ruby package

Manually extract *.rb files from http://archive.debian.org/debian/pool/main/r/ruby-amrita/ruby-amrita_1.0.2-10_all.deb package to /usr/lib/ruby/vendor_ruby/amrita/*.rb

Copy config file from example

cd /var/www/cgi-bin/diary
cp diary_env.example.rb diary_env.rb
# edit config
vim diary_env.rb

Change owner

chown www-data:www-data -Rvc /var/www/cgi-bin/diary

Part of config apache

Edit apache config in apache_diary.conf

  • edit AuthLDAPURL option
  • edit ldap-filter options, if need. Default access to all ldap users
  • edit GssapiSSLonly option for HTTP or HTTPS

Add line to /etc/apache2/sites-enabled/*.conf file

include /var/www/cgi-bin/diary/apache_diary.conf

For kerberos auth

  • Copy *.keytab file to diary web server
  •   # test keytab
      klist -ke /etc/apache2/web.keytab
    
  •   # change rights
      chown www-data:www-data -v /etc/apache2/*.keytab
      chmod 0600 -v /etc/apache2/*.keytab
    

Install mysql server

apt install -y software-properties-common mariadb-server mariadb-client
systemctl stop mariadb

Fix sql cnf files

#	to mysql conf files:
#	to /etc/mysql/mariadb.conf.d/50-client.cnf
vim /etc/mysql/mariadb.conf.d/50-client.cnf
#	[client]
#	default-character-set=utf8

#	to /etc/mysql/mariadb.conf.d/50-server.cnf
vim /etc/mysql/mariadb.conf.d/50-server.cnf
#	[mysqld]
#	character-set-server=utf8
#	collation-server=utf8_general_ci
#	bind-address = 0.0.0.0

Start and check mariadb service

systemctl enable mariadb
systemctl start mariadb
systemctl status mariadb

Create database and user

mysql -u root
/* Create database and prepare tables */
create database diary;
use diary;
source /var/www/cgi-bin/diary/create.mysql;

/* Create diary-user */
CREATE USER 'diary'@'localhost' IDENTIFIED BY 'diary_pass';
GRANT ALL PRIVILEGES ON * . * TO 'diary'@'localhost';
FLUSH PRIVILEGES;
SHOW GRANTS FOR 'diary'@'localhost';

/* Delete default director login name */
SELECT * FROM director;
DELETE FROM director WHERE `nick`='director';

/* Create director login name */
INSERT INTO director SET `nick`='director-user';

Customization

  • Copy company logo logo-small.gif to /var/www/cgi-bin/diary/logo-small.gif