0153.html 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Install ownCloud on Windows with WSL2</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Browser Based,Home Lab,Home Lab Ideas,Install Guide,Self-Hosted,Web Based Tools,Web Based,Apache,Cloud Solution,HowTo,Linux,OwnCloud,PHP,Windows,Microsoft Windows,WSL,Microsoft,Windows Subsystem For Linux,Install OwnCloud On Windows,How To Install WSL,LAMP,Linux On Windows,MariaDB,MySQL,PHP Application,PHP Software,Subsystem,WSL Installation Guide,Web Server,HTTPD,Free Software,Debian,Apache HTTPD,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Install ownCloud on Windows with WSL2">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="04/17/2023 08:15:31 PM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Install ownCloud on Windows with WSL2</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>What is OwnCloud?</h2>
  26. <blockquote><em>OwnCloud is a suite of client-server software for creating file hosting services and using them. OwnCloud is functionally very similar to the widely used Dropbox, with the primary functional difference being that OwnCloud is free and open-source, and thereby allowing anyone to install and operate it without charge on a private server. -<a href="https://en.wikipedia.org/wiki/OwnCloud" target="_blank">https://en.wikipedia.org/wiki/OwnCloud</a></em></blockquote>
  27. <h2>Installing WSL</h2>
  28. <ol>
  29. <li>Launch Powershell as administrator</li>
  30. <li>Run the following command
  31. <div class="codeBlock PS"># enable WSL feature<br />
  32. dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart<br />
  33. # enable virtual machine platform<br />
  34. dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all</div>
  35. </li>
  36. <li>Type Y to reboot the system</li>
  37. <li>Launch Powershell as administrator and run the following additional commands to use WSL 2
  38. <div class="codeBlock PS"># enable virtualization platform<br />
  39. Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform<br />
  40. # enable wsl2<br />
  41. wsl --set-default-version 2<br />
  42. # download the wsl kernel update<br />
  43. $ProgressPreference = &#39;SilentlyContinue&#39;; Invoke-WebRequest https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi -OutFile .\wsl_update_x64.msi<br />
  44. # reset progress preference<br />
  45. $ProgressPreference = &#39;Continue&#39;<br />
  46. # install the downloaded file<br />
  47. .\wsl_update_x64.msi</div>
  48. </li>
  49. <li>Click the Start Button &gt; Search Microsoft Store &gt; Select Microsoft Store</li>
  50. <li>Search for the Linux distribution to install (Debian, Ubuntu, etc), Debian in this example</li>
  51. <li>Select the Linux distribution and click the Get button</li>
  52. <li>After the Linux distribution downloads and installs, click Open or select the distribution from the Start menu to launch it</li>
  53. <li>Input a username and password to be used in the Linux environment</li>
  54. </ol>
  55. <h2>Installing ownCloud</h2>
  56. <ol>
  57. <li>Continue with the following commands in WSL
  58. <div class="codeBlock"># update software repositories<br />
  59. sudo apt update<br />
  60. # install software updates<br />
  61. sudo apt upgrade -y<br />
  62. # install prerequisite <span class="codeBlock">package(s)</span><br />
  63. sudo apt install wget -y<br />
  64. # install Apache HTTPD and MySQL<br />
  65. sudo apt install apache2 mariadb-server mariadb-client -y<br />
  66. # install PHP components<br />
  67. sudo apt install php7.4 libapache2-mod-php7.4 php7.4-mysql php-common php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-readline php7.4-intl php7.4-json php7.4-gd php7.4-mbstring php7.4-mysql php7.4-xml php7.4-zip php7.4-curl -y<br />
  68. # start the mariadb service<br />
  69. sudo service mariadb start<br />
  70. # configure the MySQL database<br />
  71. sudo su<br />
  72. mysql_secure_installation</div>
  73. </li>
  74. <li>Press Enter to login as root</li>
  75. <li>Type N and press Enter to not switch to socket authentication</li>
  76. <li>Type Y and press Enter to set a root password, type the password twice to confirm</li>
  77. <li>Type Y and press Enter to remove anonymous users</li>
  78. <li>Type Y and press Enter to disallow root login remotely</li>
  79. <li>Type Y and press Enter to remove the test database</li>
  80. <li>Type Y and press Enter to reload privilege tables</li>
  81. <li>Run the following command to login into MySQL:
  82. <div class="codeBlock">mysql -u root -p</div>
  83. </li>
  84. <li>Authenticate with the root password set earlier</li>
  85. <li>Run the following commands to create the ownCloud database and database user
  86. <div class="codeBlock">CREATE DATABASE ownclouddb;<br />
  87. GRANT ALL ON ownclouddb.* to &#39;owncloud_rw&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;ownCl0ud!!&#39;;<br />
  88. FLUSH PRIVILEGES;<br />
  89. EXIT;<br />
  90. exit</div>
  91. </li>
  92. <li>Continue with the following commands to download and extract ownCloud in the Apache webroot
  93. <div class="codeBlock"># download latest owncloud version<br />
  94. sudo wget -O /tmp/owncloud.tar.bz2 https://download.owncloud.com/server/stable/owncloud-latest.tar.bz2<br />
  95. # extract owncloud-latest.tar.bz2<br />
  96. sudo tar -xf /tmp/owncloud.tar.bz2 --directory /var/www<br />
  97. # set the owner of the new owncloud directory to www-data<br />
  98. sudo chown -R www-data:www-data /var/www/owncloud<br />
  99. # create a new owncloud.conf file to configure the site<br />
  100. <span class="codeBlock">sudo nano /etc/apache2/sites-available/owncloud.conf</span></div>
  101. </li>
  102. <li>Paste the following configuration into owncloud.conf
  103. <p><span class="codeBlock">Alias /owncloud &quot;/var/www/owncloud/&quot;<br />
  104. &lt;Directory /var/www/owncloud/&gt;<br />
  105. Options +FollowSymlinks<br />
  106. AllowOverride All</span></p>
  107. <p><span class="codeBlock">&lt;IfModule mod_dav.c&gt;<br />
  108. Dav off<br />
  109. &lt;/IfModule&gt;</span></p>
  110. <p><span class="codeBlock">SetEnv HOME /var/www/owncloud<br />
  111. SetEnv HTTP_HOME /var/www/owncloud<br />
  112. &lt;/Directory&gt;</span></p>
  113. </li>
  114. <li>Press CTRL+O, Enter, CTRL+X to write the changes to owncloud.conf</li>
  115. <li>Continue with the following commands to enable the site and restart Apache:
  116. <div class="codeBlock"># enable the owncloud config<br />
  117. <span class="codeBlock">sudo a2ensite owncloud</span><br />
  118. # enable required apache modules<br />
  119. <span class="codeBlock">sudo a2enmod rewrite headers env mime unique_id dav</span><br />
  120. # restart apache2 service for the changes to take effect<br />
  121. <span class="codeBlock">sudo service apache2 restart</span></div>
  122. </li>
  123. <li>Open a web browser and navigate to http://DNSorIP/owncloud</li>
  124. <li>The ownCloud setup screen should be displayed</li>
  125. <li>Enter a username and password</li>
  126. <li>Click the storage &amp; database link to expand the section</li>
  127. <li>Select MySQL and fill out the database connection information as follows
  128. <p>username: <span class="codeBlock">owncloud_rw</span><br />
  129. password: <span class="codeBlock">ownCl0ud!!</span><br />
  130. database name: <span class="codeBlock">ownclouddb</span><br />
  131. database host: localhost</p>
  132. </li>
  133. <li>Click Finish Setup</li>
  134. <li>After a few <span style="display: none;"> </span>moments of setup ownCloud will be up and running</li>
  135. <li>Login with the username and password set on the previous screen</li>
  136. <li>Welcome to ownCloud running on WSL</li>
  137. </ol> </div>
  138. </div>
  139. </body>
  140. </html>