Difference between revisions of "Linux utils"

From Wasya Wiki
Jump to: navigation, search
Line 43: Line 43:
  
 
<VirtualHost *:80>
 
<VirtualHost *:80>
 
 
   ServerAdmin piousbox@gmail.com
 
   ServerAdmin piousbox@gmail.com
 
 
   ServerName annesque.com
 
   ServerName annesque.com
 
 
   KeepAlive On
 
   KeepAlive On
 
   ProxyVia On
 
   ProxyVia On
 
   ProxyPreserveHost On
 
   ProxyPreserveHost On
 
 
 
   ServerAlias staging.annesque.com
 
   ServerAlias staging.annesque.com
 
   ServerAlias startups.piousbox.com
 
   ServerAlias startups.piousbox.com
 
   ServerAlias staging.startups.piousbox.com
 
   ServerAlias staging.startups.piousbox.com
 
 
   ProxyPreserveHost On
 
   ProxyPreserveHost On
 
   ProxyVia On
 
   ProxyVia On
 
 
   <proxy>
 
   <proxy>
 
     Order deny,allow
 
     Order deny,allow
 
     Allow from all
 
     Allow from all
 
   </proxy>
 
   </proxy>
 
 
   ProxyPass /api/ http://10.0.1.151:3007/ connectiontimeout=15 timeout=45
 
   ProxyPass /api/ http://10.0.1.151:3007/ connectiontimeout=15 timeout=45
 
   ProxyPassReverse /api/ http://10.0.1.151:3007/
 
   ProxyPassReverse /api/ http://10.0.1.151:3007/
 
 
   ProxyPass / http://10.0.1.72:3010/ connectiontimeout=15 timeout=45
 
   ProxyPass / http://10.0.1.72:3010/ connectiontimeout=15 timeout=45
 
   ProxyPassReverse / http://10.0.1.72:3010/
 
   ProxyPassReverse / http://10.0.1.72:3010/
 
 
 
</VirtualHost>
 
</VirtualHost>
 
</pre>
 
</pre>
Line 79: Line 69:
 
<pre>
 
<pre>
 
<VirtualHost *:3098>
 
<VirtualHost *:3098>
 
 
   ServerAdmin piousbox@gmail.com
 
   ServerAdmin piousbox@gmail.com
 
   ServerName localhost
 
   ServerName localhost
Line 85: Line 74:
 
   ProxyVia On
 
   ProxyVia On
 
   ProxyPreserveHost On
 
   ProxyPreserveHost On
 
 
   <proxy>
 
   <proxy>
 
     Order deny,allow
 
     Order deny,allow
 
     Allow from all
 
     Allow from all
 
   </proxy>
 
   </proxy>
 
 
   ProxyPass /api/ http://localhost:3000/ connectiontimeout=15 timeout=45
 
   ProxyPass /api/ http://localhost:3000/ connectiontimeout=15 timeout=45
 
   ProxyPassReverse /api/ http://localhost:3000/
 
   ProxyPassReverse /api/ http://localhost:3000/
 
 
   ProxyPass / http://localhost:8000/ connectiontimeout=15 timeout=45
 
   ProxyPass / http://localhost:8000/ connectiontimeout=15 timeout=45
 
   ProxyPassReverse / http://localhost:8000/
 
   ProxyPassReverse / http://localhost:8000/
 +
</VirtualHost>
 +
</pre>
  
</VirtualHost>
+
=== Linking ===
 +
<pre>
 +
ln -s /home/ubuntu/projects/ish_lib/current/lib          /home/ubuntu/projects/microsites2-cities/current
 +
ln -s /home/ubuntu/projects/ish_lib/current/app/models    /home/ubuntu/projects/microsites2-cities/current/app
 +
ln -s /home/ubuntu/projects/ish_lib/current/vendor/assets /home/ubuntu/projects/microsites2-cities/current/vendor
 +
 
 +
 
 +
mkdir -p /var/lib/tftpboot/images/nexenta3/platform/i86pc/kernel/amd64
 +
mkdir -p /var/lib/tftpboot/images/nexenta3/platform/i86pc/amd64
 +
cp /mnt/nexenta3/platform/i86pc/amd64/miniroot /var/lib/tftpboot/images/nexenta3/platform/i86pc/amd64/miniroot
 +
