19-07-2020

-python 3.8
-htpasswd
-modules Powershell
This commit is contained in:
2020-07-19 15:35:28 +02:00
parent b30fc7af77
commit fc437860a8
6 changed files with 204 additions and 6 deletions

View File

@@ -64,6 +64,32 @@ SUCCESS: Getting information for Domain 'maboiteverte.fr' complete.
#### Liste des extensions installées:
```bash
plesk bin extension --list
```
#### Réparer Plesk :
```bash
plesk repair installation
```
#### Réparer les permissions d'un site:
```bash
plesk repair fs example.com
```
#### Fichiers logs:
```bash
/var/www/vhosts/sur-le-sentier.fr/logs/
```
#### Ajouter l'`user` bruno au groupe `sudo`: #### Ajouter l'`user` bruno au groupe `sudo`:
```bash ```bash
@@ -84,22 +110,65 @@ service mysql restart || service mariadb restart || service mysqld restart
Liste des extensions installées: #### Liste des modules installés:
```bash ```bash
plesk bin extension --list # apache2ctl -M
Loaded Modules:
core_module (static)
so_module (static)
``` ```
Réparer Plesk : Vérifier la syntaxe du fichier de configuration:
```bash ```bash
plesk repair installation # apachectl -t
# apachectl configtest
Syntax OK
``` ```
Réparer les permissions d'un site: https://httpd.apache.org/docs/2.4/fr/programs/apachectl.html
#### Installer GeoIP:
```bash ```bash
plesk repair fs example.com apt-get install plesk-php74-dev build-essential
apt-get install libgeoip-dev geoip-bin geoip-database
/opt/plesk/php/7.4/bin/pecl install http://pecl.php.net/get/geoip-1.1.1.tgz
/opt/plesk/php/7.4/lib/php/modules/geoip.so
Add " extension=geoip.so" to php.ini file:
For PHP 7.0 modify file /opt/plesk/php/7.0/etc/php.ini
For PHP 7.1 modify file /opt/plesk/php/7.1/etc/php.ini
echo "extension=geoip.so" > /opt/plesk/php/7.4/etc/php.d/geoip.ini
/opt/plesk/php/7.4/etc/php.d# /opt/plesk/php/7.4/bin/php -m | grep geoip
<?php print_r(geoip_record_by_name('php.net')); ?>
Required database not available at /usr/share/GeoIP/GeoIPCity.dat"
Redémarrer Apache:
service apache2 restart
sinon redémarrer le serveur
```
#### Installer GeoIP 2:
```bash
wget https://github.com/maxmind/geoip-api-mod_geoip2/archive/1.2.10.tar.gz
tar -xzvf 1.2.10.tar.gz
cd geoip-api-mod_geoip2-1.2.10/
apxs -i -a -L/usr/local/lib -I/usr/local/include -lGeoIP -c mod_geoip.c
Installer dans
/usr/lib/apache2/modules/mod_geoip.so
Ne marche pas !!
``` ```

View File

@@ -0,0 +1,41 @@
https://www.powershellgallery.com
https://github.com/janikvonrotz/awesome-powershell
Liste des modules installés:
```powershell
Get-InstalledModule
Version Name Repository Description
------- ---- ---------- -----------
1.4.7 PackageManagement PSGallery PackageManagement (a.k.a. OneGet) is a new way to discover and install software packages from around the web.
1.3.1 Configuration PSGallery A module for storing and reading configuration values, with full PS Data serialization, automatic configuration fo…
2.2.4.1 PowerShellGet PSGallery PowerShell module with commands for discovering, installing, updating and publishing the PowerShell artifacts like
0.8.0 pure-pwsh PSGallery pure prompt for powershell
0.7.3 posh-git PSGallery Provides prompt with Git status summary information and tab completion for Git commands, parameters, remotes and b
1.0.0.0 PSColor PSGallery Provides basic color highlighting for files, services, select-string etc.
```
Installer un module:
```powershell
Install-Module -Name posh-git
```
Désinstaller un module:
```powershell
Uninstall-Module -Name posh-git
```

View File

@@ -46,6 +46,48 @@ $ python3 -m site --user-base
### Passage de Python 3.7 à 3.8:
Erreur avec pip3:
```bash
$ pip3 list --outdated --format columns
zsh: /usr/local/bin/pip3: bad interpreter: /usr/local/opt/python/bin/python3.7: no such file or directory
```
```bash
$ pip3 -V
zsh: /usr/local/bin/pip3: bad interpreter: /usr/local/opt/python/bin/python3.7: no such file or directory
pip 19.0.3 from /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pip (python 3.7)
```
Il faut donc mettre à jour pip3:
```bash
$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1825k 100 1825k 0 0 2692k 0 --:--:-- --:--:-- --:--:-- 2688k
$ python3 get-pip.py
Collecting pip
Using cached pip-20.1.1-py2.py3-none-any.whl (1.5 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.0.2
Uninstalling pip-20.0.2:
Successfully uninstalled pip-20.0.2
Successfully installed pip-20.1.1
```
```bash
$ pip3 -V
pip 20.1.1 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
```
### idle: ### idle:
**idle** est l'éditeur par défaut de Python **idle** est l'éditeur par défaut de Python

View File

@@ -385,6 +385,14 @@ $ sudo apachectl stop
$ sudo apachectl start $ sudo apachectl start
``` ```
Pour connaître la configuration dans httpd.conf, lancez `mod_wsgi-express module-config`
```bash
$ mod_wsgi-express module-config
LoadModule wsgi_module "/usr/local/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.cpython-38-darwin.so"
WSGIPythonHome "/usr/local/Cellar/python@3.8/3.8.3_2/Frameworks/Python.framework/Versions/3.8"
```
### Liens: ### Liens:

View File

@@ -0,0 +1,36 @@
# Protéger l'accès à une page par un mot-de-passe
https://www.it-connect.fr/securiser-les-authentifications-htaccess-avec-loption-digest%EF%BB%BF/
On utilise 2 fichiers (.htaccess et .htpasswd):
### .htaccess
Il est à placer dans le dossier à protéger.
https://httpd.apache.org/docs/current/fr/howto/htaccess.html
chmod 755
```http
AuthType Basic
AuthName "Protected Site"
AuthUserFile /Users/bruno/Sites/.htpasswd
require valid-user
```
### .htpasswd
On peut le placer n'importe où.
Il contient les paires d'identifiants / mots de passe
```http
bruno:$2y$10$eoOcCeh6lKR.yLc7B44bD.9AAGI90XyYaXZrSbzdswKuL6Q5E9oX2
```
http://www.htaccesstools.com/htpasswd-generator

View File

@@ -16,3 +16,5 @@
[Xhprof](Xhprof.md) [Xhprof](Xhprof.md)
[Protéger l'accès à une page](htpasswd.md)