Running Seafile within Plesk - python

I'm using Debian 8 alongside Plesk Onyx (latest version). Now I want to install Seafile, which is dependent also from Python. I found tutorials on the Internet, however, none which describes how to set this up under Plesk within a subscription. So I neither want the port to be 8080, nor a 'separate' web server by Seafile itself. I want to access my seafile then under https://cloud.mydomain.com, is there any way to do this? And if there's no definite guide, what would be the rough steps (with regard to Seafile's program architecture and how it works)?

Not sure if still relevant, but anyway: Yes, it is definitely possible. Seafile installation should proceed according to normal installation process described in Seafile's Manual.
Redirecting the traffic from the frontend servers to Seafile/Seahub is a trickier, a more detailed description, using FastCGI, can be found here:
https://andre-hoeche.de/blog/2016/07/install-seafile-5-1-on-debian-7-10-with-apache-2-2-and-plesk-10-5/

Related

How to run a Django Project on a Personal Run Server

I've been wanting to run my own server for a while and I figured that running one for my django website would be a good start. What do you recommend I use for this? I've been trying to use a Ubuntu Virtual Machine to run it on one of my old laptops that I don't really use anymore until I can buy a dedicated server.
Should I run it from a Virtual Machine? If so, would Ubuntu be best? That appears to be the case, but I want to be sure before I invest in anything. I want to be able to access the website from other computers, just like any other website. Am I going about this wrong? If so, what can you suggest me?
Yes, you will need a static IP address.
If this is your first experiment, my advice would be:
1) Use an old, dedicated PC with no other stuff on it. Unless you do it just right, you should presume hackers could get anything on the disk...
2) Why make life complex with layer after layer of software? Install Ubuntu and run a standard server under a Unix OS
3) Be very careful about the rest of your attached network. Even if the PC is dedicated, unless you properly managed port forwarding, etc., ALL of your computers could be susceptible to attack.
An old friend of mine discovered, back in the Napster peer-to-peer days, that he could basically go and read EVERYTHING on the hard drives of most people who had set up Napster on their computer.
It really depends on your requirements. Will you be accessing the website externally (making it public) or locally? Running Django from your laptop can work but if you are planning to make it public, you will need an external IP to point your domain to. Unless you have a business account, ISPs usually don't give static IPs to individual customers. Ubuntu would be a wise choice and you can run conda or virtualenv easily.
VPS are quite cheap these days. You can look into AWS free tier that provides you with 500 hours/month on a micro server.
If you are planning to access your website internally then you don't need anything other than your laptop or perhaps raspberry pi. If you are trying to make it available for everyone on the external network, VPS would be the best bet.
Currently, and this changes often, I like to either setup a local development environment using virtualenv (to install dependencies) and Ngrok (to expose machine to an external address) or C9.io. If you want further info about setup, I'm happy to provide.
As already stated Ubantu is a good choice but there is also Debian. I use Debian because I started off working with a colleague who was already using it and I find it very good. I began with an old, disused desktop PC which I nuked and turned into a proper linux server. For development I didn't need a very high spec machine. (Think it has 1 GB ram) I have it set up in my flat and my domestic internet connection is fine for most of my needs. Note: It isn't necessary to have a static IP address for development, although it is preferable if you already have one. As an alternative you can use a service such as dnydns.org where you can set up virtual domain names that point to your domestic dynamic IP address. Most routers these days have facilities within them for updating services like dyndns.org with your new dynamic IP address or you can install a plug-in to your server that will do this for you. All my projects have their own virtualenvs and I have VNCServer installed so I can access my server and work from anywhere where I have an internet connection. I've been running this way for the past three years with some household name clients and haven't had any issues at all.
When it comes to production you can simply use any of the many VPS services that are out there. Amazon has already been mentioned. Someone recommended creating a droplet at DigitalOcean.com as I was wanting to host django applications and I find them to be very good and cost effective. Anyway just my 2 cents worth...hope it helps

Installing XMPP on a Python server

I am attempting to follow set up the python xmpp server for GCM as detailed here:
https://developer.android.com/google/gcm/ccs.html
The website I used for hosting is pythonanywhere.com
My issue is that when I saw import xmpp, it says that no such module is found.
Should I be trying to install it on their server? I realize that this issue is probably really basic, but I have looked online for the last hour or so without much fruit. I see all these variations on XMPP and am not sure if I have to deal with any of those or if I can just do exactly what the google demo is saying.
Thanks for your time,
-Alper
PythonAnywhere doesn't support raw TCP socket connections or websockets, so XMPP may not work. But then again, from reading wikipedia, it does look like there's a pure-HTTP alternative, so it might work.
Check out this guide to installing new modules: https://www.pythonanywhere.com/wiki/InstallingNewModules. My suggestion would be to use a virtualenv for your web app, and install flask and xmpp into that...
You will have to download and install the missing python package. You may do this manually via SSH if the provider gives you access, or there may be a way to include a requirements document such that the server looks and downloads needed packages automatically. It all depends on the host, the access they allow you, and their automation features.

