I have uploaded 2 django projects before and worked perfectly fine to the Linode server, but now for some reason I am receiving Error for 403 Port 80 error. I have revisited a tutorial word by word and revised it several times, I am not sure why I keep receving this error:
Error for 403 Forbidden You don't have permission to access this resource. Apache/2.4.46 (Ubuntu) Server at Port 80
Here is the config file:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /static /home/ahesham/Portfolio/static
<Directory /home/ahesham/Portfolio/static>
Require all granted
</Directory>
Alias /media /home/ahesham/Portfolio/media
<Directory /home/ahesham/Portfolio/media>
Require all granted
</Directory>
<Directory /home/ahesham/Portfolio/Portfolio>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIScriptAlias / /home/ahesham/Portfolio/Portfolio/wsgi.py
WSGIDaemonProcess Portfolio python-path=/home/ahesham/Portfolio python-home=/home/ahesham/Portfolio/venv
WSGIProcessGroup Portfolio
</VirtualHost>
In the error.log
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
when i type ls -la
total 36
drwxr-x--- 5 ahesham ahesham 4096 Aug 6 23:08 .
drwxr-xr-x 3 root root 4096 Aug 5 02:30 ..
-rw------- 1 ahesham ahesham 2115 Aug 7 02:20 .bash_history
-rw-r--r-- 1 ahesham ahesham 220 Aug 5 02:30 .bash_logout
-rw-r--r-- 1 ahesham ahesham 3771 Aug 5 02:30 .bashrc
drwx------ 3 ahesham ahesham 4096 Aug 6 12:53 .cache
drwxrwxr-x 10 ahesham www-data 4096 Aug 6 20:15 Portfolio
-rw-r--r-- 1 ahesham ahesham 807 Aug 5 02:30 .profile
drwx------ 2 ahesham ahesham 4096 Aug 5 02:41 .ssh
-rw-r--r-- 1 ahesham ahesham 0 Aug 5 02:42 .sudo_as_admin_successful
when I try the project on an 8000 server it is woking perfectly fine other wise when I change the following commands: sudo ufw delete allow 8000 sudo ufw allow http/tcp sudo service apache2 restart
My question is what am I doing wrong and how to fix it?
Please let me know if there are further information required to help assist fixing it
type cd /etc/apache2/sites-available/
sudo cp 000-default.conf Portfolio.conf
and add
ServerName server_domain_name_or_IP
<Directory /var/www/html/>
AllowOverride All
</Directory>