Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wget -qO - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
- echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" > /etc/apt/sources.list.d/postgres.list
- echo "deb-src http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" >> /etc/apt/sources.list.d/postgres.list
- wget -qO - http://nginx.org/keys/nginx_signing.key | apt-key add -
- echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" > /etc/apt/sources.list.d/nginx.list
- echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" >> /etc/apt/sources.list.d/nginx.list
- apt-get update
- apt-get upgrade -y
- apt-get install -y git nginx php5-fpm postgresql memcached php5-curl php5-gd php5-pgsql php5-memcache supervisor
- #Extracting noid source
- git clone --depth=1 https://github.com/notabenoid/notabenoid.git /srv/DOMAIN
- cd /srv/DOMAIN
- mkdir -p www/assets www/i/book www/i/upic www/i/tmp/upiccut protected/runtime
- chown -R nginx.nginx .
- nano protected/config/db.php
- nano protected/config/mail.php
- nano protected/config/console.php
- #Postgres preparations
- sudo -u postgres createuser -E -P notabenoid
- sudo -u postgres createdb -O notabenoid notabenoid
- nano /etc/postgresql/9.4/main/pg_hba.conf
- # # TYPE DATABASE USER ADDRESS METHOD
- # local all postgres peer
- # local all notabenoid md5
- # local all all peer
- # host all all 127.0.0.1/32 md5
- # host all all ::1/128 md5
- service postgresql restart
- psql -U notabenoid < init.sql
- #Adding cron jobs
- echo "0 0 * * * /usr/bin/php /srv/DOMAIN/protected/yiic maintain midnight" >> /etc/crontab
- echo "0 4 * * * /usr/bin/php /srv/DOMAIN/protected/yiic maintain dailyfixes" >> /etc/crontab
- #Configuring PHP
- nano /etc/php5/fpm/php.ini
- # error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE
- nano /etc/php5/fpm/pool.d/www.conf
- # user = nginx
- # group = nginx
- # listen.owner = nginx
- # listen.group = nginx
- # listen.mode = 0660
- service php5-fpm restart
- #Supervisor configs
- # [program:cron]
- # command=/usr/sbin/cron -f
- # autorestart=true
- #[program:memcached]
- #user=memcache
- #command=/usr/bin/memcached
- #autorestart=true
- #Configuring nginx
- rm /etc/nginx/conf.d/default.conf
- nano /etc/nginx/conf.d/noid.conf
- # server {
- # server_name DOMAIN;
- # listen 80;
- # root /srv/DOMAIN/www;
- # index index.php;
- # location / {
- # try_files $uri $uri/ /index.php?$args;
- # }
- # location ~ \.php$ {
- # fastcgi_split_path_info ^(.+\.php)(/.+)$;
- # fastcgi_pass unix:/var/run/php5-fpm.sock;
- # fastcgi_index index.php;
- # include fastcgi_params;
- # }
- # location ~ ^/(assets|img|js|css) {
- # try_files $uri =404;
- # }
- # }
- service nginx restart
Advertisement
Add Comment
Please, Sign In to add comment