How to build a web service with one sandboxed Python (VM) per request

As part of an effort to make the scikit-image examples gallery interactive, I would like to build a web service that receives a Python code snippet, executes it, and provides me with the generated output image.
For safety, the Python instances launched should be sandboxed and resource controlled, so I was thinking of using LXC containers.
Is this a good way to approach the problem? If so, what is the recommended way of launching one Python VM per request?
Stefan, perhaps "Docker" could be of use? I get the impression that you could constrain the VM that the application is run in -- an example web service:
http://docs.docker.io/en/latest/examples/python_web_app/
You could try running the application on Digital Ocean, like so:
https://www.digitalocean.com/community/articles/how-to-install-and-use-docker-getting-started
[disclaimer: I'm an engineer at Continuum working on Wakari]
Wakari Enterprise (http://enterprise.wakari.io) is aiming to do exactly this, and we're hoping to back-port the functionality into Wakari Cloud (http://wakari.io) so "published" IPython Notebooks can have some knobs on them for variable input control, then they can be "invoked" in a sandboxed state, and then the output given back to the user.
However for things that exist now, you should look at Sage Notebook. A few years ago several people worked hard on a Sage Notebook Cell Server that could do exactly what you were asking for: execute small code snippets. I haven't followed it since then, but it seems it is still alive and well from a quick search:
http://sagecell.sagemath.org/?q=ejwwif
http://sagecell.sagemath.org
http://www.sagemath.org/eval.html
For the last URL, check out Graphics->Mandelbrot and you can see that Sage already has some great capabilities for UI widgets that are tied to the "cell execution".
I think docker is the way to go for this. The instances are very light weight, and docker is designed to spawn 100s of instances at a time (Spin up time is fractions of a second vs traditional VMs couple of seconds). Configured correctly I believe it also gives you a complete sandboxed environment. Then it matters not about trying to sandbox python :-D
I'm not sure if you really have to go as far as setting up LXC containers:
There is seccomp-nurse, a Python sandbox that leverages the seccomp feature of the Linux kernel.
Another option would be to use PyPy, which has explicit support for sandboxing out of the box.
In any case, do not use pysandbox, it is broken by design and has severe security risks.

How to Aggregate data to Graphite

I'm monitoring my node server with module measured, what I need is to aggregate the monitored stats to Graphite. This is getting me confused and frustrated. Trying to understand the Graphite guide be not going well at all, it's show a unix world command guide, im using windows. Trying to install the required components, but python command says no commands supported. Anyone has a good guide that is easily understand and supported for windows, much appreciated!
I don't know much about graphite on Windows, but it can be difficult to setup even on linux, so I wouldn't even try on Windows. It's complicated in part because graphite is actually composed of a few components that work together.
The easiest way I've found to get started with graphite is download and use a virtual machine image that's already been built. For example, there are some vagrant images that have graphite and statsd already.
Hosted graphite is another possiblity, but it's not terribly cheap depending on your data retention needs, and I'm not sure I understand the security model.
If you're willing to muddle through the installation, here's a screencast showing step by step how to do so. That obfuscurity blog is also very informative about graphite use in general.

Communication between Windows Client and Linux Server

I want to provide my colleagues with an interface (using Windows Forms or WPF) to control the states of virtual machines (KVM based) on a linux host. On the command line of this server, I'm using a tool, called libvirt, which provides python bindings to access its functionality.
What whould be the best pratice to remotely access several function like libvirt or reading logfiles on the server. I thought about a REST Full Webservice generated by Python. Are there other viable options to consider?
Thanks,
Henrik
I'd develop an intranet web application, using any python web framework of choice.
That way you don't have to develop/install software on your client. They just point the browser and it works.
Because you are using a server-side tool that has Python bindings, you should give a serious look at PYRO which is a Python RPC library.
http://pyro.sourceforge.net/
To use this you would also have to use Python on the client, but that shouldn't be a problem. If you haven't start writing your client, then you could do it all in IronPython. Or, if you need to add this to an already existing client, then you could still bind in either IronPython or CPython as an embedded scripting engine.
For more on PYRO and Ironpython, see this wiki page http://www.razorvine.net/python/PyroAndIronpython
Proxmox VE is a complete solution to manage KVM (and OpenVZ) based virtual machines, including a comprehensive web console, so maybe you can get a full solution without developing anything?

Categories

Resources