Smalltalk web app deployment on headless Linux server - smalltalk

We wrote a small prototype web app using Pharo and Seaside and we want to now demonstrate to the suits that the app can be deployed into our standard Linux build. We use a mix of CentOS, Ubuntu Server and Gentoo which are run headless since most of our apps are JAVA/Apache based. Only port 80 and 443 are open to the outside world.
What are your experiences when hosting Seaside/Smalltalk server side apps?

it runs great, btw you can get free hosting for your seaside app at:
http://www.seasidehosting.st/
for more power you'd need your own server of course...
some benchmarks here:
http://gemstonesoup.wordpress.com/2007/10/19/scaling-seaside-with-gemstones/

The Seaside Book has a chapter on deployment. It describes how I typically deploy a Seaside application.

I just use a ssh tunnel to get the X display on my local machine. I'm using slicehost (US) from the Netherlands, so I have a ping time of 135 ms. That's not that nice, but ok.
Next step will be Lukas Renggli's remote frame buffer package to use a vnc viewer.
Let's see what Miguel Cobá had to say about it on it on the Gemstone mailing list:
If you have already installed a RFB in your machine then use it.
If you have RFB installed in your image and it is accesible from your
client machine, use it
But, both of them are unencrypted. If you want to encrypted you must
setup a tunnel (maybe with ssh or maybe TLS).
I think that that is redundant because you must use a tunnel and then
the RFB. So what I do, in linux is to install the minimal X libraries
and then forward the X session to my local machine.
In the server (Debian/Ubuntu instructions):
aptitude update
aptitude install xbase-clients
aptitude install xtightvncviewer
Test it from the client machine:
ssh -X remote_server
squeakvm gemtools.image &
This will start the squeakvm process on the server, but all the graphics
will be shown on the local machine (the Xserver for this particular
scenario).
Also, if you install RFB on some of your images and start them headless,
you can use xtightvncviewer to connect to inside the image through the
RFB server.
ssh -X remote_server
xtightvncviewer localhost:0 &
this will run the xtightvncviewer on the remote server but, again, will
show on your local machine. Supposing you have your image in the remote
server running RFB in the first display.
Which is the advantage:
- You don't have to open ports for RFB on the remote server
- You transmit everything encrypted through ssh
- You only run the commands on demand in the remote server. You don't
have to have VNC running always.
- You can configure your RFB in the image to accept only localhost
connections and not from everywhere.
Martin McClure adviced me to take a look at NoMachines NX (less chatty X),
but that's still on my todo list.
For another set of deployment instructions, take a look at Miguels blog

The blogosphere's been talking about this issue recently.
Doug Putnam wrote up his experiences in installing Seaside (on Pharo) on his Slicehost slice, working off James Robertson's writeup (which uses VisualWorks, I suppose?).

Related

Magento 2 development environment on local server

I need to create a local development environment and struggling a little with the setup. I want to replicate my live server as close as I possibly can.
I want to install Magento ver 2.1.8, running MySQL 5.6, PHP 7.0 with NginX and Debian.
Now, it would be more than one person which will be working on the development sites, therefore, it will have to stored on our local server.
We are working on Windows 10 Pro machines.
I had a look at tools such as VirtualBox, Vagrant and Docker but reading about them got me even more confused.
I had a brief look at the LAMP stack too. Could you recommend the best way to go for my situation?
Do I have to use these tools in combination with each other?
Do I have to install the software on each computer or on local server?
I recommend to use this docker container: https://github.com/yvoronoy/magento2docker
It uses apache but you can change it via editing Dockerfile. Main advantage in this container is configured sshfs mounting in MacOS which works a little bit faster that default mounting, and you can work with source code as you work on local instance.

The best way of develop with Open shift origin: VM or local installation

