Advertisement
capsloth

Atom 2.3 Instalation

Oct 13th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.30 KB | None | 0 0
  1. # Mysql
  2. apt-get install mysql-server-5.5
  3.  
  4. # Java
  5. apt-get install openjdk-7-jre-headless
  6.  
  7. # Elasticsearch
  8. wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
  9. echo "deb https://packages.elastic.co/elasticsearch/1.7/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch.list
  10. apt-get update
  11. apt-get install elasticsearch
  12. update-rc.d elasticsearch defaults 95 10
  13. /etc/init.d/elasticsearch start
  14.  
  15. # Nginx
  16. apt-get install nginx
  17. touch /etc/nginx/sites-available/atom
  18. ln -sf /etc/nginx/sites-available/atom /etc/nginx/sites-enabled/atom
  19. rm /etc/nginx/sites-enabled/default
  20.  
  21. # /etc/nginx/sites-enabled/atom
  22. @@@
  23. upstream atom {
  24.   server unix:/var/run/php5-fpm.atom.sock;
  25. }
  26.  
  27. server {
  28.  
  29.   listen 80;
  30.   root /usr/share/nginx/atom;
  31.  
  32.   # http://wiki.nginx.org/HttpCoreModule#server_name
  33.   # _ means catch any, but it's better if you replace this with your server
  34.   # name, e.g. archives.foobar.com
  35.   server_name _;
  36.  
  37.   client_max_body_size 72M;
  38.  
  39.   # http://wiki.nginx.org/HttpCoreModule#try_files
  40.   location / {
  41.     try_files $uri /index.php?$args;
  42.   }
  43.  
  44.   location ~ /\. {
  45.     deny all;
  46.     return 404;
  47.   }
  48.  
  49.   location ~* (\.yml|\.ini|\.tmpl)$ {
  50.     deny all;
  51.     return 404;
  52.   }
  53.  
  54.   location ~* /(?:uploads|files)/.*\.php$ {
  55.     deny all;
  56.     return 404;
  57.   }
  58.  
  59.   location ~* /uploads/r/(.*)/conf/ {
  60.  
  61.   }
  62.  
  63.   location ~* ^/uploads/r/(.*)$ {
  64.     include /etc/nginx/fastcgi_params;
  65.     set $index /index.php;
  66.     fastcgi_param SCRIPT_FILENAME $document_root$index;
  67.     fastcgi_param SCRIPT_NAME $index;
  68.     fastcgi_pass atom;
  69.   }
  70.  
  71.   location ~ ^/private/(.*)$ {
  72.     internal;
  73.     alias /usr/share/nginx/atom/$1;
  74.   }
  75.  
  76.   location ~ ^/(index|qubit_dev)\.php(/|$) {
  77.     include /etc/nginx/fastcgi_params;
  78.     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  79.     fastcgi_split_path_info ^(.+\.php)(/.*)$;
  80.     fastcgi_pass atom;
  81.   }
  82.  
  83.   location ~* \.php$ {
  84.     deny all;
  85.     return 404;
  86.   }
  87.  
  88. }
  89. @@@
  90.  
  91. service nginx restart
  92.  
  93. # PHP
  94. apt-get install php5-cli php5-fpm php5-curl php5-mysql php5-xsl php5-json php5-ldap php-apc
  95. apt-get install php5-readline
  96.  
  97. # /etc/php5/fpm/pool.d/atom.conf
  98. @@@
  99. [atom]
  100.  
  101. # The user running the application
  102. user = www-data
  103. group = www-data
  104.  
  105. # Use UNIX sockets if Nginx and PHP-FPM are running in the same machine
  106. listen = /var/run/php5-fpm.atom.sock
  107. listen.owner = www-data
  108. listen.group = www-data
  109. listen.mode = 0600
  110.  
  111. # The following directives should be tweaked based in your hardware resources
  112. pm = dynamic
  113. pm.max_children = 30
  114. pm.start_servers = 10
  115. pm.min_spare_servers = 10
  116. pm.max_spare_servers = 10
  117. pm.max_requests = 200
  118.  
  119. chdir = /
  120.  
  121. # Some defaults for your PHP production environment
  122. # A full list here: http://www.php.net/manual/en/ini.list.php
  123. php_admin_value[expose_php] = off
  124. php_admin_value[allow_url_fopen] = on
  125. php_admin_value[memory_limit] = 512M
  126. php_admin_value[max_execution_time] = 120
  127. php_admin_value[post_max_size] = 72M
  128. php_admin_value[upload_max_filesize] = 64M
  129. php_admin_value[max_file_uploads] = 10
  130. php_admin_value[cgi.fix_pathinfo] = 0
  131. php_admin_value[display_errors] = off
  132. php_admin_value[display_startup_errors] = off
  133. php_admin_value[html_errors] = off
  134. php_admin_value[session.use_only_cookies] = 0
  135.  
  136. # APC, which is still used in PHP 5.5 for userland memory cache unless you
  137. # are switching to something like sfMemcacheCache
  138. php_admin_value[apc.enabled] = 1
  139. php_admin_value[apc.shm_size] = 64M
  140. php_admin_value[apc.num_files_hint] = 5000
  141. php_admin_value[apc.stat] = 0
  142.  
  143. # Zend OPcache
  144. # Only in Ubuntu 14.04 (PHP 5.5).
  145. # Don't use this in Ubuntu 12.04, it won't work.
  146. php_admin_value[opcache.enable] = 1
  147. php_admin_value[opcache.enable_cli] = 0
  148. php_admin_value[opcache.memory_consumption] = 192
  149. php_admin_value[opcache.interned_strings_buffer] = 16
  150. php_admin_value[opcache.max_accelerated_files] = 4000
  151. php_admin_value[opcache.validate_timestamps] = 0
  152. php_admin_value[opcache.fast_shutdown] = 1
  153.  
  154. # This is a good place to define some environment variables, e.g. use
  155. # ATOM_DEBUG_IP to define a list of IP addresses with full access to the
  156. # debug frontend or ATOM_READ_ONLY if you want AtoM to prevent
  157. # authenticated users
  158. env[ATOM_DEBUG_IP] = "127.0.0.1"
  159. env[ATOM_READ_ONLY] = "off"
  160. @@@
  161.  
  162. service php5-fpm restart
  163.  
  164. # Gearman
  165. apt-get install gearman-job-server
  166.  
  167. # Fop
  168. wget https://archive.apache.org/dist/xmlgraphics/fop/binaries/fop-2.1-bin.tar.gz
  169. tar xzvf fop-2.1-bin.tar.gz
  170. rm fop-2.1-bin.tar.gz
  171. mv fop-2.1 /usr/local/share
  172. ln -s /usr/local/share/fop-2.1/fop /usr/bin/fop
  173. echo 'FOP_HOME="/usr/local/share/fop-2.1"' | sudo tee -a /etc/environment
  174.  
  175. # Others
  176. apt-get install imagemagick ghostscript poppler-utils
  177.  
  178. # ffmpeg
  179. add-apt-repository ppa:archivematica/externals
  180. apt-get update
  181. apt-get install ffmpeg
  182.  
  183. # Download AtoM
  184. wget https://storage.accesstomemory.org/releases/atom-2.3.0.tar.gz
  185. mkdir /usr/share/nginx/atom
  186. tar xzf atom-2.3.0.tar.gz -C /usr/share/nginx/atom --strip 1
  187. rm atom-2.3.0.tar.gz
  188.  
  189. # Firesystem permissions
  190. chown -R www-data:www-data /usr/share/nginx/atom
  191.  
  192. # Create the database
  193. mysql -h localhost -p  -e "CREATE DATABASE atom CHARACTER SET utf8 COLLATE utf8_unicode_ci;"
  194. mysql -h localhost -p -e "GRANT INDEX, CREATE, SELECT, INSERT, UPDATE, DELETE, ALTER, LOCK TABLES ON atom.* TO 'atom'@'localhost' IDENTIFIED BY '123456';"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement