brennan revised this gist 1 month ago. Go to revision
1 file changed, 289 insertions
otwa-windows.md(file created)
| @@ -0,0 +1,289 @@ | |||
| 1 | + | ## Ruby Installation | |
| 2 | + | ||
| 3 | + | ### Step 1: Download RubyInstaller | |
| 4 | + | ||
| 5 | + | 1. Go to [rubyinstaller.org](https://rubyinstaller.org/) | |
| 6 | + | 2. Download **Ruby+Devkit 3.4.6-1 (x64)** (or latest stable 3.4.x version) | |
| 7 | + | 3. Run the installer | |
| 8 | + | ||
| 9 | + | ### Step 2: Install Ruby | |
| 10 | + | ||
| 11 | + | 1. During installation, check these options: | |
| 12 | + | - **Add Ruby executables to your PATH** | |
| 13 | + | - **Associate .rb and .rbw files with this Ruby installation** | |
| 14 | + | 2. Install to the default location: `C:\Ruby34-x64` | |
| 15 | + | 3. After installation completes, leave the "Run 'ridk install'" checkbox checked | |
| 16 | + | 4. Click Finish | |
| 17 | + | ||
| 18 | + | ### Step 3: Install MSYS2 and Development Tools | |
| 19 | + | ||
| 20 | + | 1. A command window will open for MSYS2 installation | |
| 21 | + | 2. Enter `1` and press Enter to install MSYS2 base | |
| 22 | + | 3. Enter `2` and press Enter to install MSYS2 toolchain | |
| 23 | + | 4. Enter `3` and press Enter to install MSYS2 and MINGW development toolchain | |
| 24 | + | 5. When complete, press Enter to close the window | |
| 25 | + | ||
| 26 | + | ### Step 4: Verify Ruby Installation | |
| 27 | + | ||
| 28 | + | Open a new PowerShell window: | |
| 29 | + | ||
| 30 | + | ```powershell | |
| 31 | + | ruby --version | |
| 32 | + | gem --version | |
| 33 | + | ``` | |
| 34 | + | ||
| 35 | + | You should see Ruby 3.4.x and gem version numbers. | |
| 36 | + | ||
| 37 | + | ### Step 5: Install Bundler | |
| 38 | + | ||
| 39 | + | ```powershell | |
| 40 | + | gem install bundler -v 2.6.9 | |
| 41 | + | ``` | |
| 42 | + | ||
| 43 | + | ## Database Installation (MariaDB) | |
| 44 | + | ||
| 45 | + | ### Step 1: Download MariaDB | |
| 46 | + | ||
| 47 | + | 1. Go to [mariadb.org](https://mariadb.org/download/) | |
| 48 | + | 2. Select: | |
| 49 | + | - **Product**: MariaDB Server | |
| 50 | + | - **Version**: 10.5.4 (or latest 10.5.x) | |
| 51 | + | - **OS**: Windows | |
| 52 | + | - **Architecture**: x64 | |
| 53 | + | 3. Download the MSI installer | |
| 54 | + | ||
| 55 | + | ### Step 2: Install MariaDB | |
| 56 | + | ||
| 57 | + | 1. Run the MSI installer | |
| 58 | + | 2. Click **Next** through the welcome screen | |
| 59 | + | 3. Accept the license agreement and click **Next** | |
| 60 | + | 4. Choose **Custom** installation | |
| 61 | + | 5. Set installation path to: `C:\MariaDB` | |
| 62 | + | 6. Click **Next** → **Install** | |
| 63 | + | 7. During installation, you'll be prompted for configuration: | |
| 64 | + | - **Root password**: Enter a strong password (write it down!) | |
| 65 | + | - **Data directory**: Accept default `C:\Program Files\MariaDB 10.5\data` | |
| 66 | + | - **Port**: Accept default 3306 | |
| 67 | + | - **Service name**: Accept default MariaDB | |
| 68 | + | - **Run as service**: Check this box | |
| 69 | + | 8. Complete the installation | |
| 70 | + | ||
| 71 | + | ### Step 3: Verify MariaDB Installation | |
| 72 | + | ||
| 73 | + | Open Command Prompt as Administrator: | |
| 74 | + | ||
| 75 | + | ```cmd | |
| 76 | + | mysql --version | |
| 77 | + | ``` | |
| 78 | + | ||
| 79 | + | You should see MariaDB version information. | |
| 80 | + | ||
| 81 | + | ### Step 4: Test Database Connection | |
| 82 | + | ||
| 83 | + | ```cmd | |
| 84 | + | mysql -u root -p | |
| 85 | + | ``` | |
| 86 | + | ||
| 87 | + | Enter your root password. You should see the MariaDB prompt: | |
| 88 | + | ||
| 89 | + | ``` | |
| 90 | + | Welcome to the MariaDB monitor. Commands end with ; or \g. | |
| 91 | + | Your MariaDB connection id is 8 | |
| 92 | + | Server version: 10.5.4-MariaDB MariaDB Server | |
| 93 | + | ||
| 94 | + | Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. | |
| 95 | + | ||
| 96 | + | Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. | |
| 97 | + | ||
| 98 | + | MariaDB [(none)]> | |
| 99 | + | ``` | |
| 100 | + | ||
| 101 | + | Type `exit;` to leave the MariaDB prompt. | |
| 102 | + | ||
| 103 | + | ### Step 5: Create Database User | |
| 104 | + | ||
| 105 | + | ```cmd | |
| 106 | + | mysql -u root -p | |
| 107 | + | ``` | |
| 108 | + | ||
| 109 | + | At the MariaDB prompt, run: | |
| 110 | + | ||
| 111 | + | ```sql | |
| 112 | + | CREATE USER 'otwarchive'@'localhost' IDENTIFIED BY 'your_secure_password'; | |
| 113 | + | GRANT ALL PRIVILEGES ON *.* TO 'otwarchive'@'localhost'; | |
| 114 | + | FLUSH PRIVILEGES; | |
| 115 | + | EXIT; | |
| 116 | + | ``` | |
| 117 | + | ||
| 118 | + | ## Redis Installation | |
| 119 | + | ||
| 120 | + | Redis does not have an official Windows port, but we have two options: | |
| 121 | + | ||
| 122 | + | ### Option A: Use Memurai (Recommended for Windows) | |
| 123 | + | ||
| 124 | + | Memurai is a Redis-compatible server for Windows. | |
| 125 | + | ||
| 126 | + | 1. Download Memurai from [memurai.com](https://www.memurai.com/get-memurai) | |
| 127 | + | 2. Run the installer | |
| 128 | + | 3. Accept default installation location: `C:\Program Files\Memurai` | |
| 129 | + | 4. Complete the installation | |
| 130 | + | 5. Memurai will automatically start as a Windows service | |
| 131 | + | ||
| 132 | + | **Verify Memurai installation:** | |
| 133 | + | ```powershell | |
| 134 | + | redis-cli ping | |
| 135 | + | ``` | |
| 136 | + | ||
| 137 | + | You should see: `PONG` | |
| 138 | + | ||
| 139 | + | ## Elasticsearch Installation | |
| 140 | + | ||
| 141 | + | ### Step 1: Download Elasticsearch | |
| 142 | + | ||
| 143 | + | 1. Go to [elastic.co](https://www.elastic.co/downloads/elasticsearch) | |
| 144 | + | 2. Download **Elasticsearch 7.17.9** (Windows ZIP archive) | |
| 145 | + | - **Important**: Use version 7.17.x, not 8.x (gem compatibility) | |
| 146 | + | 3. Extract the ZIP to: `C:\Elasticsearch` | |
| 147 | + | ||
| 148 | + | ### Step 2: Configure Elasticsearch | |
| 149 | + | ||
| 150 | + | 1. Navigate to: `C:\Elasticsearch\config` | |
| 151 | + | 2. Open `elasticsearch.yml` in a text editor | |
| 152 | + | 3. Add or modify these settings: | |
| 153 | + | ||
| 154 | + | ```yaml | |
| 155 | + | cluster.name: skaia-library | |
| 156 | + | node.name: node-1 | |
| 157 | + | network.host: 127.0.0.1 | |
| 158 | + | http.port: 9200 | |
| 159 | + | discovery.type: single-node | |
| 160 | + | # Disable security features for simplicity | |
| 161 | + | xpack.security.enabled: false | |
| 162 | + | ``` | |
| 163 | + | ||
| 164 | + | 4. Save the file | |
| 165 | + | ||
| 166 | + | ### Step 3: Configure JVM Memory | |
| 167 | + | ||
| 168 | + | 1. Navigate to: `C:\Elasticsearch\config` | |
| 169 | + | 2. Open `jvm.options` in a text editor | |
| 170 | + | 3. Find and modify these lines (adjust based on your RAM): | |
| 171 | + | ||
| 172 | + | ```options | |
| 173 | + | -Xms1g | |
| 174 | + | -Xmx1g | |
| 175 | + | ``` | |
| 176 | + | ||
| 177 | + | For 16GB RAM, you can use 2GB: | |
| 178 | + | ```options | |
| 179 | + | -Xms2g | |
| 180 | + | -Xmx2g | |
| 181 | + | ``` | |
| 182 | + | ||
| 183 | + | 4. Save the file | |
| 184 | + | ||
| 185 | + | ### Step 4: Set JAVA_HOME | |
| 186 | + | ||
| 187 | + | Elasticsearch requires Java 11 or later. | |
| 188 | + | ||
| 189 | + | 1. Download and install [Amazon Corretto 11](https://docs.aws.amazon.com/corretto/latest/corretto-11-ug/downloads-list.html) or [Adoptium Temurin 11](https://adoptium.net/) | |
| 190 | + | 2. Run the installer with default settings | |
| 191 | + | 3. Set JAVA_HOME environment variable: | |
| 192 | + | - Press `Win + R`, type `sysdm.cpl`, press Enter | |
| 193 | + | - Click **Advanced** → **Environment Variables** | |
| 194 | + | - Under **System variables**, click **New** | |
| 195 | + | - Variable name: `JAVA_HOME` | |
| 196 | + | - Variable value: `C:\Program Files\Eclipse Adoptium\jdk-11.x.x-hotspot` (adjust to your installation path) | |
| 197 | + | - Click **OK** | |
| 198 | + | - Find **Path** variable, click **Edit** | |
| 199 | + | - Add: `%JAVA_HOME%\bin` | |
| 200 | + | - Click **OK** on all dialogs | |
| 201 | + | ||
| 202 | + | ### Step 5: Start Elasticsearch | |
| 203 | + | ||
| 204 | + | Open Command Prompt as Administrator: | |
| 205 | + | ||
| 206 | + | ```cmd | |
| 207 | + | cd C:\Elasticsearch\bin | |
| 208 | + | elasticsearch.bat | |
| 209 | + | ``` | |
| 210 | + | ||
| 211 | + | Elasticsearch will start and you'll see log output. Leave this window open for now. | |
| 212 | + | ||
| 213 | + | **Verify Elasticsearch is running:** | |
| 214 | + | Open a new PowerShell window: | |
| 215 | + | ||
| 216 | + | ```powershell | |
| 217 | + | curl http://localhost:9200 | |
| 218 | + | ``` | |
| 219 | + | ||
| 220 | + | You should see JSON output with cluster information. | |
| 221 | + | ||
| 222 | + | ### Step 6: Install Elasticsearch as Windows Service (Optional) | |
| 223 | + | ||
| 224 | + | To run Elasticsearch as a Windows service, you'll need to use a service wrapper like NSSM (Non-Sucking Service Manager): | |
| 225 | + | ||
| 226 | + | 1. Download NSSM from [nssm.cc](https://nssm.cc/download) | |
| 227 | + | 2. Extract to: `C:\nssm` | |
| 228 | + | 3. Open Command Prompt as Administrator: | |
| 229 | + | ```cmd | |
| 230 | + | cd C:\nssm | |
| 231 | + | nssm install Elasticsearch C:\Elasticsearch\bin\elasticsearch.bat | |
| 232 | + | nssm start Elasticsearch | |
| 233 | + | ``` | |
| 234 | + | ||
| 235 | + | ## Memcached Installation | |
| 236 | + | ||
| 237 | + | ### Step 1: Download Memcached | |
| 238 | + | ||
| 239 | + | 1. Download memcached from [releases.replicated.com](https://releases.replicated.com/memcached) or use a Windows port | |
| 240 | + | 2. Extract to: `C:\memcached` | |
| 241 | + | ||
| 242 | + | ### Option A: Use the Windows Port | |
| 243 | + | ||
| 244 | + | 1. Download from [allegro.com](https://allegro.com/) or search for "memcached windows" | |
| 245 | + | 2. Extract to: `C:\memcached` | |
| 246 | + | 3. Open Command Prompt as Administrator: | |
| 247 | + | ```cmd | |
| 248 | + | cd C:\memcached | |
| 249 | + | memcached.exe -d install | |
| 250 | + | memcached.exe -d start | |
| 251 | + | ``` | |
| 252 | + | ||
| 253 | + | ### Option B: Use Docker (Hybrid Approach) | |
| 254 | + | ||
| 255 | + | If you want to use Docker just for Memcached: | |
| 256 | + | ||
| 257 | + | ```powershell | |
| 258 | + | docker run -d -p 11211:11211 memcached:1.5 | |
| 259 | + | ``` | |
| 260 | + | ||
| 261 | + | For this guide, we'll assume Option A (native Windows). | |
| 262 | + | ||
| 263 | + | **Verify Memcached is running:** | |
| 264 | + | ```powershell | |
| 265 | + | telnet localhost 11211 | |
| 266 | + | ``` | |
| 267 | + | ||
| 268 | + | If connected, type `stats` and press Enter. You should see statistics. Press `Ctrl+]` then `quit` to exit. | |
| 269 | + | ||
| 270 | + | ## Node.js Installation | |
| 271 | + | ||
| 272 | + | Rails uses Node.js for JavaScript asset compilation. | |
| 273 | + | ||
| 274 | + | ### Step 1: Download Node.js | |
| 275 | + | ||
| 276 | + | 1. Go to [nodejs.org](https://nodejs.org/) | |
| 277 | + | 2. Download the **LTS** version (Long Term Support) | |
| 278 | + | 3. Run the installer | |
| 279 | + | ||
| 280 | + | ### Step 2: Install Node.js | |
| 281 | + | ||
| 282 | + | 1. Accept all default options | |
| 283 | + | 2. Complete the installation | |
| 284 | + | ||
| 285 | + | **Verify Node.js installation:** | |
| 286 | + | ```powershell | |
| 287 | + | node --version | |
| 288 | + | npm --version | |
| 289 | + | ``` | |
Newer
Older