What is the best way to develop with open shift origin? Is it using vm or install it locally? I have tried installing the vm and I could not login to the vm. What is the default credential used to login to fedora vm.
Default credentials
Depending on which route you follow (see below) there might or might not be real authorization in place.
If you have the AllowAllPasswordIdentityProvider in place you can get away with test/test or whatever.
If you take the binary version (see below) this is what you'll have by default. I changed it to be HTPasswdPasswordIdentityProvider instead.
For the other options I think you will have a user called system, with the password admin coming with the setup.
Docker container version
You can quickly get OpenShift running in a Docker container using
images from Docker Hub on a Linux system. This method is supported on
Fedora, CentOS, and Red Hat Enterprise Linux (RHEL) hosts only.
Link: https://docs.openshift.org/latest/getting_started/administrators.html#running-in-a-docker-container
As per the origin folks, this setup is not (yet) a full example, but very easy to get started with. You should be able to follow the instructions to get an all-in-one instance up and running in no time. However, this approach cannot teach you how to create a cluster (master(s) and node(s))
Vagrant VM
This image is based off of OpenShift Origin and is a fully functioning
OpenShift instance with an integrated Docker registry. The intent of
this project is to allow Web developers and other interested parties
to run OpenShift V3 on their own computer. Given the way it is
configured, the VM will appear to your local machine as if it was
running somewhere off the machine.
The OpenShift Master, Node, Docker Registry, and other pieces are running in one VM. Given it's focus on application developers, it should NOT be used in production.
Link: https://www.openshift.org/vm
Binary option
Red Hat periodically publishes binaries to GitHub, which you can
download on the OpenShift Origin Releases page.
Link: https://github.com/openshift/origin/releases
This is the option I follow currently. You download the binaries, install GO, then setup the OC client tools. Next step you generate the configuration files and start adding your system components (router, ...).
Follow this page to understand the basics:
Link: https://github.com/openshift/origin/blob/master/examples/sample-app/README.md
Ansible route
For production installation you probably want to install your cluster via Ansible.
My humble advice is to do this once you got a bit of an experience via configuring by hand (see previous point). Let's hear some people with more experience though.
Link: https://docs.openshift.org/latest/install_config/install/index.html
Documentation in general
Link: https://docs.openshift.org/latest/install_config/master_node_configuration.html#creating-new-configuration-files
Spin up a Centos.7 VM, download the latest origin tools:
wget https://github.com/openshift/origin/releases/download/v1.3.0-alpha.2/openshift-origin-client-tools-v1.3.0-alpha.2-983578e-linux-64bit.tar.gz
tar xzvf openshift-origin-client-tools-v1.3.0-alpha.2-983578e-linux-64bit.tar.gz
ln -s /root/openshift-origin-client-tools-v1.3.0-alpha.2-983578e-linux-64bit/oc /usr/local/bin/oc
chmod 755 /root/openshift-origin-client-tools-v1.3.0-alpha.2-983578e-linux-64bit/oc
Bring up your single node origin cluster:
oc cluster up --use-existing-config --host-data-dir=/var/tmp/etcd
Login using the instructions provided.

Simple OS X TCP forwarding server/service

