User Tools

Site Tools


sysadmin:dokuwiki:dokuwiki_install_aws_ec2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
sysadmin:dokuwiki:dokuwiki_install_aws_ec2 [2020/10/07 17:32]
vidyasb
sysadmin:dokuwiki:dokuwiki_install_aws_ec2 [2020/10/07 20:09] (current)
vidyasb
Line 12: Line 12:
 sudo amazon-linux-extras install -y php7.2 sudo amazon-linux-extras install -y php7.2
 </code> </code>
-  - Run the following Linux shell command to install [[https://httpd.apache.org/|Apache HTTPD]], PHP XML Parser (required by DokuWiki) and [[https://httpd.apache.org/docs/current/mod/mod_ssl.html|Apache SSL Module]]:<code>+  - Run the following Linux shell command to install [[https://httpd.apache.org/|Apache httpd]], PHP XML Parser (required by DokuWiki) and [[https://httpd.apache.org/docs/current/mod/mod_ssl.html|Apache SSL Module]]:<code>
 sudo yum -y install httpd php-xml mod_ssl sudo yum -y install httpd php-xml mod_ssl
 </code> </code>
-  - Edit **httpd.conf** file by running ''sudo vi /etc/httpd/conf/httpd.conf'' Linux shell command with following contents: \\ >Replace //\<\<Private IP Address of EC2 Instance\>\>// <file conf httpd.conf> +  - Edit **httpd.conf** file by running ''sudo vi /etc/httpd/conf/httpd.conf'' Linux shell command with following contents: <WRAP center round alert 60%> 
-Listen <<Private IP Address of EC2 Instance>>:80+Replace //<<Server Administrator Email address>>// \\  
 +Replace //<<Website DNS>>// 
 +</WRAP><file conf httpd.conf> 
 +#Listen 80
 ServerAdmin <<Server Administrator Email address>> ServerAdmin <<Server Administrator Email address>>
 ServerName <<Website DNS>>:80 ServerName <<Website DNS>>:80
Line 25: Line 28:
 </LocationMatch> </LocationMatch>
 </file> </file>
-  - +  - Run the following Linux shell command to enable Apache httpd server to start at boot as well as immediately:<code> 
 +sudo systemctl enable httpd 
 +sudo systemctl start httpd 
 +</code> 
 +  - Run the following Linux shell commands to download and install [[doku>|DocuWiKi]]:<WRAP center round info 60%> 
 +For detailed installation procedure, refer to [[doku>install:amazone_ec2]] 
 +</WRAP><WRAP center round alert 60%> 
 +To generate //<<dokuwiki download file>>//, Goto [[https://download.dokuwiki.org/]] URL from any web browser, select necessary options and click **Start Download** button 
 +</WRAP><code> 
 +cd /var/www/html 
 +sudo wget https://download.dokuwiki.org/out/dokuwiki-<<.tgz 
 +sudo tar -zxvf dokuwiki-<<dokuwiki download file>>.tgz 
 +sudo rm -r dokuwiki-<<dokuwiki download file>>.tgz 
 +sudo chown -R apache dokuwiki 
 +sudo chgrp -R apache dokuwiki 
 +cd dokuwiki 
 +sudo mv * ../ 
 +cd .. 
 +sudo rm -Rf docuwiki 
 +sudo chmod -R 0700 data 
 +sudo chmod -R 0700 conf 
 +sudo chmod -R 0700 inc 
 +sudo chmod -R 0700 vendor 
 +</code> 
 +  - Update DNS host record with your Domain Registrar or Domain Management Service 
 +  - From web browser on your PC, go to ''https:%%//%%<<domain name>>/install.php'' 
 +  - Fill all the required details 
 +  - Generate CloudFlare Origin Certificate 
 +  - Run following Linux shell commands to create certificates:<WRAP center round info 60%> 
 +[[https://www.digicert.com/kb/csr-ssl-installation/apache-openssl.htm#ssl_certificate_install]] \\ 
 +[[https://support.cloudflare.com/hc/en-us/articles/115000479507-Managing-Cloudflare-Origin-CA-certificates]] 
 +</WRAP><WRAP center round alert 60%> 
 +Replace //<<domain name>>// with your website's domain name \\ 
 +Replace //<<Paste Origin Certificate>>// with Origin Certificate generated in your CloudFlare account \\ 
 +Replace //<<Paste Private Key>>// with Private Key for Origin Certificate generated in your CloudFlare account  
 +</WRAP><code> 
 +sudo mkdir /usr/local/ssl 
 +sudo vi /usr/local/ssl/<<domain name>>.crt 
 +<<Paste Origin Certificate>> 
 +sudo vi /usr/local/ssl/<<domain name>>.crt 
 +<<Paste Private Key>> 
 +sudo vi /usr/local/ssl/cloudflare.crt 
 +<<Paste CloudFlare certificate from below>> 
 +</code>[[https://support.cloudflare.com/hc/article_attachments/360037885371/origin_ca_rsa_root.pem]]<file txt cloudflare.crt>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BgwFoAUJOhTV118NECHqeuU27rhFnj8KaQwDQYJKoZIhvcNAQELBQAD 
 +ggEBAHwOf9Ur1l0Ar5vFE6PNrZWrDfQIMyEfdgSKofCdTckbqXNTiXdgbHs+TWoQ 
 +wAB0pfJDAHJDXOTCWRyTeXOseeOi5Btj5CnEuw3P0oXqdqevM1/+uWp0CM35zgZ8 
 +VD4aITxity0djzE6Qnx3Syzz+ZkoBgTnNum7d9A66/V636x4vTeqbZFBr9erJzgz 
 +hhurjcoacvRNhnjtDRM0dPeiCJ50CP3wEYuvUzDHUaowOsnLCjQIkWbR7Ni6KEIk 
 +MOz2U0OBSif3FTkhCgZWQKOOLo1P42jHC3ssUZAtVNXrCk3fw9/E15k8NPkBazZ6 
 +0iykLhH1trywrKRMVw67F44IE8Y= 
 +-----END CERTIFICATE----- 
 +</file> 
 +  - Edit **ssl.conf** file by running ''sudo vi /etc/httpd/conf.d/ssl.conf'' Linux shell command with following contents:<WRAP center round alert 60%> 
 +Replace //<<domain name>>// with your website's domain name 
 +</WRAP><file txt ssl.conf> 
 +SSLCertificateFile /usr/local/ssl/<<domain name>>.crt 
 +SSLCertificateKeyFile /usr/local/ssl/<<domain name>>.key 
 +SSLCertificateChainFile /usr/local/ssl/cloudflare.crt 
 +</file> 
 +  - Run following Linux shell command to restart Apache httpd service:<code> 
 +sudo systemctl restart httpd 
 +</code> 
 +  - Test security of your website by accessing ''https:%%//%%<<domain name>>/data/pages/wiki/dokuwiki.txt''. Refer to [[doku>security#web_access_security]] for detailed instructions on how to properly secure important directories in your DokuWiki installation.
sysadmin/dokuwiki/dokuwiki_install_aws_ec2.1602091968.txt.gz · Last modified: 2020/10/07 17:32 by vidyasb