orionblastar / K666

K666 is forum discussion software, this is an attempt to write the Free version FreeK666 without violating copyright
http://k666.kr5ddit.com
MIT License
5 stars 0 forks source link

Host This Somewhere #7

Closed procrasti closed 8 years ago

procrasti commented 8 years ago

We should the latest version of K666... so we can try it out as we work on it?

Maybe?

orionblastar commented 8 years ago

Someone hacked blastar.in with a chmod 777 on every directory and Del pays for the VPS so he has to reinstall it, but has been busy with work and his new Scoop site.

I am on disability and in bankruptcy with no credit so some of my sites and domain names got expired because I could no longer afford them.

I used up my Amazon credits for AWS already as well. Unless they give more credits or something?

Only domain name I have left is blastar.in and I can move it to a different IP address or use Name.com to create a subdomain and park it on a free host? Not sure if I can get shell access with a free host.

procrasti commented 8 years ago

I have a 512Mb machine for 1 year!!

Kr5ddit is moving over to that... soon.

I'll start by hosting k666.

The production version is very far along from k666, as you understand... but pretty much, if you can host k666, you can host kr5ddit.

procrasti commented 8 years ago

Okay, the startup branch is now running at http://k666.kr5ddit.com:8000/

Clearly we've still got some things to do to bring it live... ie, to move it to https://k666.kr5ddit.com/

How much can we automate deployment with github?

procrasti commented 8 years ago

It was up and running, but the prohibition of running DEBUG in production suggested that I should turn it off for now.

I have to setup all the apache stuff... and that's a bit week at the moment, it's not in a repository... I should fix that.

Or a container approach or something...

The complication is that I can just checkout K666 to a user directory, and run it and the debug, inbuilt webserve will function directly... say:

$ ./manage.py runserver 0.0.0.0:8000 Gets us going at the first link... but DON'T RUN DEBUG IN PRODUCTION... THIS IS WRONG.

But in the k666 folder is a file, wsgi.py, which apache uses to launch the django request processing processes... That's still okay... the real problem is that apache runs as root (necessary because of the port < 1024 rule).. but I can't just setup an apache config in a user directory and include that (even better if inside of K666, the default one)... I'm more or less going to have to setup apache again from scratch, and import the config files directly (unmanaged in git) from my current prod server into the new one.

Bad form really... probably an issue on it's own.

procrasti commented 8 years ago

Okay, pretty much this is working now:

http://k666.kr5ddit.com/ and http://k666.kr5ddit.com/static/index.html

I've basically just deployed the startup branch, but I had to make some changes. I often do this to get a version up and running... I edit it in place, then push the changes back up to dev.

The first big change is that I had to add a STATIC_ROOT to the settings.py, so that I could collect all the static in one place... I make it the project root directory... then link it into a higher level directory, and apache references that directory.

The apache config file required is called k666.conf, and goes in the /etc/apache2/conf.d. I needed to make some changes... It's running an older version of apache2 than the current host... So, the RequireAll stuff had to be commented out. Also, Rewrite Engine doesn't work... not a big problem at this stage.

Anyway... better to have something very basic, we can drop this file into the k666 directory, and do some link magic to make it imported by apache2.

So, this is pretty much the startup branch... some trivial change, so 'manage.py collectstatic' works... I have to put the apache2/k666.conf file into git... and there's a problem with the database not being writeable... because we're still using sqlite3, and the user has changed (runs from the apache2 user, not the freek666 user)... so, postgresql in production anyway.

procrasti commented 8 years ago

I guess we are going to want master to deploy automatically... need to look into github hooks!

procrasti commented 8 years ago

The prod branch has all the changes needed for production.

procrasti commented 8 years ago

Okay, still working on the production branch, but the index page is now about as fast as the static page.

You must run wsgi in daemon mode, and you must declare process-group in the script alias... and the response times aren't much more than ping times... (MOST of the time!)... So, pretty happy with that!

I close this down once it's all in git and happy to reinstall from scratch.