cp /mnt/nexenta3/platform/i86pc/kernel/amd64/unix /var/lib/tftpboot/images/nexenta3/platform/i86pc/kernel/amd64/unix
 
</pre>
 
</pre>

Revision as of 16:48, 31 January 2014


Nodes

This one, before I started sticking Node.js in there.

WARNING! in the codebase node listens on 3000. In production it listens on 3007.

piousbox@piousbox-laptop:~/projects/rails-quick-start$ knife node show app_server_21
Node Name:   app_server_21
Environment: _default
FQDN:        
IP:          10.0.1.151
Run List:    role[base], role[ish_static], role[marchesi_static], role[wiki_cac], role[wp_wasya]
Roles:       base, ish_static, marchesi_static, wiki_cac, wp_wasya
Recipes:     zsh, users::sysadmins, sudo, apt, nagios::client, git, build-essential, ish::base_apache, ish::static_site, ish_apache::static_site, ish_apache::base_apache, ish::base_php, mysql::client, mediawiki::default, mediawiki::appserver, wordpress::default
Platform:    ubuntu 12.04
Tags:      

This is a successful deployment except change node's listening from 3000 to 3007:

piousbox@piousbox-laptop:~/projects/rails-quick-start$ knife node show app_server_21
Node Name:   app_server_21
Environment: _default
FQDN:        
IP:          10.0.1.151
Run List:    role[base], role[node_exampler]
Roles:       base, node_exampler
Recipes:     zsh, users::sysadmins, sudo, apt, nagios::client, git, build-essential, node::base, node::upstream
Platform:    ubuntu 12.04
Tags:        

The load balancer:

ubuntu@ip-10-0-0-52:/etc/apache2/sites-available$ pwd
/etc/apache2/sites-available
ubuntu@ip-10-0-0-52:/etc/apache2/sites-available$ cat startups_staging

<VirtualHost *:80>
  ServerAdmin piousbox@gmail.com
  ServerName annesque.com
  KeepAlive On
  ProxyVia On
  ProxyPreserveHost On
  ServerAlias staging.annesque.com
  ServerAlias startups.piousbox.com
  ServerAlias staging.startups.piousbox.com
  ProxyPreserveHost On
  ProxyVia On
  <proxy>
    Order deny,allow
    Allow from all
  </proxy>
  ProxyPass /api/ http://10.0.1.151:3007/ connectiontimeout=15 timeout=45
  ProxyPassReverse /api/ http://10.0.1.151:3007/
  ProxyPass / http://10.0.1.72:3010/ connectiontimeout=15 timeout=45
  ProxyPassReverse / http://10.0.1.72:3010/
</VirtualHost>

Utils

Remember the virtual site for combining a node backend into some other service?

<VirtualHost *:3098>
  ServerAdmin piousbox@gmail.com
  ServerName localhost
  KeepAlive On
  ProxyVia On
  ProxyPreserveHost On
  <proxy>
    Order deny,allow
    Allow from all
  </proxy>
  ProxyPass /api/ http://localhost:3000/ connectiontimeout=15 timeout=45
  ProxyPassReverse /api/ http://localhost:3000/
  ProxyPass / http://localhost:8000/ connectiontimeout=15 timeout=45
  ProxyPassReverse / http://localhost:8000/
</VirtualHost>

Linking

ln -s /home/ubuntu/projects/ish_lib/current/lib           /home/ubuntu/projects/microsites2-cities/current
ln -s /home/ubuntu/projects/ish_lib/current/app/models    /home/ubuntu/projects/microsites2-cities/current/app
ln -s /home/ubuntu/projects/ish_lib/current/vendor/assets /home/ubuntu/projects/microsites2-cities/current/vendor


mkdir -p /var/lib/tftpboot/images/nexenta3/platform/i86pc/kernel/amd64
mkdir -p /var/lib/tftpboot/images/nexenta3/platform/i86pc/amd64
cp /mnt/nexenta3/platform/i86pc/amd64/miniroot /var/lib/tftpboot/images/nexenta3/platform/i86pc/amd64/miniroot
cp /mnt/nexenta3/platform/i86pc/kernel/amd64/unix /var/lib/tftpboot/images/nexenta3/platform/i86pc/kernel/amd64/unix