ubuntu django and apache, cannot find the site - django

I am brand new to web app development and thought I would try django as I am familiar with python. I followed the following guide: http://www.lennu.net/2012/05/14/django-deployement-installation-to-ubuntu-12-dot-04-server/ to deploy a django page to the letter. However, I now realize that this guide was for the server version of the OD and i'm running the desktop version. When I try to open my site in chrome (amitash.r) it fails with a page not found. Now when I open localhost, I get an internal server 500 error. All my config files are exactly as stated in the guide. Any fixes?

Can you post your mod_wsgi script and Apache VirtualHost file?
Following the instructions from the link you gave, the mod_wsgi script should be in:
/srv/my_project/app/conf/apache/django.wsgi
The VirtualHost file location from the link should be:
/etc/apache2/sites-available/DOMAIN
Make sure you enabled your site. If you named your file DOMAIN, like the instructions, you should enable the site using:
a2ensite DOMAIN

Related

/opt/alt/python39/bin/lswsgi: No such file or directory

I have a shared Cpanel host with the Litespeed web server. I want to deploy a Django application on it. After creating a Python application inside the Cpanel where I have not deployed the application on the host I try loading the website, and instead of displaying the Django version, I face 503 Unavailable!!
Also inside the "stderr.log" file, there is the following error.
/usr/local/lsws/fcgi-bin/lswsgi_wrapper: line 9: /opt/alt/python39/bin/lswsgi: No such file or directory
I'm creating the application with Python 3.9.
But it works when I create it with Python 3.8 and show the following message when I load the web,
It works!
Python 3.8.6
The issue is mostly caused by the lack of the Python 3.9 WSGI package. On out-of-date versions of LiteSpeed, the package needs to be installed manually.
To work around this, first ensure that LiteSpeed is up to date. LiteSpeed must be at version 5.4.10 for this to work. Once that is confirmed, execute the following script from LiteSpeed. It will pull the required Python Selector packages:
/usr/local/lsws/admin/misc/enable_ruby_python_selector.sh
Refer cpanel support

404 not found after installed cyberpanal

I try to install cyberpanal in digitalocean droplet, but it does not install successfully.
After that when i visited my website a '404 not found' default page from LiteSpeed is shown. Also the Apache is not running
Sample Image
If you have an issue with installing the CyberPanel, please consider launching a CyberPanel from the marketplace directly. It should be much easier for you to setup a server.
CyberPanel uses OpenLiteSpeed as a default web server, so you should not expect an Apache run by default.
Before visiting the page, did you create a website on the control panel yet? If not, then a returned 404 status code is expected.
More, https://cyberpanel.net/docs/2-creating-website/
If you have more question for CyberPanel, I'd recommend you ask in their forum https://community.cyberpanel.net/

Running django with mod_python on a shared apache server

I'm in a university and I'm provided with a public_html folder where I can put my CGI scripts. For eg. when I put PHP scripts and visit them from my browser, it works correctly and the PHP is properly interpreted.
I wish to run Django apps in this environment and I know that the university runs an apache server and had mod_php and mod_python installed, although I think I'm not allowed to modify the httpd.conf etc.
All the tutorials that I've read about Django on mod_python ask me to modify the httpd.conf, is there any way I can get my Django site running by making non-sudo changes only?
You can try to put your directives in a .htaccess file in your directory. Dependent on the server config, it might work.

Deploying Django in Apache server

I finished my project in the development server and now I worked it using Apache in the localhost. The project worked good. Now, I got an apache sever. can you please clarify some of my doubts;
1. Need to upload the Django installation files, mod_wsgi and any other files to the server?
2. Can I maintain the same folder directory as I did with the local host Apache?
3. what is httpd.conf, and where can I find it in my server?
I am using Linux ubuntu OS, Python 2.7, Django 1.6 and my server got its first level of directories like:
.cpanel, .htpasswords, cpmove.psql, etc, logs, mail, public_ftp, ssl, tmp, www, access-logs and some more .conf and other type files.
Among above directories, I can't open the www folder.
Please suggest any tutorial or some other way to resolve things. It will be very helpful for me and my team.
Thanks in advance

how to restart single apache site on a ubuntu vps rather than all sites

I've got a ubuntu vps and apache mod wsgi installed and serving my django sites.
however i have to restart all of apache rather than the site i have amended and its going to be a bit shonky if i tell clients that i have restarted their site cos i updated another site.
is there a tutorial somewhere to teach me how to configure this? i couldnt find one in googles keywords soup.
I'm already using virtualenvs if it helps.
Assuming you use mod_wsgi in daemon mode on UNIX/Apache 2.X system to run Django and have shell access to your machine all you need to do is touch the wsgi configuration for your project.
touch your_project.wsgi
See mod_wsgi documentation on Reloading Source Code and Django - mod_wsgi wiki for more references.