This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.postgresql_psycopg2', | |
'NAME': 'firstproject', | |
'USER': 'salan2000', | |
'PASSWORD': 'Mara12Fet', | |
'HOST': 'localhost', | |
'PORT': '5432' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.Узнаем версию pip и обновляем | |
python -m pip install --upgrade pip | |
2.Подключаем postgresql | |
************************************************* | |
DATABASES = { | |
'default': { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deploying Django website to VPS with uWSGI, Nginx and Ubuntu 18.04 | |
1. | |
# creating new user | |
adduser userdir | |
# providing superuser rights | |
usermod -aG sudo userdir |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Авторизация_по_ключу_для_пользователя | |
mkdir -p /home/awsnrusl/.ssh | |
ssh-keygen -t rsa -b 1024 -f /home/awsnrusl/.ssh/id_rsa | |
cd /home/awsnrusl/.ssh/ | |
конвертируем ключ в формат openssh: | |
# ssh-keygen -i -f id_rsa_pub >> authorized_keys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Postgresql_командная_строка |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Развертывание на vps Django с Postgres, Nginx, и Gunicorn на Ubuntu 18.04 | |
**************************************************************** | |
1.Создаем пользователя с предоставлением рут прав: | |
adduser awsnrusl | |
usermod -aG sudo awsnrusl | |
проверяем: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd /home/bollabor/public_html | |
wget http://wordpress.org/latest.tar.gz | |
tar -xzvf latest.tar.gz | |
cd wordpress | |
mv * .. | |
cd .. | |
rm latest.tar.gz | |
rm readme.html | |
rm -Rf wordpress |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Просмотр: | |
Второй параметр количество команд для вывода: | |
history 20 | |
Вывод нужной команды: | |
!234 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Установка и настройка hostname | |
1. На первом этапе войдите в систему с правами root и убедитесь, что ваша система Debian обновлена до последний версий пакетов установленных программ, а также установлены все исправления безопасности с помощью следующей команды: | |
# apt-get update | |
# apt-get upgrade | |
2. На следующем этапе установите пакеты, которые будут использоваться для администрирования системы: | |
# apt-get install curl net-tools bash-completion wget lsof nano | |
3. Затем откройте файл /etc/host.conf для редактирования в своем любимом текстовом редакторе и добавьте приведенную ниже строку в начале файла, чтобы разрешить DNS сначала читать файл hosts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Laravel и SSL. | |
Запросы HTTPS | |
Настройка фреймворка для работы с сертификатом SSL | |
Laravel может легко и бытро адаптироваться к установке SSL на сайт. | |
Для настройки фреймворка необходимо внести всего одну строку кода в файл |