As part of a TDD (test driven development) project I want a simple OSX service/server that simply forwards data between two clients. The purpose is to enable communication between one piece of code running in iOS (being tested) and another running in OS X.
I think I need both parties to connect to the server for the duration of the test, which points at TCP
There are lots of examples for creating simple clients using NSStream, but have failed to find what creates the Server side.
I would have thought it would be normal for this forwarding software to be a client of the final server, rather than both the other pieces of code being a client to it (as it's both counter-intuitive and somewhat difficult to acheive):
iOS App -> Forwarding Server -> OSX Server
You can achieve this using netcat (which is installed by default on OSX), simply with:
$ nc -l -p local-port -c "nc osx-host osx-port"
(see below)
and the iOS app simply needs to connect to local-port on whatever machine this forwarding server is running on.
EDIT When I actually tested my answer I found that the netcat supplied with OSX cannot support port forwarding, and the answer I supplied only works with the Linux version (I believe there is a BSD-rewrite which OSX uses).
Anyway, this can be achieved if you are happy to install macports and use socat. Here's a working example that redirects port 8888 to www.google.com:80:
$ sudo port install socat
$ socat TCP-LISTEN:8888,fork TCP:www.google.com:80
If you then connect to http://localhost:8888 within your browser, this will hit Google.
Port Forwarding In Windows for iOS .
1. Install Python 2.7 on windows system
2. Connect your iPhone to windows system
3. Download USB MXD1.0 and put it in C Drive
4. Run Command Prompt : OpenC:\usbmuxd-1.0.8\python-client in cmd
5. Run **\Python27\python.exe tcprelay.py -t local port:remote Port**
Eg :**\Python27\python.exe tcprelay.py -t 9892:9892**

Get remote cmd from linux termnal

I need to run some scripts in a windows remote machine from a terminal linux, I've tried using telnet however in the windows machine it's unable and there isn't installed a ssh server. So I need other way to run the command remotely without a graphical interface.
I have the possibility for run the command from a windows machine, however I need to open a SSH Tunnel to see the remote machine, I've used psexec but it didn't work for me.
Do you have access to install software on the remote server?
Your SSH client will not be able to connect to the remote machine unless that machine is running an SSH server to respond to your client's connection request.
There are a number of possible options for SSH servers to run on Windows.
(Google for ssh server windows)
Because SSH gives an external user some access to/control over your server it is designed to be a secure tool. I would therefore recommend using an SSH server which is still actively maintained, and keep it up to date. Servers which are old and no longer supported are are likely to contain known security issues which may never be addressed, thereby leaving your server vulnerable.
There are a number of good free open-source solutions for this, so you shouldn't need to buy anything.
In the past I've worked with Windows machines running Cygwin, with the OpenSSH ssh server installed. Depending how much of the Cygwin system you choose to install, it can make the target Windows host rather like logging into another Linux box in terms of environment.
You can download the installer for Cygwin from http://www.cygwin.com/

Ubuntu on VirtualBox and Rails server

I have Windows 7. Installed VirtualBox and Ubuntu 11.04 as guest OS.
Networking is done by NAT.
Everything is fine: I have internet on Ubuntu.
I can access Windows from Ubuntu by its ip.
But i can't access Ubuntu by it's ip which is shown by ifconfig.
I run rails on Ubuntu.
How can I solve this problem: connect to Ubuntu/Rails server on ort 3000 from my Windows?
By default, VirtualBox's NAT allows the virtual machine to access the Internet ; but doesn't allow the physical machine to access the Virtual one.
The simplest solution would be to use another networking setting than NAT, for your Virtual Machine -- for instance, bridge should work fine (your VM would be visible on your network, though).
Another solution would be to use port forwarding ; about that, this article might help : Howto Access via ssh a Virtualbox Guest machine.
I used to struggle with configuring a similar setup until I found Vagrant. Vagrant makes it very simple to setup, connect to and work with a Linux virtual machine. After Vagrant is configured you can just type vagrant ssh to enter the virtual machine and your account has automatic sudo rights and everything works as expected - you don't even have to deal with logging into the vm. The initial setup for ssh does look to be a little more work under Windows though as you need to configure Putty before you can connect.
There is a simple configuration file in Vagrant that you use to specify which ports from the VM you want forwarded to your machine using a syntax like:
config.vm.forward_port("rails", 80, 3000)
config.vm.forward_port("tomcat", 8000, 8080)
and everything is taken care of. Details are here
If, for example, you are using Rails and you start vagrant with the command vagrant up in your Rails project directory than that directory is available on the VM. Since it is the same shared directory between machines, any changes you make in your Rails project directory on your machine using your regular editor is seen on the VM also. This makes testing in other environments very easy.
Instructions for setting Vagrant up with Windows are here and a RailsCast about it is here. Note that Vagrant has nothing to do directly with Rails - you can use it for setup of any virtual machine environment you need.
In short, you can't.
It is a local host not a public domain therefore not publicly accessible outside of your virtualbox environment.
Maybe someone has a clever hack for this but why would you want to do this in the first place?
Your solution is to either use firefox to browse to your localhost within your virtualbox linux session or develop on windows.
Personally I work the other way round I run Ubuntu 11.04 and I have virtualbox installations of xp, 2,000, me, vista and 7 so I can test in different environments. Inevitably I end up sharing my project folder from Ubuntu so that I can run the project in whatever OS I am testing for.