108 lines
3.4 KiB
Markdown
108 lines
3.4 KiB
Markdown
# Windows Setup Guide for UK Data Services Website
|
|
|
|
## Quick Setup with XAMPP (Recommended)
|
|
|
|
### Step 1: Install XAMPP
|
|
1. Download XAMPP from: https://www.apachefriends.org/download.html
|
|
2. Choose "XAMPP for Windows" (latest version with PHP 8.1+)
|
|
3. Run the installer as Administrator
|
|
4. Install to default location: `C:\xampp`
|
|
5. During installation, select: Apache, PHP, MySQL (others optional)
|
|
|
|
### Step 2: Setup Website Files
|
|
1. Navigate to: `C:\xampp\htdocs\`
|
|
2. Create a new folder called: `ukdataservices`
|
|
3. Copy ALL files from your `ukdataservices-new` folder into: `C:\xampp\htdocs\ukdataservices\`
|
|
|
|
Your structure should look like:
|
|
```
|
|
C:\xampp\htdocs\ukdataservices\
|
|
├── index.php
|
|
├── quote.php
|
|
├── case-studies.php
|
|
├── about.php
|
|
├── contact-handler.php
|
|
├── quote-handler.php
|
|
├── .htaccess
|
|
├── assets\
|
|
│ ├── css\
|
|
│ ├── js\
|
|
│ └── images\
|
|
└── logs\ (will be created automatically)
|
|
```
|
|
|
|
### Step 3: Configure Apache
|
|
1. Open `C:\xampp\apache\conf\httpd.conf` in a text editor
|
|
2. Find the line: `#LoadModule rewrite_module modules/mod_rewrite.so`
|
|
3. Remove the `#` to enable URL rewriting: `LoadModule rewrite_module modules/mod_rewrite.so`
|
|
4. Save the file
|
|
|
|
### Step 4: Start Services
|
|
1. Open XAMPP Control Panel (run as Administrator)
|
|
2. Click "Start" next to Apache
|
|
3. Apache should show as "Running" with green highlighting
|
|
4. If you get port conflicts, click "Config" → "Apache (httpd.conf)" and change port from 80 to 8080
|
|
|
|
### Step 5: Test Your Website
|
|
1. Open web browser
|
|
2. Go to: `http://localhost/ukdataservices/`
|
|
3. You should see your professional UK Data Services homepage
|
|
|
|
### Step 6: Enable Email Functionality (Optional)
|
|
To test contact forms, you'll need to configure email:
|
|
|
|
1. Edit `C:\xampp\php\php.ini`
|
|
2. Find the [mail function] section
|
|
3. Configure SMTP settings or use a service like MailHog for testing
|
|
|
|
## Alternative: Quick PHP Server (No Installation)
|
|
|
|
If you have PHP installed:
|
|
1. Open Command Prompt
|
|
2. Navigate to your website folder: `cd C:\Users\Peter\Desktop\ukdataservices-new`
|
|
3. Run: `php -S localhost:8000`
|
|
4. Access via: `http://localhost:8000`
|
|
|
|
## Troubleshooting
|
|
|
|
### Apache Won't Start
|
|
- **Port 80 in use**: Change Apache port to 8080 in httpd.conf
|
|
- **Skype conflict**: Disable Skype's use of port 80/443
|
|
- **Windows firewall**: Allow Apache through firewall
|
|
|
|
### .htaccess Issues
|
|
- Enable mod_rewrite in Apache configuration
|
|
- Check file permissions on .htaccess
|
|
|
|
### PHP Errors
|
|
- Enable error reporting in php.ini: `display_errors = On`
|
|
- Check PHP error log in XAMPP control panel
|
|
|
|
### File Permissions
|
|
- Ensure the `logs` folder is writable
|
|
- Run XAMPP as Administrator if needed
|
|
|
|
## Production Deployment
|
|
|
|
When ready to go live:
|
|
1. Purchase web hosting with PHP 7.4+ and Apache
|
|
2. Upload all files via FTP/cPanel
|
|
3. Update email addresses in contact-handler.php and quote-handler.php
|
|
4. Install SSL certificate
|
|
5. Update .htaccess to force HTTPS
|
|
|
|
## Performance Tips
|
|
|
|
- Enable OpCache in PHP for better performance
|
|
- Use compression in Apache (.htaccess already configured)
|
|
- Optimize images if you replace the SVG placeholders
|
|
- Monitor the logs folder for form submissions
|
|
|
|
## Security Notes
|
|
|
|
- The website includes security headers and input validation
|
|
- Rate limiting is implemented for forms
|
|
- Change default passwords if using MySQL
|
|
- Keep PHP and Apache updated
|
|
|
|
Your website is now ready to run locally for testing and development! |