Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Mysql
- apt-get install mysql-server-5.5
- # Java
- apt-get install openjdk-7-jre-headless
- # Elasticsearch
- wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
- echo "deb https://packages.elastic.co/elasticsearch/1.7/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch.list
- apt-get update
- apt-get install elasticsearch
- update-rc.d elasticsearch defaults 95 10
- /etc/init.d/elasticsearch start
- # Nginx
- apt-get install nginx
- touch /etc/nginx/sites-available/atom
- ln -sf /etc/nginx/sites-available/atom /etc/nginx/sites-enabled/atom
- rm /etc/nginx/sites-enabled/default
- # /etc/nginx/sites-enabled/atom
- @@@
- upstream atom {
- server unix:/var/run/php5-fpm.atom.sock;
- }
- server {
- listen 80;
- root /usr/share/nginx/atom;
- # http://wiki.nginx.org/HttpCoreModule#server_name
- # _ means catch any, but it's better if you replace this with your server
- # name, e.g. archives.foobar.com
- server_name _;
- client_max_body_size 72M;
- # http://wiki.nginx.org/HttpCoreModule#try_files
- location / {
- try_files $uri /index.php?$args;
- }
- location ~ /\. {
- deny all;
- return 404;
- }
- location ~* (\.yml|\.ini|\.tmpl)$ {
- deny all;
- return 404;
- }
- location ~* /(?:uploads|files)/.*\.php$ {
- deny all;
- return 404;
- }
- location ~* /uploads/r/(.*)/conf/ {
- }
- location ~* ^/uploads/r/(.*)$ {
- include /etc/nginx/fastcgi_params;
- set $index /index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$index;
- fastcgi_param SCRIPT_NAME $index;
- fastcgi_pass atom;
- }
- location ~ ^/private/(.*)$ {
- internal;
- alias /usr/share/nginx/atom/$1;
- }
- location ~ ^/(index|qubit_dev)\.php(/|$) {
- include /etc/nginx/fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_split_path_info ^(.+\.php)(/.*)$;
- fastcgi_pass atom;
- }
- location ~* \.php$ {
- deny all;
- return 404;
- }
- }
- @@@
- service nginx restart
- # PHP
- apt-get install php5-cli php5-fpm php5-curl php5-mysql php5-xsl php5-json php5-ldap php-apc
- apt-get install php5-readline
- # /etc/php5/fpm/pool.d/atom.conf
- @@@
- [atom]
- # The user running the application
- user = www-data
- group = www-data
- # Use UNIX sockets if Nginx and PHP-FPM are running in the same machine
- listen = /var/run/php5-fpm.atom.sock
- listen.owner = www-data
- listen.group = www-data
- listen.mode = 0600
- # The following directives should be tweaked based in your hardware resources
- pm = dynamic
- pm.max_children = 30
- pm.start_servers = 10
- pm.min_spare_servers = 10
- pm.max_spare_servers = 10
- pm.max_requests = 200
- chdir = /
- # Some defaults for your PHP production environment
- # A full list here: http://www.php.net/manual/en/ini.list.php
- php_admin_value[expose_php] = off
- php_admin_value[allow_url_fopen] = on
- php_admin_value[memory_limit] = 512M
- php_admin_value[max_execution_time] = 120
- php_admin_value[post_max_size] = 72M
- php_admin_value[upload_max_filesize] = 64M
- php_admin_value[max_file_uploads] = 10
- php_admin_value[cgi.fix_pathinfo] = 0
- php_admin_value[display_errors] = off
- php_admin_value[display_startup_errors] = off
- php_admin_value[html_errors] = off
- php_admin_value[session.use_only_cookies] = 0
- # APC, which is still used in PHP 5.5 for userland memory cache unless you
- # are switching to something like sfMemcacheCache
- php_admin_value[apc.enabled] = 1
- php_admin_value[apc.shm_size] = 64M
- php_admin_value[apc.num_files_hint] = 5000
- php_admin_value[apc.stat] = 0
- # Zend OPcache
- # Only in Ubuntu 14.04 (PHP 5.5).
- # Don't use this in Ubuntu 12.04, it won't work.
- php_admin_value[opcache.enable] = 1
- php_admin_value[opcache.enable_cli] = 0
- php_admin_value[opcache.memory_consumption] = 192
- php_admin_value[opcache.interned_strings_buffer] = 16
- php_admin_value[opcache.max_accelerated_files] = 4000
- php_admin_value[opcache.validate_timestamps] = 0
- php_admin_value[opcache.fast_shutdown] = 1
- # This is a good place to define some environment variables, e.g. use
- # ATOM_DEBUG_IP to define a list of IP addresses with full access to the
- # debug frontend or ATOM_READ_ONLY if you want AtoM to prevent
- # authenticated users
- env[ATOM_DEBUG_IP] = "127.0.0.1"
- env[ATOM_READ_ONLY] = "off"
- @@@
- service php5-fpm restart
- # Gearman
- apt-get install gearman-job-server
- # Fop
- wget https://archive.apache.org/dist/xmlgraphics/fop/binaries/fop-2.1-bin.tar.gz
- tar xzvf fop-2.1-bin.tar.gz
- rm fop-2.1-bin.tar.gz
- mv fop-2.1 /usr/local/share
- ln -s /usr/local/share/fop-2.1/fop /usr/bin/fop
- echo 'FOP_HOME="/usr/local/share/fop-2.1"' | sudo tee -a /etc/environment
- # Others
- apt-get install imagemagick ghostscript poppler-utils
- # ffmpeg
- add-apt-repository ppa:archivematica/externals
- apt-get update
- apt-get install ffmpeg
- # Download AtoM
- wget https://storage.accesstomemory.org/releases/atom-2.3.0.tar.gz
- mkdir /usr/share/nginx/atom
- tar xzf atom-2.3.0.tar.gz -C /usr/share/nginx/atom --strip 1
- rm atom-2.3.0.tar.gz
- # Firesystem permissions
- chown -R www-data:www-data /usr/share/nginx/atom
- # Create the database
- mysql -h localhost -p -e "CREATE DATABASE atom CHARACTER SET utf8 COLLATE utf8_unicode_ci;"
- 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