Help, I hosed my Apache

I had everything running the way I wanted. I have two sites that are running a django/wagtail site. So I created 3 sites for each domain. The media site and the static site where plain jane html static sites.

The were working fine using virtual hosts. Then I ran the letsencrypt certbot to get certs and ssl for the sites. The first night it ran fine, but the next day all the sites were throwing 500 errors.

I figured it had something to do with setting up the auto renew on the certs so I removed that from my crontab. I removed all the redirects on the ssl so I could step back and get it up and running again, but now everytime I enable a site, it seems to mask all the other sites. It's like virtual hosting is not working.

Here are my sites:

http://medinadiversityproject.org
http://static.medinadiversityproject.org
http://media.medinadiversityproject.org

http://dianarice.art
http://static.dianarice.art
http://media.dianarice.art

Example of my virtual host file:

<VirtualHost *:80>
  # Admin email, Server Name (domain name), and any aliases
  ServerAdmin bradrice1@gmail.com
  ServerName  media.medinadiversityproject.org

  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html index.php
  DocumentRoot /var/www/html/media.medinadiversityproject.org/public_html
  # Log file locations
  LogLevel warn
  ErrorLog  /var/www/html/media.medinadiversityproject.org/logs/error.log
  CustomLog /var/www/html/media.medinadiversityproject.org/logs/access.log combined
<Directory /var/www/html/media.medinadiversityproject.org>
     Order Allow,Deny
     Allow from all
     AllowOverride all
     Header set Access-Control-Allow-Origin "*"
</Directory>
</VirtualHost>

4 Replies

Hello,

I am only able to observe one website configured in your provided virtualhost file. This is likely the reason that your other domains aren't populating even with errors. This guide can help you set up your virtualhost file to serve multiple websites again.

When I visit your configured domain (medinadiversityproject.org) in my browser, I can observe some errors that provide a good indication of places to look to resolve this:

Exception Type: OperationalError
Exception Value:
no such column: home_homepage.banner_title
Exception Location: /usr/local/venvs/medinadiversityproject-env/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py in execute, line 383
Python Executable: /usr/local/venvs/medinadiversityproject-env/bin/python

You can review the exact information indicated in this error with the following:

$ vi +383 /usr/local/venvs/medinadiversityproject-env/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py

If you are still aiming to have SSL certificates installed and set to auto-renew for all of your websites, this community post offers guidance on getting that set up.

I hope that helps! If you use these troubleshooting steps and are still having issues, we encourage you to post additional information.

I was rebuilding the site. I completely rebuilt. However, I can get both sites running if I have the sites set to debug=True, but when I try to put them into production with debug=False, only one of the two wsgi sites will serve. I get a django not found error or a project not found error.

https://medinadiversityproject.org

and

https://dianarice.art

The second site is picking up the settings from the first site instead of it's own.

They both run in a virtual environment with their own django install.

I just don't get it.

All fixed. Django/Wagtail has pretty serious requirements for running in Production. Collectstatic was the main issue, and I had copied some files into my static manually.

Nice @bradrice! We're glad to hear you got this sorted out.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct