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
AddDefaultCharset UTF-8 | |
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresDefault "access 7 days" | |
ExpiresByType application/javascript "access plus 1 year" | |
ExpiresByType text/javascript "access plus 1 year" | |
ExpiresByType text/css "access plus 1 year" | |
ExpiresByType text/html "access plus 7 day" | |
ExpiresByType text/x-javascript "access 1 year" |
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
При переносе сайта возникла ошибка smtp все было настроено но поста не отправляется, похожие ошибки можно найти "Обновился до PHP 7, не уходит почта с FormIt " | |
[2016-04-30 21:40:10] (ERROR @ /var/www/web1/www/core/model/modx/mail/phpmailer/class.smtp.php : 343) PHP warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: | |
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed | |
[2016-04-30 21:40:10] (ERROR @ /var/www/web1/www/core/components/formit/model/formit/fihooks.class.php : 552) [FormIt] Произошла ошибка при попытке отправить почту. Ошибка соединения с SMTP-сервером https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting | |
Решение заняло 2 дня но оказалось очень простым | |
apt-get install --reinstall ca-certificates |
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
Соддаем пользователя deploy | |
sudo adduser deploy | |
Генерируем ключ | |
ssh-keygen -t rsa | |
Посмотреть ключ | |
cat ~/.ssh/id_rsa.pub | |
sudo apt-get update | |
sudo apt-get upgrade |
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
sudo apt-get update | |
sudo apt-get upgrade | |
Установка программ | |
sudo apt install apache2 mysql-server mysql-client vsftpd ssh mc git | |
Настройка php | |
Включаем php в виде модуля апачи: | |
sudo apt install php7.0 libapache2-mod-php7.0 | |
sudo a2enmod rewrite |
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
Обновляем Софт | |
sudo apt-get update | |
Ставим Apache2 | |
apt-get install apache2 | |
Настроим Apache2 | |
nano /etc/apache2/apache2.conf | |
## Фиксим предупреждения при перезапуске Apache | |
ServerName localhost |
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. Нужно найти все коммиты, которые изменяли файл: | |
git log --pretty=oneline --branches -- BIGFILE.ZIP | |
2.1 Удалить ссылки на файл из всей истории коммитов, начиная с последнего (пусть, хеш последнего коммита - 6df7640): | |
git filter-branch --index-filter 'git rm --cached BIGFILE.ZIP --ignore-unmatch' --prune-empty --tag-name-filter cat -- --all | |
2.2 Удалить ссылки на каталог из истории коммитов: | |
git filter-branch --force --index-filter 'git rm -r --cached --ignore-unmatch BIG/DIR' --prune-empty --tag-name-filter cat -- --all | |
3. Отправляем изменения на сервер: |
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
<form method="post" onkeypress="if(event.keyCode == 13) return false;"> | |
</form> |
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
// Все элементы класса .social_share считаем кнопками шаринга | |
$(document).on('click', '.social_share', function(){ | |
Share.go(this); | |
}); |
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
<?php | |
if ($modx->event->name == 'OnWebPageInit') { | |
// Получаем ресурс | |
if (!is_object($modx->resource)) { | |
$modx->resource = $modx->request->getResource($modx->resourceMethod, $modx->resourceIdentifier); | |
} | |
} |
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
<?php | |
/** @var modX $modx */ | |
switch ($modx->event->name) { | |
case 'msOnChangeOrderStatus': | |
// Update customer stat | |
if ($status = $modx->getObject('msOrderStatus', array('id' => $status, 'active' => 1))) { | |
if ($miniShop2 = $modx->getService('miniShop2')) { | |
$miniShop2->initialize($modx->context->key, array( |