Ver código fonte

More diaspora

Bob Mottram 11 anos atrás
pai
commit
d32a539c0c
1 arquivos alterados com 54 adições e 19 exclusões
  1. 54
    19
      beaglebone.txt

+ 54
- 19
beaglebone.txt Ver arquivo

@@ -7078,7 +7078,7 @@ Set *require_ssl* to *true*
7078 7078
 
7079 7079
 Set *single_process_mode* to *false*
7080 7080
 
7081
-Set *port* to 3000
7081
+Set *port* to 3001
7082 7082
 
7083 7083
 Set *rails_environment* to 'production'.
7084 7084
 
@@ -7109,6 +7109,20 @@ Under *admins* set *podmin_email* to podmin@mydiasporadomainname.com
7109 7109
 Save and exit.
7110 7110
 
7111 7111
 #+BEGIN_SRC: bash
7112
+RAILS_ENV=production  bundle install --without test development
7113
+#+END_SRC
7114
+
7115
+This will take quite a while to install.
7116
+
7117
+#+BEGIN_SRC: bash
7118
+RAILS_ENV=production  bundle exec rake db:create db:schema:load
7119
+bundle exec rake assets:precompile
7120
+#+END_SRC
7121
+
7122
+Alter the Apache configuration.
7123
+
7124
+#+BEGIN_SRC: bash
7125
+exit
7112 7126
 export HOSTNAME=mydiasporadomainname.com
7113 7127
 editor /etc/apache2/sites-available/$HOSTNAME
7114 7128
 #+END_SRC
@@ -7134,26 +7148,44 @@ Add the following in the section which begins with *<VirtualHost *:443>*.
7134 7148
 	ProxyRequests Off
7135 7149
     SSLProxyEngine On
7136 7150
 
7137
-    ProxyPass / https://localhost:3000/
7138
-    ProxyPassReverse / https://localhost:3000/
7151
+    ProxyPass / http://localhost:3001/
7152
+    ProxyPassReverse / http://localhost:3001/
7153
+    RequestHeader set X_FORWARDED_PROTO https
7154
+
7155
+	DocumentRoot /home/diaspora/diaspora/public
7156
+	<Directory />
7157
+		Options FollowSymLinks
7158
+		AllowOverride All
7159
+	</Directory>
7160
+	<Directory /home/diaspora/diaspora/public>
7161
+		Options All
7162
+		AllowOverride All
7163
+		Order allow,deny
7164
+		allow from all
7165
+	</Directory>
7139 7166
 #+END_SRC
7140 7167
 
7141 7168
 Save and exit.
7142 7169
 
7143 7170
 #+BEGIN_SRC: bash
7144
-RAILS_ENV=production  bundle install --without test development
7171
+editor /usr/bin/rundiaspora
7145 7172
 #+END_SRC
7146 7173
 
7147
-This will take quite a while to install.
7174
+Add the following.
7148 7175
 
7149 7176
 #+BEGIN_SRC: bash
7150
-RAILS_ENV=production  bundle exec rake db:create db:schema:load
7151
-bundle exec rake assets:precompile
7177
+#!/bin/sh
7178
+USERNAME=diaspora
7179
+COMMAND="cd /home/$USERNAME/diaspora; /bin/sh /home/$USERNAME/diaspora/script/server > /home/$USERNAME/diaspora.log"
7180
+su -l $USERNAME -c '$COMMAND'
7152 7181
 #+END_SRC
7153 7182
 
7183
+Save and exit.
7184
+
7154 7185
 Create an init script:
7155 7186
 
7156 7187
 #+BEGIN_SRC: bash
7188
+chmod +x /usr/bin/rundiaspora
7157 7189
 editor /etc/init.d/diaspora
7158 7190
 #+END_SRC
7159 7191
 
@@ -7177,27 +7209,30 @@ Add the following.
7177 7209
 
7178 7210
 #Settings
7179 7211
 SERVICE='diaspora'
7212
+HISTORY=1024
7180 7213
 USERNAME='diaspora'
7181
-DIASPORA_HOME=/home/$USERNAME/diaspora
7182
-LOGFILE=/home/$USERNAME/diaspora.log
7183
-COMMAND="cd $DIASPORA_HOME; ./script/server >> $LOGFILE"
7184
-PATH='/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/core_perl:/sbin:/usr/sbin:/bin'
7214
+COMMAND="rundiaspora"
7215
+NICELEVEL=19 # from 0-19
7216
+INVOCATION="nice -n ${NICELEVEL} ${COMMAND}"
7217
+PATH='/usr/local/sbin:/usr/local/bin:/usr/bin:/sbin:/usr/sbin:/bin'
7185 7218
 
7186 7219
 
7187 7220
 diaspora_start() {
7188
- echo -n $"Starting $SERVICE service: "
7189
-# cd $DIASPORA_HOME
7190
- su -l $USERNAME -c "$COMMAND"
7191
- RETVAL=$?
7221
+ echo -n $"Starting $SERVICE service"
7222
+ screen -h ${HISTORY} -dmS ${SERVICE} ${INVOCATION}
7223
+# su --command "screen -h ${HISTORY} -dmS ${SERVICE} ${INVOCATION}" $USERNAME
7224
+# su -l $USERNAME -c "$COMMAND"
7225
+# RETVAL=$?
7192 7226
  echo
7193 7227
 }
7194 7228
 
7195 7229
 
7196 7230
 diaspora_stop() {
7197
- echo -n $"Stopping $SERVICE service: "
7198
- # Uncomment here to allow stop
7199
- su -l $USERNAME -c "$DIASPORA_HOME/script/server"
7200
- RETVAL=$?
7231
+ echo -n $"Stopping $SERVICE service"
7232
+ screen -p 0 -S ${SERVICE} -X stuff "'^C'"
7233
+# su --command "screen -p 0 -S ${SERVICE} -X stuff "'^C'"" $USERNAME
7234
+# su -l $USERNAME -c "/home/$USERNAME/diaspora/script/server"
7235
+# RETVAL=$?
7201 7236
  echo
7202 7237
 }
7203 7238