imcrazytwkr

Notabenoid deploying on Ubuntu 14.04

Jul 17th, 2015
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.92 KB | None | 0 0
  1. wget -qO - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
  2. echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" > /etc/apt/sources.list.d/postgres.list
  3. echo "deb-src http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" >> /etc/apt/sources.list.d/postgres.list
  4. wget -qO - http://nginx.org/keys/nginx_signing.key | apt-key add -
  5. echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" > /etc/apt/sources.list.d/nginx.list
  6. echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" >> /etc/apt/sources.list.d/nginx.list
  7. apt-get update
  8. apt-get upgrade -y
  9. apt-get install -y git nginx php5-fpm postgresql memcached php5-curl php5-gd php5-pgsql php5-memcache supervisor
  10.  
  11. #Extracting noid source
  12. git clone --depth=1 https://github.com/notabenoid/notabenoid.git /srv/DOMAIN
  13. cd /srv/DOMAIN
  14. mkdir -p www/assets www/i/book www/i/upic www/i/tmp/upiccut protected/runtime
  15. chown -R nginx.nginx .
  16. nano protected/config/db.php
  17. nano protected/config/mail.php
  18. nano protected/config/console.php
  19.  
  20. #Postgres preparations
  21. sudo -u postgres createuser -E -P notabenoid
  22. sudo -u postgres createdb -O notabenoid notabenoid
  23. nano /etc/postgresql/9.4/main/pg_hba.conf
  24. # # TYPE  DATABASE        USER            ADDRESS                 METHOD
  25. # local   all             postgres                                peer
  26. # local   all             notabenoid                              md5
  27. # local   all             all                                     peer
  28. # host    all             all             127.0.0.1/32            md5
  29. # host    all             all             ::1/128                 md5
  30. service postgresql restart
  31. psql -U notabenoid < init.sql
  32.  
  33. #Adding cron jobs
  34. echo "0 0 * * * /usr/bin/php /srv/DOMAIN/protected/yiic maintain midnight" >> /etc/crontab
  35. echo "0 4 * * * /usr/bin/php /srv/DOMAIN/protected/yiic maintain dailyfixes" >> /etc/crontab
  36.  
  37. #Configuring PHP
  38. nano /etc/php5/fpm/php.ini
  39. # error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE
  40. nano /etc/php5/fpm/pool.d/www.conf
  41. # user = nginx
  42. # group = nginx
  43. # listen.owner = nginx
  44. # listen.group = nginx
  45. # listen.mode = 0660
  46. service php5-fpm restart
  47.  
  48. #Supervisor configs
  49. # [program:cron]
  50. # command=/usr/sbin/cron -f
  51. # autorestart=true
  52.  
  53. #[program:memcached]
  54. #user=memcache
  55. #command=/usr/bin/memcached
  56. #autorestart=true
  57.  
  58. #Configuring nginx
  59. rm /etc/nginx/conf.d/default.conf
  60. nano /etc/nginx/conf.d/noid.conf
  61.  
  62. # server {
  63. #     server_name DOMAIN;
  64. #     listen 80;
  65. #     root /srv/DOMAIN/www;
  66. #     index index.php;
  67. #     location / {
  68. #         try_files $uri $uri/ /index.php?$args;
  69. #     }
  70. #     location ~ \.php$ {
  71. #         fastcgi_split_path_info ^(.+\.php)(/.+)$;
  72. #         fastcgi_pass unix:/var/run/php5-fpm.sock;
  73. #         fastcgi_index index.php;
  74. #         include fastcgi_params;
  75. #     }
  76. #     location ~ ^/(assets|img|js|css) {
  77. #         try_files $uri =404;
  78. #     }
  79. # }
  80.  
  81. service nginx restart
Advertisement
Add Comment
Please, Sign In to add comment