Installatie webserver (2021): verschil tussen versies
(92 tussenliggende versies door dezelfde gebruiker niet weergegeven) | |||
Regel 1: | Regel 1: | ||
− | Tijd voor een nieuwe VPS! Zie [[Installatie webserver (2018)]] voor de laatste installatie hiervoor. Dit artikel is daarop gebaseerd. | + | Tijd voor een nieuwe TransIP-VPS! Zie [[Installatie webserver (2018)]] voor de laatste installatie hiervoor. Dit artikel is daarop gebaseerd. Deze server is in september 2021 opgeleverd. |
== Server-specs == | == Server-specs == | ||
'''Laatste server''' | '''Laatste server''' | ||
− | |||
− | |||
* TransIP-pakket X16 | * TransIP-pakket X16 | ||
Regel 14: | Regel 12: | ||
'''Nieuwe server''' | '''Nieuwe server''' | ||
− | TransIP C-range-pakket: Die schalen net iets verder | + | TransIP C-range-pakket: Die schalen net iets verder dan VPS'en uit het X-range-pakket. Het wordt het instappakket ''C2'': Dan kan ik bij upgraden hopelijk het verschil meten in performance: |
+ | * TransIP pakket ''C2'' | ||
* 2 dedicated vCPU's | * 2 dedicated vCPU's | ||
* 4 GB RAM | * 4 GB RAM | ||
Regel 21: | Regel 20: | ||
* OS: Ubuntu 20.04 LTS, met ondersteuning tot april 2025 | * OS: Ubuntu 20.04 LTS, met ondersteuning tot april 2025 | ||
− | == Basis | + | '''Upgrade''' |
+ | |||
+ | In feb. 2022 zijn de specs van deze server verdubbeld. Ik vermoed dat ik tussendoor ook al een keer de specs heb verdubbeld, maar dat lijk ik hier niet te hebben vermeld: | ||
+ | |||
+ | * TransIP pakket ''C8'' | ||
+ | * 8 cores ('8 dedicated vCPU's') | ||
+ | * 16 GB RAM (16.385MB) | ||
+ | * Opslag: 400GB NVMe | ||
+ | |||
+ | Sites waren 30% sneller na deze upgrade. | ||
+ | |||
+ | == Basis == | ||
− | === Alias | + | === Werkstation: Alias === |
− | + | Alias toevoegen aan <code>.bashrc</code>: | |
<code> | <code> | ||
alias dvb8="ssh 123.134.156.78" | alias dvb8="ssh 123.134.156.78" | ||
+ | </code> | ||
+ | |||
+ | Deze gebruik ik om met Bash te kunnen inloggen met alleen <code>dvb8</code>. | ||
+ | |||
+ | === Werkstation: DNS-entry === | ||
+ | |||
+ | Ik heb een verwijzing naar deze server nodig in <code>/etc/hosts</code>: | ||
+ | |||
+ | <code> | ||
+ | 123.134.156.78 dvb8 | ||
+ | </code> | ||
+ | |||
+ | Hier maak ik gebruik van, als ik bestanden wil kopiëren via Bash. Bv.: | ||
+ | |||
+ | <code> | ||
+ | rsync ~/Desktop/test.tmp dvb8: | ||
</code> | </code> | ||
Regel 37: | Regel 63: | ||
=== Wachtwoord instellen === | === Wachtwoord instellen === | ||
− | Omdat TransIP de installatie van het OS | + | Omdat TransIP de installatie van het OS verzorgt, kreeg ik niet de gelegenheid om een wachtwoord in te stellen voor het root-account. Dat gaat pas na inloggen (via ssh): |
<code> | <code> | ||
sudo passwd jeroen | sudo passwd jeroen | ||
</code> | </code> | ||
+ | |||
+ | === Disable root-account === | ||
+ | |||
+ | Account <code>root</code> is actief. Dat vind ik niet handig. Verwijderen lijkt me iets te veel van het goede. Daarom uitzetten: | ||
+ | |||
+ | * <code>sudo vim /etc/passwd</code> | ||
+ | * Verander regel <code>root:x:0:0:root:/root:/bin/bash</code> in <code>root:x:0:0:root:/root:/sbin/nologin</code>. | ||
+ | |||
+ | Als ik nu probeer in te loggen: | ||
+ | |||
+ | <pre> | ||
+ | $ su root | ||
+ | Password: | ||
+ | This account is currently not available. | ||
+ | </pre> | ||
+ | |||
+ | === Hostnaam aanpassen === | ||
+ | |||
+ | Deze server heet ''Ubuntu''. Daar wil ik ''dvb8'' van maken: | ||
+ | |||
+ | * <code>sudo hostname dvb8</code> | ||
+ | * <code>sudo vim /etc/hostname</code> | ||
+ | * <code>sudo vim /etc/hosts</code> - Bleek niet nodig te zijn. | ||
=== Time zone instellen === | === Time zone instellen === | ||
Regel 55: | Regel 104: | ||
Deze bleek niet correct te zijn ingesteld. Nav. de routine kreeg ik deze melding: | Deze bleek niet correct te zijn ingesteld. Nav. de routine kreeg ik deze melding: | ||
− | < | + | <pre> |
Current default time zone: 'Europe/Amsterdam' | Current default time zone: 'Europe/Amsterdam' | ||
Local time is now: Fri Sep 17 17:44:13 CEST 2021. | Local time is now: Fri Sep 17 17:44:13 CEST 2021. | ||
Universal Time is now: Fri Sep 17 15:44:13 UTC 2021. | Universal Time is now: Fri Sep 17 15:44:13 UTC 2021. | ||
− | </ | + | </pre> |
=== Firewall === | === Firewall === | ||
Regel 79: | Regel 128: | ||
=== IPv6 === | === IPv6 === | ||
− | Ik ben nog niet thuis in configuratie van IPv6. | + | Ik ben nog steeds niet thuis in configuratie van IPv6. Simpele oplossing: Niet gebruiken! Cloudways heeft dat ook niet op z'n servers, dus kan ik ook wel zonder. |
=== Locale === | === Locale === | ||
Regel 104: | Regel 153: | ||
LC_ALL= | LC_ALL= | ||
</pre> | </pre> | ||
+ | |||
+ | === .bash_aliases === | ||
+ | |||
+ | VOLGENDE KEER GEWOON WEER .BASHRC GEBRUIKEN - WANT ZO WERKEN M'N SCRIPTS | ||
+ | |||
+ | Verschil tussen diverse bestanden [https://www.golinuxcloud.com/bashrc-vs-bash-profile/]: | ||
+ | |||
+ | * <code>.bashrc</code>: Wordt uitgevoerd bij alle shell-aanroepen. Dus ook als je scripts met een [[Shebang | shebang]] aanroept | ||
+ | * <code>.bash_aliases</code>: Optioneel bestand om je aliassen in onder te brengen. Dit is voor het eerste dat ik hier gebruik van maak: Storingen in <code>.bashrc</code> zijn niet handig | ||
+ | * <code>.profile</code>: Wordt alleen uitgevoerd tijdens ''interactive shells'', dus wanneer je als gebruiker een terminal opent. Ik ''geloof'' dat dit de plek is om PATH eventueel aan te passen. | ||
+ | |||
+ | Mijn toevoegingen aan <code>.bash_aliases</code>: | ||
+ | |||
+ | <pre> | ||
+ | ########################################################################################## | ||
+ | # Additions - Strompf | ||
+ | ########################################################################################## | ||
+ | # | ||
+ | # | ||
+ | # Aliases - General | ||
+ | ########################################################### | ||
+ | # | ||
+ | alias scripts="cd /usr/local/bin" | ||
+ | alias www="cd /var/www" | ||
+ | alias wwwls="ls /var/www" | ||
+ | alias pss="ps -aux" | ||
+ | |||
+ | |||
+ | # Aliases - Apache | ||
+ | ########################################################### | ||
+ | # | ||
+ | # I use these quite a bit | ||
+ | # | ||
+ | alias a2re="sudo service apache2 reload" | ||
+ | alias a2s="apachectl -S" | ||
+ | alias a2dis="sudo a2dissite" | ||
+ | alias a2en="sudo a2ensite" | ||
+ | |||
+ | |||
+ | # Aliases - Hosted sites | ||
+ | ########################################################### | ||
+ | # | ||
+ | # None yet, of course | ||
+ | </pre> | ||
+ | |||
+ | === .profile === | ||
+ | |||
+ | Ik vind het handig als na inloggen de inhoud van map <code>/var/www</code> wordt getoond. Daarom deze toevoeging aan <code>.profile</code>: | ||
+ | |||
+ | <pre> | ||
+ | ################################################################################ | ||
+ | # Additions - Jeroen | ||
+ | ################################################################################ | ||
+ | # | ||
+ | # | ||
+ | # Update PATH | ||
+ | ################################################## | ||
+ | # | ||
+ | # * Do this in .profile or in .bashrc? | ||
+ | # * Note that "/use/local/bin" is already included in PATH | ||
+ | # * "/opt": Handmatig geïnstalleerde programmatuur (bv. wp-cli) | ||
+ | # | ||
+ | PATH=$PATH:/opt | ||
+ | |||
+ | |||
+ | # Display hosted sites | ||
+ | ################################################## | ||
+ | # | ||
+ | echo " " | ||
+ | echo "ls /var/www" | ||
+ | ls /var/www | ||
+ | echo " " | ||
+ | </pre> | ||
+ | |||
+ | === sudo timeout === | ||
+ | |||
+ | Zie [[Sudo]] voor het aanpassen van de ''sudo timeout'' - Graag! | ||
+ | |||
+ | === Backup-time! === | ||
+ | |||
+ | Juhu! De basis is op orde. Goed moment voor een backup (via TransIP-console) en dan de applicaties. | ||
+ | |||
+ | === Eigen scripts === | ||
+ | |||
+ | Locatie voor eigen schripts is als vanouds <code>/usr/local/bin</code>. | ||
+ | |||
+ | Rechten aanpassen: | ||
+ | |||
+ | <pre> | ||
+ | sudo chown jeroen /usr/local/bin | ||
+ | sudo chgrp jeroen /usr/local/bin | ||
+ | </pre> | ||
+ | |||
+ | Het gaat om deze scripts: | ||
+ | |||
+ | * <code>add_db</code> | ||
+ | * <code>add_domain</code> | ||
+ | * <code>reboot_server_tonight</code> | ||
+ | * <code>update_all_dvb8</code>. | ||
+ | |||
+ | Daarnaast heb ik op m'n meest recentelijke server een hoop WordPress-gerelateerde scripts staan. Ik neem daarvan alleen dingen over indien nodig. | ||
+ | |||
+ | === Bookmark Nautilus === | ||
+ | |||
+ | Om een bookmark voor deze server aan te maken op Nautilus: | ||
+ | |||
+ | * File » Connect to Server... | ||
+ | * Server: IP-adres van de server | ||
+ | * Folder: /home/strompf | ||
+ | * User Details leeg laten | ||
+ | * Connect... | ||
+ | * Nadat de folder is getoond: Maak een bookmark aan en hernoem deze naar <code>dvb8</code>. | ||
+ | |||
+ | == Apache == | ||
+ | |||
+ | * Rechtenbeheer anders dan in het verleden: Dat was veel te ingewikkeld en onpractisch - Meer info volgt | ||
+ | * Eén centraal logbestand | ||
+ | |||
+ | === Installatie === | ||
+ | |||
+ | 'Handmatige' installatie ipv. gebruik Tasksel: | ||
+ | |||
+ | <pre> | ||
+ | $ sudo apt install apache2 | ||
+ | |||
+ | Reading package lists... Done | ||
+ | Building dependency tree | ||
+ | Reading state information... Done | ||
+ | The following additional packages will be installed: | ||
+ | apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libjansson4 | ||
+ | liblua5.2-0 ssl-cert | ||
+ | Suggested packages: | ||
+ | apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser openssl-blacklist | ||
+ | The following NEW packages will be installed: | ||
+ | apache2 apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap | ||
+ | libjansson4 liblua5.2-0 ssl-cert | ||
+ | 0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded. | ||
+ | Need to get 1865 kB of archives. | ||
+ | After this operation, 8083 kB of additional disk space will be used. | ||
+ | </pre> | ||
+ | |||
+ | === ServerName === | ||
+ | |||
+ | Met ''ServerName'' bedoelt Apache de complete URL. Die kun je achterhalen met bv. ''reverse DNS-lookup''. De default-servernamen van TransIP zijn zoiets als: | ||
+ | |||
+ | <code> | ||
+ | 123-156-189-201.colo.transip.net | ||
+ | </code> | ||
+ | |||
+ | Als je deze intikt in een browser, krijg je als het goed is gelijk al de vangpagina van Apache. Ook als je verder nog nix hebt geconfigureerd. | ||
+ | |||
+ | === apache2.conf === | ||
+ | |||
+ | Toevoegingen configuratiebestand <code>/etc/apache2/apache2.conf</code> - Ik moet weer 's uitzoeken wat dit precies betekent: | ||
+ | |||
+ | <pre> | ||
+ | ################################################################################ | ||
+ | # Updates - Jeroen | ||
+ | ################################################################################ | ||
+ | # | ||
+ | # | ||
+ | # ServerName | ||
+ | ######################################## | ||
+ | # | ||
+ | # * Use TransIP domain name | ||
+ | # * http://wiki.devliegendebrigade.nl/Could_not_reliably_determine_..._domain_name_(Apache) | ||
+ | # | ||
+ | # | ||
+ | ServerName 123-156-189-201-.colo.transip.net | ||
+ | |||
+ | |||
+ | # Make directories non-browseable | ||
+ | ######################################## | ||
+ | # | ||
+ | # * Important! | ||
+ | # * http://wiki.devliegendebrigade.nl/Apache_-_Mappen_niet_browsable_maken | ||
+ | # | ||
+ | <Directory /var/www/> | ||
+ | Options FollowSymLinks | ||
+ | AllowOverride All | ||
+ | Require all granted | ||
+ | </Directory> | ||
+ | |||
+ | |||
+ | # KeepAlive Directive | ||
+ | ######################################## | ||
+ | # | ||
+ | # Actually already active by default | ||
+ | # | ||
+ | # See also: | ||
+ | # | ||
+ | # * https://httpd.apache.org/docs/2.4/mod/core.html#keepalive and | ||
+ | # * https://www.linode.com/docs/guides/how-to-install-a-lamp-stack-on-ubuntu-20-04/ | ||
+ | # * http://wiki.devliegendebrigade.nl/Installatie_webserver#Apache | ||
+ | # | ||
+ | KeepAlive on | ||
+ | MaxKeepAliveRequests 50 | ||
+ | KeepAliveTimeout 5 | ||
+ | </pre> | ||
+ | |||
+ | === mpm_prefork.conf === | ||
+ | |||
+ | [https://www.linode.com/docs/guides/how-to-install-a-lamp-stack-on-ubuntu-20-04/]: | ||
+ | |||
+ | <code>/etc/apache2/mods-available/mpm_prefork.conf</code> aangepast. Dit is nu het hele bestand: | ||
+ | |||
+ | <pre> | ||
+ | # prefork MPM | ||
+ | # StartServers: number of server processes to start | ||
+ | # MinSpareServers: minimum number of server processes which are kept spare | ||
+ | # MaxSpareServers: maximum number of server processes which are kept spare | ||
+ | # MaxRequestWorkers: maximum number of server processes allowed to start | ||
+ | # MaxConnectionsPerChild: maximum number of requests a server process serves | ||
+ | # | ||
+ | # <IfModule mpm_prefork_module> | ||
+ | # StartServers 5 | ||
+ | # MinSpareServers 5 | ||
+ | # MaxSpareServers 10 | ||
+ | # MaxRequestWorkers 150 | ||
+ | # MaxConnectionsPerChild 0 | ||
+ | # </IfModule> | ||
+ | # | ||
+ | # vim: syntax=apache ts=4 sw=4 sts=4 sr noet | ||
+ | |||
+ | |||
+ | ################################################################################ | ||
+ | # Updates - Strompf - 2021.09 | ||
+ | ################################################################################ | ||
+ | # | ||
+ | # * Optimized for 4GB internal memory | ||
+ | # * Source: https://www.linode.com/docs/web-servers/lamp/install-lamp-stack-on-ubuntu-16-04 | ||
+ | # * These settings might need to be reviewed | ||
+ | # | ||
+ | # | ||
+ | <IfModule mpm_prefork_module> | ||
+ | StartServers 8 | ||
+ | MinSpareServers 6 | ||
+ | MaxSpareServers 40 | ||
+ | MaxRequestWorkers 200 | ||
+ | MaxConnectionsPerChild 10000 | ||
+ | </IfModule> | ||
+ | </pre> | ||
+ | |||
+ | === Modules === | ||
+ | |||
+ | Er zijn twee modules die ik vrijwel altijd gebruik. Wonderlijk dat die dingen zoveel verschillende namen hebben: | ||
+ | |||
+ | <pre> | ||
+ | Naam ls | ||
+ | Naam /usr/lib/ Naam | ||
+ | apachectl -M apache2/modules a2enmod | ||
+ | -------------- --------------- ------- | ||
+ | rewrite_module mod_rewrite rewrite | ||
+ | ssl_module mod_ssl ssl | ||
+ | </pre> | ||
+ | |||
+ | Daarnaast <code>mpm_event</code> uitzetten en <code>mpm_prefort</code> aanzetten (zeggen ze). Bij elkaar (waarbij <code>a2re</code> een eigen alias is om Apache te herstarten): | ||
+ | |||
+ | <pre> | ||
+ | sudo a2dismod mpm_event | ||
+ | sudo a2enmod mpm_prefork | ||
+ | sudo a2enmod rewrite | ||
+ | a2re | ||
+ | </pre> | ||
+ | |||
+ | == MariaDB == | ||
+ | |||
+ | Spannend! Overstappen van MySQL naar MariaDB: | ||
+ | |||
+ | === Installatie === | ||
+ | |||
+ | <pre> | ||
+ | sudo apt install mariadb-server | ||
+ | Reading package lists... Done | ||
+ | Building dependency tree | ||
+ | Reading state information... Done | ||
+ | The following additional packages will be installed: | ||
+ | galera-3 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl | ||
+ | libencode-locale-perl libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl | ||
+ | libhttp-message-perl libio-html-perl liblwp-mediatypes-perl libmysqlclient21 libsnappy1v5 libterm-readkey-perl | ||
+ | libtimedate-perl liburi-perl mariadb-client-10.3 mariadb-client-core-10.3 mariadb-common mariadb-server-10.3 | ||
+ | mariadb-server-core-10.3 mysql-common socat | ||
+ | Suggested packages: | ||
+ | libclone-perl libmldbm-perl libnet-daemon-perl libsql-statement-perl libdata-dump-perl libipc-sharedcache-perl | ||
+ | libwww-perl mailx mariadb-test tinyca | ||
+ | The following NEW packages will be installed: | ||
+ | galera-3 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl | ||
+ | libencode-locale-perl libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl | ||
+ | libhttp-message-perl libio-html-perl liblwp-mediatypes-perl libmysqlclient21 libsnappy1v5 libterm-readkey-perl | ||
+ | libtimedate-perl liburi-perl mariadb-client-10.3 mariadb-client-core-10.3 mariadb-common mariadb-server | ||
+ | mariadb-server-10.3 mariadb-server-core-10.3 mysql-common socat | ||
+ | 0 upgraded, 28 newly installed, 0 to remove and 0 not upgraded. | ||
+ | Need to get 21.2 MB of archives. | ||
+ | After this operation, 173 MB of additional disk space will be used. | ||
+ | </pre> | ||
+ | |||
+ | === Secure installation === | ||
+ | |||
+ | <code> | ||
+ | sudo mysql_secure_installation | ||
+ | </code> | ||
+ | |||
+ | === Beheeraccount === | ||
+ | |||
+ | Er lijkt nog altijd iets raars te zijn met MySQL/MariaDB, dat zo lang er alleen maar een root-account is, je alleen kunt inloggen met | ||
+ | |||
+ | <code> | ||
+ | sudo mariadb | ||
+ | </code> | ||
+ | |||
+ | Vervolgens eigen beheeraccount aangemaakt: | ||
+ | |||
+ | <pre> | ||
+ | create user jeroen@localhost identified by 'MijnWachtwoord'; | ||
+ | grant all on *.* to jeroen@localhost with grant option; | ||
+ | </pre> | ||
+ | |||
+ | === .my.cnf === | ||
+ | |||
+ | Inhoud (licht aangepast): | ||
+ | |||
+ | <pre> | ||
+ | # | ||
+ | ################################################################################ | ||
+ | [client] | ||
+ | ################################################################################ | ||
+ | # | ||
+ | host = localhost | ||
+ | user = jeroen | ||
+ | password = MijnWachtwoord | ||
+ | socket = /var/run/mysqld/mysqld.sock | ||
+ | comments = true | ||
+ | |||
+ | ################################################################################ | ||
+ | [mysqldump] | ||
+ | ################################################################################ | ||
+ | # | ||
+ | # | ||
+ | # Include sprocs & functions when making dumps | ||
+ | ############################################## | ||
+ | # | ||
+ | routines = true | ||
+ | |||
+ | |||
+ | # Continue with dump despite errors in views | ||
+ | ############################################## | ||
+ | # | ||
+ | force = true | ||
+ | </pre> | ||
+ | |||
+ | Maak dit bestand enkel leesbaar voor de eigenaar: | ||
+ | |||
+ | <code> | ||
+ | chmod 0600 ~/.my.cnf | ||
+ | </code> | ||
+ | |||
+ | === /etc/mysql/my.cnf === | ||
+ | |||
+ | <code> | ||
+ | sudo cp my.cnf my.cnf.bu-org | ||
+ | </code> | ||
+ | |||
+ | Bestand <code>my.cnf</code> - Overgenomen van <code>dvb7</code>: | ||
+ | |||
+ | <pre> | ||
+ | # | ||
+ | ########################################################################### | ||
+ | # Defaults | ||
+ | ########################################################################### | ||
+ | # | ||
+ | # This line is optional: Server will still start without this line | ||
+ | # | ||
+ | !includedir /etc/mysql/conf.d/ | ||
+ | |||
+ | |||
+ | ########################################################################### | ||
+ | # Strompf - [mysqld] | ||
+ | ########################################################################### | ||
+ | # | ||
+ | [mysqld] | ||
+ | |||
+ | |||
+ | # Remove I/O path restrictions | ||
+ | ############################## | ||
+ | # | ||
+ | secure_file_priv="" | ||
+ | |||
+ | |||
+ | # Enable longer concat string | ||
+ | ############################# | ||
+ | # | ||
+ | group_concat_max_len = 300000 | ||
+ | |||
+ | |||
+ | # Disable MySQL Strict Mode | ||
+ | ########################### | ||
+ | # | ||
+ | sql_mode="" | ||
+ | |||
+ | |||
+ | # Increase max_packet_size | ||
+ | ########################### | ||
+ | # | ||
+ | max_allowed_packet=1024MB | ||
+ | |||
+ | |||
+ | ########################################################################### | ||
+ | # Strompf - [mysqldump] | ||
+ | ########################################################################### | ||
+ | # | ||
+ | [mysqldump] | ||
+ | |||
+ | max_allowed_packet=1024MB | ||
+ | </pre> | ||
+ | |||
+ | === Backup === | ||
+ | |||
+ | Vóór installatie php: Mooi moment voor een backup (2021.09.18-09.43) | ||
+ | |||
+ | == PHP8 == | ||
+ | |||
+ | Het wordt PHP8: | ||
+ | |||
+ | * WordPress & WooCommerce zouden al sinds eind 2020 klaar zijn voor PHP8 | ||
+ | * Als het tegenvalt, kan ik altijd terug naar PHP7.x | ||
+ | |||
+ | === Installatie === | ||
+ | |||
+ | [[file:20220131-1249.png|thumb|Installatiefout Mediawiki wegens ontbrekende PHP-module]] | ||
+ | |||
+ | <pre> | ||
+ | sudo add-apt-repository ppa:ondrej/php | ||
+ | sudo add-apt-repository ppa:ondrej/apache2 | ||
+ | |||
+ | sudo apt install php8.0 | ||
+ | sudo apt install libapache2-mod-php8.0 | ||
+ | sudo apt install php8.0-mysql | ||
+ | sudo apt install php8.0-curl | ||
+ | sudo apt install php8.0-intl # Added to this list: 2022.01.31 | ||
+ | sudo apt install php8.0-xml | ||
+ | sudo apt install php8.0-gd | ||
+ | sudo apt install php8.0-mbstring | ||
+ | sudo apt install php8.0-soap # Added to this list: 2022.01 | ||
+ | </pre> | ||
+ | |||
+ | Ik geloof dat alleen de eerste twee onderdelen nodig zijn om PHP te laten werken in combinatie met Apache. | ||
+ | |||
+ | === Soap === | ||
+ | |||
+ | In dec. 2021 heb ik soap geïnstalleerd middels bovengenoemd commando. Waarschijnlijk de eerste keer dat ik dat gedaan heb. Oa. de WooCommerce-plugin voor het invullen van straat en huisnummer ahv. postcode, maakt gebruik van Soap. | ||
+ | |||
+ | === Configuratie === | ||
+ | |||
+ | '''Upload-limiet verruimen''' | ||
+ | |||
+ | <code>sudo vim /etc/php/8.0/apache/php.ini</code>: | ||
+ | |||
+ | <pre> | ||
+ | ; Maximum allowed size for uploaded files. | ||
+ | ; http://php.net/upload-max-filesize | ||
+ | ; | ||
+ | ; Jeroen - 2021.10: Changed from 2M to 8M | ||
+ | ; | ||
+ | upload_max_filesize = 8M | ||
+ | </pre> | ||
+ | |||
+ | === Test === | ||
+ | |||
+ | Plaats in <code>/var/www/html</code> bestand <code>phpinfo.php</code> met deze inhoud: | ||
+ | |||
+ | <pre> | ||
+ | <?php | ||
+ | phpinfo(); | ||
+ | ?> | ||
+ | </pre> | ||
+ | |||
+ | En roep deze aan middels <code>http://123-234-123-123.colo.transip.net/phpinfo.php</code>. Nu moet je de gebruikelijke phpinfo-pagina krijgen: | ||
+ | |||
+ | * Dit werkt ook als je <code>sudo</code> moet gebruiken om te kunnen schrijven in <code>/var/www/html</code> | ||
+ | * Belangrijk dat het protocol <code>http</code> is, en niet <code>https</code>, want nog niet geïnstalleerd | ||
+ | * Onduidelijk? Fouten? Storingen? Maak dan een statisch HTML-bestand aan, bv. <code>hello-world.htlml</code> met inhoude <code>Hello, world!</code> en plaats deze in dezelfde map, en roep deze aan middels <code>http://123-234-123-123.colo.transip.net/hello-world.html</code> | ||
+ | |||
+ | == Overig == | ||
+ | |||
+ | === Let's Encrypt === | ||
+ | |||
+ | <pre> | ||
+ | sudo add-apt-repository ppa:certbot/certbot | ||
+ | sudo apt install python3-certbot-apache | ||
+ | </pre> | ||
+ | |||
+ | === Lynx === | ||
+ | |||
+ | <code> | ||
+ | sudo apt install lynx | ||
+ | </code> | ||
+ | |||
+ | === WP-CLI === | ||
+ | |||
+ | Ik plaats de ''WordPress-Command Line Interface'' standaard in <code>/opt</code>, zodat <code>/usr/local/bin</code> uitsluitend voor eigen programma's en scripts is: | ||
+ | |||
+ | <pre> | ||
+ | cd /opt | ||
+ | sudo curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | ||
+ | sudo mv wp-cli.phar wp | ||
+ | sudo chmod o+x wp | ||
+ | </pre> | ||
+ | |||
+ | Test mbv. commando | ||
+ | |||
+ | <pre> | ||
+ | wp --info | ||
+ | </pre> | ||
+ | |||
+ | of alleen maar | ||
+ | |||
+ | <pre> | ||
+ | wp | ||
+ | </pre> | ||
+ | |||
+ | Mocht dit niet werken: Verifiëer dat in <code>.profile</code> de map <code>/opt</code> is toegevoegd aan <code>PATH</code>. | ||
+ | |||
+ | === mmv === | ||
+ | |||
+ | <code> | ||
+ | sudo apt install mmv | ||
+ | </code> | ||
+ | |||
+ | === unzip === | ||
+ | |||
+ | Toevoeging - mei 2022: | ||
+ | |||
+ | <code> | ||
+ | sudo apt install unzip | ||
+ | </code> | ||
+ | |||
+ | === Bestandsrechten === | ||
+ | |||
+ | Misschien dat het nu eindelijk lukt om daar iets eenvoudigs van te maken wat ook nog goed werkt: [[Mappen, bestanden & rechten - 2021 (WordPress)]]. | ||
+ | |||
+ | == Zie ook == | ||
+ | |||
+ | * [[Installatie webserver (2018)]] | ||
+ | * [[Mappen, bestanden & rechten - 2021 (WordPress)]] | ||
== Bronnen == | == Bronnen == | ||
+ | |||
+ | * https://www.transip.nl/knowledgebase/artikel/2084-de-vps-firewall-in-het-controlepaneel/ | ||
+ | * https://www.golinuxcloud.com/bashrc-vs-bash-profile/ | ||
+ | * https://www.tecmint.com/disable-root-login-in-linux/ | ||
+ | * https://www.tecmint.com/set-hostname-permanently-in-linux/ | ||
+ | |||
+ | === LAMP - Algemeen === | ||
* https://www.xxlhosting.nl/blog/lamp-stack | * https://www.xxlhosting.nl/blog/lamp-stack | ||
− | * https://www. | + | * https://upcloud.com/community/tutorials/installing-lamp-stack-ubuntu - Maart 2021: PHP7.4 & MariaDB ipv. MySQL |
+ | * https://www.linode.com/docs/guides/how-to-install-a-lamp-stack-on-ubuntu-20-04 - Juni 2021: PHP7.4 & MySQL | ||
+ | |||
+ | === PHP 7.4 vs. PHP 8 === | ||
+ | |||
+ | * https://www.a2hosting.com/blog/php-8-wordpress-compatibility/ | ||
+ | * https://wordpress.org/support/topic/requires-php-8/ | ||
+ | * https://wordpress.org/support/topic/error-under-php8/ - Example of a WooCommerce-related plugin with issues under PHP8 | ||
+ | * https://make.wordpress.org/core/2020/11/23/wordpress-and-php-8-0/ | ||
+ | * https://wordpress.org/support/topic/php-8-20 - WooCommerce is klaar voor PHP8 | ||
+ | * https://github.com/woocommerce/woocommerce/issues/27674 - Dit schijnt aan te geven dat WooCommerce klaar is voor PHP8 - Ik snap er weinig van | ||
+ | |||
+ | === PHP 8 === | ||
+ | |||
+ | * https://linuxize.com/post/how-to-install-php-8-on-ubuntu-20-04/ | ||
+ | * https://stackoverflow.com/questions/11584426/how-do-i-enable-enable-soap-in-php-on-linux#11584962 | ||
+ | |||
+ | === MariaDB === | ||
+ | |||
+ | * https://www.digitalocean.com/community/tutorials/how-to-install-mariadb-on-ubuntu-20-04 | ||
+ | * https://en.wikipedia.org/wiki/MariaDB |
Huidige versie van 25 nov 2022 om 07:39
Tijd voor een nieuwe TransIP-VPS! Zie Installatie webserver (2018) voor de laatste installatie hiervoor. Dit artikel is daarop gebaseerd. Deze server is in september 2021 opgeleverd.
Server-specs
Laatste server
- TransIP-pakket X16
- 4 cores
- 16 GB geheugen
- 300 GB SSD
Nieuwe server
TransIP C-range-pakket: Die schalen net iets verder dan VPS'en uit het X-range-pakket. Het wordt het instappakket C2: Dan kan ik bij upgraden hopelijk het verschil meten in performance:
- TransIP pakket C2
- 2 dedicated vCPU's
- 4 GB RAM
- 100GB NVMe
- OS: Ubuntu 20.04 LTS, met ondersteuning tot april 2025
Upgrade
In feb. 2022 zijn de specs van deze server verdubbeld. Ik vermoed dat ik tussendoor ook al een keer de specs heb verdubbeld, maar dat lijk ik hier niet te hebben vermeld:
- TransIP pakket C8
- 8 cores ('8 dedicated vCPU's')
- 16 GB RAM (16.385MB)
- Opslag: 400GB NVMe
Sites waren 30% sneller na deze upgrade.
Basis
Werkstation: Alias
Alias toevoegen aan .bashrc
:
alias dvb8="ssh 123.134.156.78"
Deze gebruik ik om met Bash te kunnen inloggen met alleen dvb8
.
Werkstation: DNS-entry
Ik heb een verwijzing naar deze server nodig in /etc/hosts
:
123.134.156.78 dvb8
Hier maak ik gebruik van, als ik bestanden wil kopiëren via Bash. Bv.:
rsync ~/Desktop/test.tmp dvb8:
Installatie OS door TransIP
Tegenwoordig is er de keuze om het OS direct te installeren en gelijk al ssh-public keys te plaatsen. Daar heb ik gebruik van gemaakt - Scheelt flink wat frustrerend werk!
Wachtwoord instellen
Omdat TransIP de installatie van het OS verzorgt, kreeg ik niet de gelegenheid om een wachtwoord in te stellen voor het root-account. Dat gaat pas na inloggen (via ssh):
sudo passwd jeroen
Disable root-account
Account root
is actief. Dat vind ik niet handig. Verwijderen lijkt me iets te veel van het goede. Daarom uitzetten:
sudo vim /etc/passwd
- Verander regel
root:x:0:0:root:/root:/bin/bash
inroot:x:0:0:root:/root:/sbin/nologin
.
Als ik nu probeer in te loggen:
$ su root Password: This account is currently not available.
Hostnaam aanpassen
Deze server heet Ubuntu. Daar wil ik dvb8 van maken:
sudo hostname dvb8
sudo vim /etc/hostname
sudo vim /etc/hosts
- Bleek niet nodig te zijn.
Time zone instellen
[1]:
Specificeer de timezone met de interactieve routine die je start met:
sudo dpkg-reconfigure tzdata
Deze bleek niet correct te zijn ingesteld. Nav. de routine kreeg ik deze melding:
Current default time zone: 'Europe/Amsterdam' Local time is now: Fri Sep 17 17:44:13 CEST 2021. Universal Time is now: Fri Sep 17 15:44:13 UTC 2021.
Firewall
TransIP biedt VPS Firewall, die draait op de hypervisor van het VPS. Deze is gebaseerd op iptables en kun je bedienen via de TransIP-console - Handig [2]. Dan ga ik niet zelf klooien met een firewall.
Ik denk dat de basisinstellingen voldoen. Dit zijn de regels die in 2018 gebruikte voor de configuratie van UFW, en die komen overeen met deze basisinstellingen:
default allow outgoing default deny incoming allow 22/tcp # ssh allow 80/tcp # http allow 443/tcp # https
→ Firewall aangezet.
IPv6
Ik ben nog steeds niet thuis in configuratie van IPv6. Simpele oplossing: Niet gebruiken! Cloudways heeft dat ook niet op z'n servers, dus kan ik ook wel zonder.
Locale
Instellingen tav. locale zijn al door TransIP verzorgd tijdens installatie. Dit zijn ze, al hoef ik hier momenteel nix mee:
$ locale LANG=C.UTF-8 LANGUAGE= LC_CTYPE="C.UTF-8" LC_NUMERIC=C.UTF-8 LC_TIME=C.UTF-8 LC_COLLATE="C.UTF-8" LC_MONETARY=C.UTF-8 LC_MESSAGES="C.UTF-8" LC_PAPER=C.UTF-8 LC_NAME=C.UTF-8 LC_ADDRESS=C.UTF-8 LC_TELEPHONE=C.UTF-8 LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C.UTF-8 LC_ALL=
.bash_aliases
VOLGENDE KEER GEWOON WEER .BASHRC GEBRUIKEN - WANT ZO WERKEN M'N SCRIPTS
Verschil tussen diverse bestanden [3]:
.bashrc
: Wordt uitgevoerd bij alle shell-aanroepen. Dus ook als je scripts met een shebang aanroept.bash_aliases
: Optioneel bestand om je aliassen in onder te brengen. Dit is voor het eerste dat ik hier gebruik van maak: Storingen in.bashrc
zijn niet handig.profile
: Wordt alleen uitgevoerd tijdens interactive shells, dus wanneer je als gebruiker een terminal opent. Ik geloof dat dit de plek is om PATH eventueel aan te passen.
Mijn toevoegingen aan .bash_aliases
:
########################################################################################## # Additions - Strompf ########################################################################################## # # # Aliases - General ########################################################### # alias scripts="cd /usr/local/bin" alias www="cd /var/www" alias wwwls="ls /var/www" alias pss="ps -aux" # Aliases - Apache ########################################################### # # I use these quite a bit # alias a2re="sudo service apache2 reload" alias a2s="apachectl -S" alias a2dis="sudo a2dissite" alias a2en="sudo a2ensite" # Aliases - Hosted sites ########################################################### # # None yet, of course
.profile
Ik vind het handig als na inloggen de inhoud van map /var/www
wordt getoond. Daarom deze toevoeging aan .profile
:
################################################################################ # Additions - Jeroen ################################################################################ # # # Update PATH ################################################## # # * Do this in .profile or in .bashrc? # * Note that "/use/local/bin" is already included in PATH # * "/opt": Handmatig geïnstalleerde programmatuur (bv. wp-cli) # PATH=$PATH:/opt # Display hosted sites ################################################## # echo " " echo "ls /var/www" ls /var/www echo " "
sudo timeout
Zie Sudo voor het aanpassen van de sudo timeout - Graag!
Backup-time!
Juhu! De basis is op orde. Goed moment voor een backup (via TransIP-console) en dan de applicaties.
Eigen scripts
Locatie voor eigen schripts is als vanouds /usr/local/bin
.
Rechten aanpassen:
sudo chown jeroen /usr/local/bin sudo chgrp jeroen /usr/local/bin
Het gaat om deze scripts:
add_db
add_domain
reboot_server_tonight
update_all_dvb8
.
Daarnaast heb ik op m'n meest recentelijke server een hoop WordPress-gerelateerde scripts staan. Ik neem daarvan alleen dingen over indien nodig.
Bookmark Nautilus
Om een bookmark voor deze server aan te maken op Nautilus:
- File » Connect to Server...
- Server: IP-adres van de server
- Folder: /home/strompf
- User Details leeg laten
- Connect...
- Nadat de folder is getoond: Maak een bookmark aan en hernoem deze naar
dvb8
.
Apache
- Rechtenbeheer anders dan in het verleden: Dat was veel te ingewikkeld en onpractisch - Meer info volgt
- Eén centraal logbestand
Installatie
'Handmatige' installatie ipv. gebruik Tasksel:
$ sudo apt install apache2 Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libjansson4 liblua5.2-0 ssl-cert Suggested packages: apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser openssl-blacklist The following NEW packages will be installed: apache2 apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libjansson4 liblua5.2-0 ssl-cert 0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded. Need to get 1865 kB of archives. After this operation, 8083 kB of additional disk space will be used.
ServerName
Met ServerName bedoelt Apache de complete URL. Die kun je achterhalen met bv. reverse DNS-lookup. De default-servernamen van TransIP zijn zoiets als:
123-156-189-201.colo.transip.net
Als je deze intikt in een browser, krijg je als het goed is gelijk al de vangpagina van Apache. Ook als je verder nog nix hebt geconfigureerd.
apache2.conf
Toevoegingen configuratiebestand /etc/apache2/apache2.conf
- Ik moet weer 's uitzoeken wat dit precies betekent:
################################################################################ # Updates - Jeroen ################################################################################ # # # ServerName ######################################## # # * Use TransIP domain name # * http://wiki.devliegendebrigade.nl/Could_not_reliably_determine_..._domain_name_(Apache) # # ServerName 123-156-189-201-.colo.transip.net # Make directories non-browseable ######################################## # # * Important! # * http://wiki.devliegendebrigade.nl/Apache_-_Mappen_niet_browsable_maken # <Directory /var/www/> Options FollowSymLinks AllowOverride All Require all granted </Directory> # KeepAlive Directive ######################################## # # Actually already active by default # # See also: # # * https://httpd.apache.org/docs/2.4/mod/core.html#keepalive and # * https://www.linode.com/docs/guides/how-to-install-a-lamp-stack-on-ubuntu-20-04/ # * http://wiki.devliegendebrigade.nl/Installatie_webserver#Apache # KeepAlive on MaxKeepAliveRequests 50 KeepAliveTimeout 5
mpm_prefork.conf
[4]:
/etc/apache2/mods-available/mpm_prefork.conf
aangepast. Dit is nu het hele bestand:
# prefork MPM # StartServers: number of server processes to start # MinSpareServers: minimum number of server processes which are kept spare # MaxSpareServers: maximum number of server processes which are kept spare # MaxRequestWorkers: maximum number of server processes allowed to start # MaxConnectionsPerChild: maximum number of requests a server process serves # # <IfModule mpm_prefork_module> # StartServers 5 # MinSpareServers 5 # MaxSpareServers 10 # MaxRequestWorkers 150 # MaxConnectionsPerChild 0 # </IfModule> # # vim: syntax=apache ts=4 sw=4 sts=4 sr noet ################################################################################ # Updates - Strompf - 2021.09 ################################################################################ # # * Optimized for 4GB internal memory # * Source: https://www.linode.com/docs/web-servers/lamp/install-lamp-stack-on-ubuntu-16-04 # * These settings might need to be reviewed # # <IfModule mpm_prefork_module> StartServers 8 MinSpareServers 6 MaxSpareServers 40 MaxRequestWorkers 200 MaxConnectionsPerChild 10000 </IfModule>
Modules
Er zijn twee modules die ik vrijwel altijd gebruik. Wonderlijk dat die dingen zoveel verschillende namen hebben:
Naam ls Naam /usr/lib/ Naam apachectl -M apache2/modules a2enmod -------------- --------------- ------- rewrite_module mod_rewrite rewrite ssl_module mod_ssl ssl
Daarnaast mpm_event
uitzetten en mpm_prefort
aanzetten (zeggen ze). Bij elkaar (waarbij a2re
een eigen alias is om Apache te herstarten):
sudo a2dismod mpm_event sudo a2enmod mpm_prefork sudo a2enmod rewrite a2re
MariaDB
Spannend! Overstappen van MySQL naar MariaDB:
Installatie
sudo apt install mariadb-server Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: galera-3 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libencode-locale-perl libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl liblwp-mediatypes-perl libmysqlclient21 libsnappy1v5 libterm-readkey-perl libtimedate-perl liburi-perl mariadb-client-10.3 mariadb-client-core-10.3 mariadb-common mariadb-server-10.3 mariadb-server-core-10.3 mysql-common socat Suggested packages: libclone-perl libmldbm-perl libnet-daemon-perl libsql-statement-perl libdata-dump-perl libipc-sharedcache-perl libwww-perl mailx mariadb-test tinyca The following NEW packages will be installed: galera-3 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libencode-locale-perl libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl liblwp-mediatypes-perl libmysqlclient21 libsnappy1v5 libterm-readkey-perl libtimedate-perl liburi-perl mariadb-client-10.3 mariadb-client-core-10.3 mariadb-common mariadb-server mariadb-server-10.3 mariadb-server-core-10.3 mysql-common socat 0 upgraded, 28 newly installed, 0 to remove and 0 not upgraded. Need to get 21.2 MB of archives. After this operation, 173 MB of additional disk space will be used.
Secure installation
sudo mysql_secure_installation
Beheeraccount
Er lijkt nog altijd iets raars te zijn met MySQL/MariaDB, dat zo lang er alleen maar een root-account is, je alleen kunt inloggen met
sudo mariadb
Vervolgens eigen beheeraccount aangemaakt:
create user jeroen@localhost identified by 'MijnWachtwoord'; grant all on *.* to jeroen@localhost with grant option;
.my.cnf
Inhoud (licht aangepast):
# ################################################################################ [client] ################################################################################ # host = localhost user = jeroen password = MijnWachtwoord socket = /var/run/mysqld/mysqld.sock comments = true ################################################################################ [mysqldump] ################################################################################ # # # Include sprocs & functions when making dumps ############################################## # routines = true # Continue with dump despite errors in views ############################################## # force = true
Maak dit bestand enkel leesbaar voor de eigenaar:
chmod 0600 ~/.my.cnf
/etc/mysql/my.cnf
sudo cp my.cnf my.cnf.bu-org
Bestand my.cnf
- Overgenomen van dvb7
:
# ########################################################################### # Defaults ########################################################################### # # This line is optional: Server will still start without this line # !includedir /etc/mysql/conf.d/ ########################################################################### # Strompf - [mysqld] ########################################################################### # [mysqld] # Remove I/O path restrictions ############################## # secure_file_priv="" # Enable longer concat string ############################# # group_concat_max_len = 300000 # Disable MySQL Strict Mode ########################### # sql_mode="" # Increase max_packet_size ########################### # max_allowed_packet=1024MB ########################################################################### # Strompf - [mysqldump] ########################################################################### # [mysqldump] max_allowed_packet=1024MB
Backup
Vóór installatie php: Mooi moment voor een backup (2021.09.18-09.43)
PHP8
Het wordt PHP8:
- WordPress & WooCommerce zouden al sinds eind 2020 klaar zijn voor PHP8
- Als het tegenvalt, kan ik altijd terug naar PHP7.x
Installatie
sudo add-apt-repository ppa:ondrej/php sudo add-apt-repository ppa:ondrej/apache2 sudo apt install php8.0 sudo apt install libapache2-mod-php8.0 sudo apt install php8.0-mysql sudo apt install php8.0-curl sudo apt install php8.0-intl # Added to this list: 2022.01.31 sudo apt install php8.0-xml sudo apt install php8.0-gd sudo apt install php8.0-mbstring sudo apt install php8.0-soap # Added to this list: 2022.01
Ik geloof dat alleen de eerste twee onderdelen nodig zijn om PHP te laten werken in combinatie met Apache.
Soap
In dec. 2021 heb ik soap geïnstalleerd middels bovengenoemd commando. Waarschijnlijk de eerste keer dat ik dat gedaan heb. Oa. de WooCommerce-plugin voor het invullen van straat en huisnummer ahv. postcode, maakt gebruik van Soap.
Configuratie
Upload-limiet verruimen
sudo vim /etc/php/8.0/apache/php.ini
:
; Maximum allowed size for uploaded files. ; http://php.net/upload-max-filesize ; ; Jeroen - 2021.10: Changed from 2M to 8M ; upload_max_filesize = 8M
Test
Plaats in /var/www/html
bestand phpinfo.php
met deze inhoud:
<?php phpinfo(); ?>
En roep deze aan middels http://123-234-123-123.colo.transip.net/phpinfo.php
. Nu moet je de gebruikelijke phpinfo-pagina krijgen:
- Dit werkt ook als je
sudo
moet gebruiken om te kunnen schrijven in/var/www/html
- Belangrijk dat het protocol
http
is, en niethttps
, want nog niet geïnstalleerd - Onduidelijk? Fouten? Storingen? Maak dan een statisch HTML-bestand aan, bv.
hello-world.htlml
met inhoudeHello, world!
en plaats deze in dezelfde map, en roep deze aan middelshttp://123-234-123-123.colo.transip.net/hello-world.html
Overig
Let's Encrypt
sudo add-apt-repository ppa:certbot/certbot sudo apt install python3-certbot-apache
Lynx
sudo apt install lynx
WP-CLI
Ik plaats de WordPress-Command Line Interface standaard in /opt
, zodat /usr/local/bin
uitsluitend voor eigen programma's en scripts is:
cd /opt sudo curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar sudo mv wp-cli.phar wp sudo chmod o+x wp
Test mbv. commando
wp --info
of alleen maar
wp
Mocht dit niet werken: Verifiëer dat in .profile
de map /opt
is toegevoegd aan PATH
.
mmv
sudo apt install mmv
unzip
Toevoeging - mei 2022:
sudo apt install unzip
Bestandsrechten
Misschien dat het nu eindelijk lukt om daar iets eenvoudigs van te maken wat ook nog goed werkt: Mappen, bestanden & rechten - 2021 (WordPress).
Zie ook
Bronnen
- https://www.transip.nl/knowledgebase/artikel/2084-de-vps-firewall-in-het-controlepaneel/
- https://www.golinuxcloud.com/bashrc-vs-bash-profile/
- https://www.tecmint.com/disable-root-login-in-linux/
- https://www.tecmint.com/set-hostname-permanently-in-linux/
LAMP - Algemeen
- https://www.xxlhosting.nl/blog/lamp-stack
- https://upcloud.com/community/tutorials/installing-lamp-stack-ubuntu - Maart 2021: PHP7.4 & MariaDB ipv. MySQL
- https://www.linode.com/docs/guides/how-to-install-a-lamp-stack-on-ubuntu-20-04 - Juni 2021: PHP7.4 & MySQL
PHP 7.4 vs. PHP 8
- https://www.a2hosting.com/blog/php-8-wordpress-compatibility/
- https://wordpress.org/support/topic/requires-php-8/
- https://wordpress.org/support/topic/error-under-php8/ - Example of a WooCommerce-related plugin with issues under PHP8
- https://make.wordpress.org/core/2020/11/23/wordpress-and-php-8-0/
- https://wordpress.org/support/topic/php-8-20 - WooCommerce is klaar voor PHP8
- https://github.com/woocommerce/woocommerce/issues/27674 - Dit schijnt aan te geven dat WooCommerce klaar is voor PHP8 - Ik snap er weinig van
PHP 8
- https://linuxize.com/post/how-to-install-php-8-on-ubuntu-20-04/
- https://stackoverflow.com/questions/11584426/how-do-i-enable-enable-soap-in-php-on-linux#11584962