Skip to content

Instantly share code, notes, and snippets.

View meetsohail's full-sized avatar
💻
Focusing

Sohail Ahmed meetsohail

💻
Focusing
View GitHub Profile
@meetsohail
meetsohail / .htaccess
Created December 3, 2021 20:10
Run Laravel project on cPanel shared hosting?
# add to .htaccess root
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^$ public/index.php [L]
RewriteRule ^((?!public/).*)$ public/$1 [L,NC]
</IfModule>
@meetsohail
meetsohail / .htaccess
Created December 3, 2021 20:04
Laravel www to non-www redirect using .htaccess
# Redirect www to non-www
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
@meetsohail
meetsohail / gunicorn_django.service
Last active December 3, 2021 20:13
Gunicorn Configuration with Django
# Paste this service file in
# /etc/systemd/system
[Service]
User=user_name
Group=group_name
EnvironmentFile=/home/vars.ini
WorkingDirectory=/home/path_to_django_root_dir
Environment="PATH=/home/path_to_virtual_env_dir/bin"
Restart=always
@meetsohail
meetsohail / celery_django.service
Last active December 3, 2021 20:12
Celery Configuration with Django
# Paste this service file in
# /etc/systemd/system
[Service]
User=username
Group=groupname
EnvironmentFile=/home/vars.ini
WorkingDirectory=/home/path_to_django_root
Environment="PATH=/home/path_to_virtual_enviornment_dir/env/bin"
Restart=always