Ghost blog service stopped, when I restart it, there's no content - digital-ocean

I've had an installation of the ghost blogging platform on a DigitalOcean server for at least a year now. Everything was working great until 2 days ago, when I realized my blog is down.
I accessed the server, and saw that the process wasn't running. I started it again, but I don't have the content anymore, and no settings were saved.
Looking into the ghost folders, I see the /content/data folder with all the posts and images I had, but when I start the blog (just using node index.js) and I go to the url in the browser, I see the blog as if it's never been configured with a user, and no data is present.
How do I restore my configuration settings, and the content I used to have ?

Ok, it was a pretty stupid mistake on my side...
I was starting the server by just running index.js like this : node index.js
But when I initially started the ghost blog it was by running npm start --production
Ghost blog comes built with 2 databases - one for production use, and another for development purposes or anything else you want to play around with. When I started it in 'production mode' again I got my content and all the settings back. :)

Related

Self-hosting multiple sites via one Django project + apache - Django Sites framework

I have a self-hosted (raspberry pi) website running on Django - one project with several apps all serving on one domain name. I'm more of a programmer than a server admin, but it works! Now, I'd like to break one of those apps out onto a second domain name, but still hosting from my pi.
--I've looked into a lot of tutorials on how to do this as well as checked out answers like this one but the server-related instructions on everything I've found so far all go a bit over my head or don't seem to match up with my setup.
--I've tried the Django Sites framework and I've also followed this tutorial. While I was able to get my site objects in the db, all requests seem just to go to SITE_ID=1, regardless of domain name. I've seen conflicting information here about whether or not SITE_ID should be present in settings.py, but whenever I remove it, I just get errors about it (even though I do have the CurrentSiteMiddleware installed as well as a custom middleware like indicated in that tutorial).
Here's what I've got for Django (3.2.14, and py3.7.3), essentially:
DjangoApps
-mysite
--settings.py (allowed_hosts includes mydomain)
--urls.py (imports from app urls files)
--(etc)
-app1
--urls.py
--(etc)
-app2
--urls.py
--(etc)
-app3
--urls.py
--(etc)
and then the server confs:
/etc/apache2/sites-available/
-000-default.conf
-default-ssl.conf
-mydomain.com.conf [which points to the DjangoApps directory]
-mydomain.com-le-ssl.conf
I do not have an http.conf as mentioned in many of the tutorials/answers I've read through. I've seen some notes about using virtualenv and/or wsgi but I don't understand them, and I am requesting a more handholding step-by-step explanation of what to do here.
I assume this isn't the most optimal/modern way of doing this, but the key point here is that this main site is already live and working as-is so I'm really not looking to redo the whole thing. All I want to do is make it so that myseconddomain.com serves app3 only, and mydomain.com keeps serving everything (or, everything but app3, if that's easier).
Please help! And please let me know what other info is required.

I can't sign into the Django admin login page

I have started multiple Django projects with like four different tutorials. Every single time I try "python manage.py createsuperuser", the admin login page just loads and loads and never goes anywhere. I want to make it absolutely clear that I haven't touched a thing in the code and everything is default code. I migrated everything before login. I've tried deleting the database and re-migrating. None of that works. Can someone help me? I have made around 10-15 accounts and NONE of them work. The page just keeps loading indefinitely and never goes anywhere. I've looked at EVERY stackoverflow post and no answers work. I started a virtualenv, downloaded Django, didn't touch the code, made migrations, I followed every tutorial TOO THE LETTER(!!!) and this is what I keep getting. The current tutorial hasn't changed in default code and he signed in with no problems. I'm assuming if he did, I can...I don't think putting code in is necessary since it's all virgin code, never touched. I didn't even make any apps yet.
I've tried deleting database and re-migrating
changing the password of current superuser
deleting the entire project and following everything the instructor said (TO THE LETTER!!!)
I have made 10-15 superuser accounts and none work
This sounds similar to a problem I was seeing. I wrote a question for it here (no answers yet): Django local dev server hangs with chrome after form submission. Works in firefox
Are you using windows and the chrome browser? Try using firefox to access the admin page and login. That worked for me. I'm still trying to figure out why Chome doesn't work, though. Like you, I created a brand new project from scratch; sometimes Chrome works and most of the time it doesn't. I've also found that hitting the stop button while the browser is sitting there thinking, then refresh, makes the logged in admin page show up.

problems with database after moving live drupal site to local site

To move my live drupal 8 site to a new local site I followed this tutorial by OS Training on YouTube. I am aware that they are doing the migration the other way around, but it shouldn't make that big a difference I guess.
They tell you to start by creating your new drupal 8 site and then moving some folders between your old site and the new one. The last step is to import your old database into the database of the new site.
I did all that but when I visit my new local drupal 8 site it first appears to show nothing until you scroll A LOT and then I'm able to get to things like my content and content types, where I see that nothing has happened. If I go check the database of the new site I see that everything is there that should be there, but I just can't get it to show up on the site itself.
I guess there's something wrong with the connection to the database, but I have no clue how to fix it. Any ideas?
-sidenote: I am using Acquia Dev Desktop to set up my local site
Compare the sites/default/settings.php file between live and local.
Make sure you have cleared all caches and rebuilt the DB. Also, check for errors using chrome developer console and write them down here.

Django Install Not Visible - No Errors

I recently did a successful Django install, and everything went as expected. No errors. But, nothing shows up. It is as if I had never installed Django.
There are no errors. Checking Django/Python versions returns as expected. From the console, I can create new projects/apps, run migrations, create users, etc. Everything seems to work. Except, when I go to mydomain.com, it just loads the old site's index.html as if Django doesn't exist.
I realize the above question isn't a good question. I figured out my problem before posting the question and decided to post my answer below with the question for future reference should others have the same issue later.
After the fruitless task of deleting and recreating my project files, I eventually figured out what happened with my Django installation. I had never enabled Passenger. On the web host in this case, DreamHost, it is just a simple checkbox in the control panel to enable, but I never did.
Other than the fact that I should have remembered I need to do enable Passenger for Django to show up, a couple things should have tipped me off. There was no tmp folder with a restart.txt file. I manually added it (that file's important), but didn't stop to think about why it wasn't there. Also, the html files were loading without being in the public folder.
That gave me an hour or so of frustration today, so I thought others might google this later and find this useful. Searching for "Django site has no errors but still doesn't work" wasn't a fruitful avenue for me.

Django Not Reflecting Changes Made to App

I've written an app and have been testing it within a project. Any change I make to the project is reflected immediately. But when I make a change to the app and run the install script again, none of the changes are shown. I even look at the files in the site-packages directory and see that the change has been installed.
I've tried clearing the browser cache, restarting the browser, trying a different browser, shutting down and restarting the django server, re-sourcing the virtual environment, setting $PYTHON_PATH, and even restarted my system to no avail.
This has happened just recently, within the past hour. I was able to make django reflect the changes when I set $PYTHON_PATH and, afterword, re-sourcing the virtual env. But now that won't work, either.
I keep thinking it's a caching issue, but I'm not seeing anything on the django cache that would cause this problem.
I'm using lighttpd as the server backend if that's an issue.
If your using google chrome:
Open your site to the page where the changes are not reflecting.
press f12 to open inspect window, the developer tool in chrome.
Now left click on the reload button for a longer duration continuously, about one second long.
You will get three options Go for empty cache and hard reload in this case.
Done!