Si të instaloni DokuWiki në Ubuntu 22.04
DokuWiki është një softuer wiki i thjeshtë, i lehtë për t'u përdorur dhe shumë i gjithanshëm i shkruar në PHP. Është falas, me burim të hapur dhe përdor një format të thjeshtë skedari për të ruajtur të dhënat e tij në vend që të përdorë ndonjë sistem bazë të dhënash. Ai ofron shumë veçori që ju ndihmojnë të shkallëzoni dhe optimizoni me lehtësi faqen tuaj wiki. Ajo po fiton popullaritet për shkak të sintaksës së saj të pastër dhe të lexueshme. Duke përdorur Dokuwiki, ju mund të krijoni uebsajtet tuaja personale ose të biznesit nëpërmjet panelit të internetit të Dokuwiki.
Në këtë tutorial, ne do t'ju tregojmë se si të instaloni DokuWiki me Apache dhe certifikatën Lets Encrypt SSL në Ubuntu 22.04.
Parakushtet
- Një server që ekzekuton Ubuntu 22.04.
- Një emër i vlefshëm domeni i drejtohet serverit tuaj.
- Një fjalëkalim rrënjësor është konfiguruar në serverin tuaj.
Instaloni Apache dhe PHP
Së pari, do t'ju duhet të instaloni uebserverin Apache, PHP dhe biblioteka të tjera PHP në sistemin tuaj. Ju mund t'i instaloni të gjitha ato duke ekzekutuar komandën e mëposhtme:
apt-get install apache2 php php-gd php-xml php-json -y
pasi të keni instaluar të gjitha paketat, filloni shërbimin Apache dhe aktivizoni atë të fillojë në nisje me komandën e mëposhtme:
systemctl start apache2
systemctl enable apache2
Pasi të keni mbaruar, mund të vazhdoni në hapin tjetër.
Instaloni DokuWiki Ubuntu 22.04
Më pas, vizitoni faqen zyrtare të shkarkimit të DokuWiki, kopjoni URL-në e shkarkimit dhe shkarkoni versionin më të fundit të DokuWiki me komandën e mëposhtme:
wget https://download.dokuwiki.org/out/dokuwiki-24117f7f9e0362c4b1782ff29220b0ab.tgz
Pasi të përfundojë shkarkimi, krijoni një direktori DokuWiki brenda direktoriumit rrënjësor të uebit Apache dhe nxirrni DokuWiki:
mkdir /var/www/html/dokuwiki
tar -xvzf dokuwiki-24117f7f9e0362c4b1782ff29220b0ab.tgz -C /var/www/html/dokuwiki/ --strip-components=1
Më pas, kopjoni skedarin e mostrës .htaccess me komandën e mëposhtme:
cp /var/www/html/dokuwiki/.htaccess{.dist,}
Më pas, ndryshoni pronësinë e dokuwiki në www-data:
chown -R www-data:www-data /var/www/html/dokuwiki
Pasi të keni mbaruar, mund të vazhdoni në hapin tjetër.
Krijoni një Apache Virtualhost për DokuWiki
Më pas, do t'ju duhet të krijoni një skedar konfigurimi të hostit virtual Apache për të shërbyer uebsajtin e DokuWiki. Mund ta krijoni me komandën e mëposhtme
nano /etc/apache2/sites-available/dokuwiki.conf
Shtoni rreshtat e mëposhtëm:
<VirtualHost *:80>
ServerName doku.example.com
DocumentRoot /var/www/html/dokuwiki
<Directory ~ "/var/www/html/dokuwiki/(bin/|conf/|data/|inc/)">
<IfModule mod_authz_core.c>
AllowOverride All
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order allow,deny
Deny from all
</IfModule>
</Directory>
ErrorLog /var/log/apache2/dokuwiki_error.log
CustomLog /var/log/apache2/dokuwiki_access.log combined
</VirtualHost>
Ruani dhe mbyllni skedarin kur të keni mbaruar. Pastaj, aktivizoni skedarin e konfigurimit të hostit virtual DokuWiki dhe ringarkoni shërbimin Apache me komandën e mëposhtme:
a2ensite dokuwiki.conf
systemctl reload apache2
Tani mund të kontrolloni statusin e Apache duke përdorur komandën e mëposhtme:
systemctl status apache2
Ju duhet të shihni daljen e mëposhtme:
? apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2022-06-25 15:44:31 UTC; 4min 30s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 52450 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
Main PID: 52131 (apache2)
Tasks: 6 (limit: 4579)
Memory: 16.9M
CPU: 331ms
CGroup: /system.slice/apache2.service
??52131 /usr/sbin/apache2 -k start
??52454 /usr/sbin/apache2 -k start
??52455 /usr/sbin/apache2 -k start
??52456 /usr/sbin/apache2 -k start
??52457 /usr/sbin/apache2 -k start
??52458 /usr/sbin/apache2 -k start
Jun 25 15:44:30 ubuntu2204 systemd[1]: Starting The Apache HTTP Server...
Në këtë pikë, serveri i uebit Apache është konfiguruar për të shërbyer sitin DokuWiki. Tani mund të vazhdoni të instaloni Lets Encrypt SSL në faqen tuaj të internetit.
Aktivizo SSL në faqen e internetit të DokuWiki
Për të aktivizuar SSL në DokuWiki, do t'ju duhet të instaloni klientin Certbot në sistemin tuaj. Certbot është një mjet Lets Encrypt që përdoret për të shkarkuar dhe menaxhuar SSL.
Ju mund të instaloni Certbot me komandën e mëposhtme:
apt-get install certbot python3-certbot-apache -y
Pasi të instalohet, ekzekutoni komandën e mëposhtme për të instaluar Lets Encrypt SSL për faqen tuaj të internetit:
certbot --apache -d dokuwiki.linuxbuz.com
Do t'ju kërkohet të jepni emailin tuaj të vlefshëm dhe të pranoni afatin e shërbimit siç tregohet më poshtë:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel):
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for dokuwiki.linuxbuz.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/dokuwiki-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/dokuwiki-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/dokuwiki-le-ssl.conf
Më pas, zgjidhni nëse do të ridrejtoni apo jo trafikun HTTP në HTTPS siç tregohet më poshtë:
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Shkruani 2 dhe shtypni Enter për të filluar procesin. Pasi të përfundojë instalimi, duhet të merrni daljen e mëposhtme:
Enabled Apache rewrite module
Redirecting vhost in /etc/apache2/sites-enabled/dokuwiki.conf to ssl vhost in /etc/apache2/sites-available/dokuwiki-le-ssl.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://dokuwiki.linuxbuz.com
You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=dokuwiki.linuxbuz.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/dokuwiki.linuxbuz.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/dokuwiki.linuxbuz.com/privkey.pem
Your cert will expire on 2020-09-05. To obtain a new or tweaked
version of this certificate in the future, simply run certbot again
with the "certonly" option. To non-interactively renew *all* of
your certificates, run "certbot renew"
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
Në këtë pikë, faqja juaj Dokuwiki është e siguruar me Lets Encrypt SSL.
Hyni në DokuWiki
Tani, hapni shfletuesin tuaj të internetit dhe shkruani URL-në https://dokuwiki.linuxbuz.com/install.php. Ju duhet të shihni ekranin e instalimit të DokuWiki:
Jepni emrin tuaj wiki, emrin e përdoruesit të administratorit, fjalëkalimin, emailin, zgjidhni politikën tuaj dhe klikoni në butonin Ruaj. Do të ridrejtoheni në faqen e mëposhtme:
Klikoni në \DokuWiki juaj i ri\. Ju duhet të shihni ekranin e mëposhtëm:
Klikoni në butonin Identifikohu. Do të ridrejtoheni në ekranin e identifikimit të DokuWiki siç tregohet më poshtë:
Jepni emrin e përdoruesit, fjalëkalimin e administratorit dhe klikoni në butonin Identifikohu. Ju duhet të shihni pultin e DokuWiki në ekranin e mëposhtëm:
Vendosja e rinovimit automatik
Si parazgjedhje, certifikatat Let's Encrypt janë të vlefshme për 90 ditë. Pra, do t'ju duhet të vendosni një punë cron për të rinovuar automatikisht certifikatën SSL. Është e sigurt të krijosh një punë cron që funksionon çdo javë apo edhe çdo ditë.
Nëse dëshironi të rinovoni certifikatën SSL me dorë, ekzekutoni komandën e mëposhtme:
certbot renew --dry-run
Mund të konfiguroni një punë cron për të rinovuar automatikisht certifikatën SSL çdo ditë në orën 6:00 të mëngjesit duke redaktuar skedarin e mëposhtëm:
crontab -e
Shtoni rreshtin e mëposhtëm:
00 06 * * * root /usr/bin/certbot renew >/dev/null 2>&1
Ruani dhe mbyllni skedarin kur të keni mbaruar.
konkluzioni
urime! ju keni instaluar me sukses DokuWiki dhe e keni siguruar atë me Lets Encrypt SSL në Ubuntu 22.04. Tani mund të krijoni faqen tuaj wiki duke përdorur DokuWiki. Mos ngurroni të më pyesni nëse keni ndonjë pyetje.