Advertisement
Guest User

gnusocial + nginx +mariadb

a guest
Sep 1st, 2015
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.41 KB | None | 0 0
  1. #########################
  2. ####Network####
  3. #########################
  4.  
  5. sudo nano /etc/network/interfaces
  6.  
  7. ----------
  8. iface eth0 inet static
  9. address 192.168.1.15X
  10. netmask 255.255.255.0
  11. gateway 192.168.1.1
  12. dns-nameservers 104.237.144.172 74.207.232.103 104.245.39.112
  13. ----------
  14.  
  15. #########################
  16. ####Software####
  17. #########################
  18.  
  19. sudo apt-add-repository ppa:nginx/development
  20.  
  21. sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
  22. sudo add-apt-repository 'deb http://mirror.jmu.edu/pub/mariadb/repo/10.0/ubuntu trusty main'
  23.  
  24. sudo apt-get install git mariadb-client mariadb-server libmariadbclient18 nginx-full php5 php5-cli php5-common php5-curl php5-enchant php5-fpm php5-gd php5-gmp php5-imagick php5-intl php5-json php5-mcrypt php5-mysqlnd php5-recode php5-apcu
  25.  
  26. #########################
  27. ####PHP Configuration####
  28. #########################
  29.  
  30. sudo nano '/etc/php5/cli/php.ini'
  31.  
  32. ----------
  33. upload_max_filesize = 64M
  34. ----------
  35.  
  36. #########################
  37. ####FPM Configuration####
  38. #########################
  39.  
  40. sudo nano '/etc/php5/fpm/pool.d/www.conf'
  41.  
  42. ----------
  43. listen = 127.0.0.1:2000
  44. ----------
  45.  
  46. #########################
  47. ####NGINX Certificates####
  48. #########################
  49.  
  50. sudo mkdir '/etc/nginx/ssl'
  51. - Copy ssl.key and ssl-unified.crt to that folder (use archive or follow StartSSL guide)
  52. sudo chmod 600 /etc/nginx/ssl/*
  53.  
  54. #########################
  55. ####NGINX Virtual Host####
  56. #########################
  57.  
  58. sudo nano '/etc/nginx/sites-available/gnusocial'
  59.  
  60. ----------
  61. server {
  62. listen 443;
  63. listen [::]:443;
  64.  
  65. server_name realmofespionage.com;
  66. root /var/www/html;
  67. index index.php index.html index.htm;
  68.  
  69. location ~ \.php$ {
  70. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  71. fastcgi_pass 127.0.0.1:2000;
  72. fastcgi_index index.php;
  73. fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
  74. include fastcgi_params;
  75. fastcgi_buffer_size 128k;
  76. fastcgi_buffers 4 256k;
  77. fastcgi_busy_buffers_size 256k;
  78. }
  79.  
  80. location / {
  81. rewrite ^(.*)$ /index.php?p=$1 last;
  82. break;
  83. }
  84.  
  85. location ~* ^/(.*)\.(ico|css|js|gif|png|jpg|bmp|JPG|jpeg)$ {
  86. root /var/www/html;
  87. rewrite ^/(.*)$ /$1 break;
  88. access_log off;
  89. expires max;
  90. }
  91.  
  92. ssl on;
  93. ssl_certificate /etc/nginx/ssl/ssl-unified.crt;
  94. ssl_certificate_key /etc/nginx/ssl/ssl.key;
  95.  
  96. ssl_session_timeout 5m;
  97.  
  98. ssl_protocols SSLv3 TLSv1;
  99. ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
  100. ssl_prefer_server_ciphers on;
  101.  
  102. client_max_body_size 15m;
  103.  
  104. access_log /var/log/nginx/access.log;
  105. error_log /var/log/nginx/error.log;
  106. }
  107.  
  108. server {
  109. listen 80;
  110. server_name realmofespionage.com;
  111. rewrite ^ https://www.realmofespionage.com$request_uri? permanent;
  112. }
  113. ----------
  114.  
  115. sudo ln -s '/etc/nginx/sites-available/gnusocial' '/etc/nginx/sites-enabled/gnusocial'
  116.  
  117. #########################
  118. ####MariaDB Tweaks####
  119. #########################
  120.  
  121. sudo nano '/etc/mysql/my.cnf'
  122.  
  123. ----------
  124. innodb_buffer_pool_size = 1024M
  125. innodb_thread_concurrency = 4
  126.  
  127. collation-server = utf8_unicode_ci
  128. init-connect='SET NAMES utf8'
  129. character-set-server = utf8
  130. ----------
  131.  
  132. #########################
  133. ####Database Setup####
  134. #########################
  135.  
  136. mysql -u root -p
  137. create database gnusocial;
  138. grant usage on gnusocial.* to 'gnusocial'@'localhost' identified by 'PASS';
  139. grant all privileges on gnusocial.* to 'gnusocial'@'localhost';
  140. flush privileges;
  141. exit
  142.  
  143. #########################
  144. ####Download GNU social####
  145. #########################
  146.  
  147. cd '/var/www'
  148. sudo rm html/*
  149. sudo git clone -b nightly https://git.gnu.io/gnu/gnu-social.git html
  150.  
  151. #########################
  152. ####GNU social Setup####
  153. #########################
  154.  
  155. sudo cp '/var/www/html/htaccess.sample' '/var/www/html/.htaccess'
  156.  
  157. sudo nano '/var/www/html/config.php'
  158.  
  159. ----------
  160. (uncomment out schemacheck line)
  161.  
  162. $config['mail']['domain'] = 'realmofespionage.com';
  163. $config['mail']['notifyfrom'] = '[email protected]';
  164. $config['mail']['backend'] = 'smtp';
  165. $config['mail']['params'] = array(
  166. 'host' => 'smtp.comcast.net',
  167. 'port' => 587,
  168. 'auth' => true,
  169. 'username' => 'USER',
  170. 'password' => 'PASS'
  171. );
  172.  
  173. addPlugin('EmailRegistration');
  174. addPlugin("GeoURL");
  175. addPlugin("ModPlus");
  176. ----------
  177.  
  178. sudo php '/var/www/html/scripts/checkschema.php'
  179.  
  180. sudo rm -R '/var/www/html/INSTALL'
  181.  
  182. #########################
  183. ####END####
  184. #########################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement