Install IPython notebook on a remote server without root privileges - jupyter-notebook

I need to deploy IPython Notebook on an Ubuntu remote server.
One solution is to deploy it as a local user, without sudo privileges, on a system where other servers are already running.
The second solution is to setup a new server, and install IPython with sudo privileges.
I'd like to know before to start, if there are some requirements related to the IPython Notebook server deployment that can make solution 1 difficult.

I found these tutorials particularly useful when setting up IPython nbserver:
Create an iPython HTML Notebook on Amazon's AWS Free Tier from scratch
Running a notebook server
They don't require sudo privileges. You can also try setting up virtualenv to encapsulate the environment to the local user. However, it is necessary to set the port where Notebook can be accessed from the outside, so there can be potential conflict if you're not able to expose ports on the server.

Related

How to became superuser on AWS EC2 WordPress Site

I want to install SSL on AWS EC2 WordPress Site,
I have tried this:
bitnami#ip-172-24-0-191:/opt/bitnami/apache2/htdocs$ sudo /opt/bitnami/bncert-tool
An updated version is available. Would you like to download it? You would need to run it manually later. [Y/n]: Y
The tool will exit now. To run the updated version run the following command:
/opt/bitnami/bncert-tool
bitnami#ip-172-24-0-191:/opt/bitnami/apache2/htdocs$ /opt/bitnami/bncert-tool
but I have this error:
Error: There has been an error.
This installer requires root privileges. Please become superuser before
executing the installer
Press [Enter] to continue:
All you have to log in with AWS root user first.
Installing SSL depends on your web panel like cpanel, cyberpanel, directadmin etc.
If you have bought a SSL then install it via panel first.
If you want to install SSL via SSH access, Be sure your SSH port is open and the credentials are correct.
Your error is showing because of not root user access.
Thanks.

What is the process to start jupyterhub automatically?

I have installed a jupyterhub on my subdomain. Whenever I have to use jupyterhub I have to run a command jupyterhub on ubuntu terminal if it is closed we are not able to access it.
SO, is there any way to start jupyterhub automatically when system start?
Version:
UBUNTU 16.4,
anaconda 5.1.0,
jupyter notebook --version 5.4.0,
There are a few ways to accomplish this - what you are essentially looking for is how to run a script or start a service at system boot.
Depending on your comfort level with unix you can choose which option you want.
http://upstart.ubuntu.com/
configure jupyter as a service and start the service at boot time
setup jupyter notebook as a service
start service at system reboot

Running meteor on linux server

I am trying to get my localhost working on my remote (mediatemple) server.
I have bundled it up and have a /myurl.com/bundle folder with the following files.
this folder contains
main.js
npm-debug.log
programs
server
How do I get this to run?
You should take a look in the README inside the bundle folder. Normally everything ist described there to start your app.
Make sure that NODEJS and MONGO is installed on your remote server. This is NOT included in your bundle as well as NODEJS is not present.
If you are running a system like debian or ubuntu normally you can do the installation with
apt-get install nodejs mongo
Make sure, that the nodejs has release v0.10.36 or v0.10.38
node --version
At the README you see the necessary ENV-VARS like MONGO_URL and PORT you need to set to start your meteor app.
If you have running a apache server already the PORT 80 is already blocked, so try PORT=3000 to start your meteor app.
Example:
MONGO_URL='mongodb://localhost:27017/yourapp' ROOT_URL="http://yourhost" PORT=3000 node main.js
If using as above you do not need to export the ENV-VARS before start
Sometime when starting, there are missing NPM – you get fiber errors
In that case
cd programs/server
npm install
and the try start again.
Good luck
Tom
(I'm writing this response assuming that you are not worried about scalability issue, respond in comment if you want to scale your app)
The best option for running a node application, which Meteor application is, is by using forever.
npm install forever
forever start simple-server.js
If you want to figure out how to see the log files and how to stop/restart your service, you can run forever --help to see all the commands.

How to correctly install dokku - with or without sudo?

I'm learning dokku right now for simple web deployment. Offical install instructions state this command:
wget -qO- https://raw.github.com/progrium/dokku/v0.3.12/bootstrap.sh | sudo DOKKU_TAG=v0.3.12 bash
I'm not a devop or admin, but as far as I understand this line, it performs all bootstrapping and installation under the root account, thanks to sudo. So dokku will be checked out into a directory with root access rights, and all additional directories like /var/lib/dokku/ will also have root access rights.
The problem is - all articles across the internet about dokku instructs to execute dokku command or do dokku-related actions without sudo. For example, instructions about this dokku database plugin, https://github.com/krisrang/dokku-mariadb, instructs to install it via:
cd /var/lib/dokku/plugins
git clone https://github.com/krisrang/dokku-mariadb mariadb
dokku plugins-install
This is not working, since /var/lib/dokku/plugins have root access rights and git clone will fail with acces denied. It's hard to be a non-admin nowadays, but maybe someone will hint what I'm doing wrong? Do I need to install dokku some other way, or all dokku-related tutorials across internet assume that I'm executing them under root (which is, by my limited admin knowledge, highly not recommended for security reasons).
You should run those three commands as sudo:
sudo su -
The dokku binary will run code as the dokku user even if you execute as root. So it should be fine to run that as is. Once you are the sudo user, just run the install instructions listed in your question. Hope my answer helps ! :)
I also contacted them as they mentioned:
In the future, we'll have a method to install plugins directly with a
dokku command
As far as I can tell, you need to run it as root. A traditional way to install a program without root-privileges is to download the source and compile it, which can be done by running:
git clone https://github.com/progrium/dokku.git
make
make install
Dokku's makefile depends on apt-get, which requires root access to run.
I'm not familiar with dokku or dokku-mariadb, but I think the author of dokku-mariadb also assumes root access.
For people running into the question on wether its fine to install through root user (on fresh created VMs as per the guide), try checking this Github issue:
https://github.com/dokku/dokku/issues/961
Since the commands related to dokku are prefixed with # rather than $, it means that its not necessary to run them from non-root user. It also makes writing suddo unnecessary (and form my experience counterproductive).

Correct way to setup Virtualbox 4.3 to use symlinks on guest (for meteor)

I use Windows 8 and installed Virtualbox so i can access to a Linux (Ubuntu) System.
The most i still did to do this - so at this moment i have a working Virtualbox with Ubuntu 14.04 LTS.
In my case i need this Virtualbox with Linux for meteor.
The problem:
meteor uses nodejs and so i need to have symlinks access (i think its symlinks - i read a few about it)
Reference: How to run meteor app inside an Ubuntu VrtualBox and edit using an editor on a Windows host?
He describes the same problem i have now:
Error: EROFS, read-only file system '/media/sf_Shared/Dropbox/dev_uhurajr/chat/.meteor/local/.build320446.build/programs/server/npm/logging/main/node_modules'
So i tried to enabled Symlinks on my host (windows) this way:
VBoxManage setextradata YOURVMNAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/YOURSHAREFOLDERNAME 1
Reference: http://www.ahtik.com/blog/fixing-your-virtualbox-shared-folder-symlink-error/
This works fine! When i check the extradata for my VM the field SharedFoldersEnableSymlinksCreate is on 1
I set this value for 2 folders. The shared folder on Windows and also the name of the shared folder on my Linux VM.
But .. the same problem. The following error occurs everytime meteor tries to write symlinks:
Error: UNKNOWN, unknown error '/media/Projekte/test/.meteor/local/.build320446.build/programs/server/npm/logging/main/node_modules'
So whats the right way to get this working ?
Guessing you were using Virtualbox version after 4.0, please:
Enable symlinks VBoxManage.exe setextradata YOUR_VM VBoxInternal2/SharedFoldersEnableSymlinksCreate/YOUR_SHARED_FOLDER 1
Run VirtualBox 'as admininstrator' on Windows.
Replace the YOUR_VM and YOUR_SHARED_FOLDER with your own value. You can check the value via VBoxManage.exe getextradata YOUR_VM enumerate
VirtualBox enabled symbolic for shared folder since 4.0, it's Windows permissions blocking you. You can either enable the permission for user or simply run VirtualBox as an administrator.
Please to refer the Virtualbox documentation:
Doc updated, please refer to the doc Shared Folders:
Starting with version 4.0, VirtualBox shared folders also support symbolic links (symlinks), under the following conditions:
The host operating system must support symlinks (i.e. a Mac, Linux or Solaris host is required).
Currently only Linux and Solaris Guest Additions support symlinks.
I made a development vm with setup and run scripts.
https://github.com/gfk-ba/meteor-dev-vm
Just put your meteor app in the app directory and follow the instructions in the readme.md

Resources