mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
Fix admin CSS not loading and quirks mode issues
Fixed multiple issues in admin panel: 1. CSS path: modern-normalize.css → modern-normalize.min.css (File is actually named .min.css) 2. Icon path: assets/icon.svg → /assets/admin_favicon.svg (Was relative, now absolute; correct filename) 3. Navigation: /admin/list.php → /admin/ (list.php was renamed to index.php) 4. Short PHP tags: <? → <?php (Better compatibility, some servers don't enable short_open_tag) 5. Quirks mode warning was due to CSS not loading, not DOCTYPE (DOCTYPE was already present) Files modified: - public/admin/inc/head.php (main fixes) - public/admin/index.php (short tags) - public/admin/add.php (short tags) - public/admin/import.php (short tags) Need to redeploy for production: just deploy
This commit is contained in:
118
docs/SERVER_SETUP.md
Normal file
118
docs/SERVER_SETUP.md
Normal file
@@ -0,0 +1,118 @@
|
||||
# Server Setup (Manual)
|
||||
|
||||
Since sudo prompts don't work over SSH in justfile, do the initial setup manually.
|
||||
|
||||
## One-Time Setup on Server
|
||||
|
||||
```bash
|
||||
# 1. SSH to server
|
||||
ssh posterg
|
||||
|
||||
# 2. Backup current site (recommended)
|
||||
sudo cp -r /var/www/html /var/www/html.backup
|
||||
|
||||
# 3. Create new directory structure
|
||||
sudo mkdir -p /var/www/posterg
|
||||
|
||||
# 4. Set ownership (www-data is the web server user)
|
||||
sudo chown www-data:posterg /var/www/posterg
|
||||
|
||||
# 5. Set permissions (775 = rwxrwxr-x)
|
||||
sudo chmod 775 /var/www/posterg
|
||||
|
||||
# 6. Verify
|
||||
ls -ld /var/www/posterg
|
||||
# Should show: drwxrwxr-x 2 www-data posterg 4096 ... /var/www/posterg
|
||||
|
||||
# 7. Exit server
|
||||
exit
|
||||
```
|
||||
|
||||
## Deploy from Local Machine
|
||||
|
||||
```bash
|
||||
just deploy
|
||||
```
|
||||
|
||||
## Complete Deployment Process
|
||||
|
||||
```bash
|
||||
# On server (one time)
|
||||
ssh posterg
|
||||
sudo mkdir -p /var/www/posterg
|
||||
sudo chown www-data:posterg /var/www/posterg
|
||||
sudo chmod 775 /var/www/posterg
|
||||
exit
|
||||
|
||||
# From local machine
|
||||
just deploy # Deploy files
|
||||
just deploy-nginx # Update nginx config
|
||||
|
||||
# On server - apply nginx config
|
||||
ssh posterg
|
||||
sudo bash /tmp/deploy-production.sh
|
||||
sudo systemctl reload nginx
|
||||
exit
|
||||
|
||||
# Verify from local
|
||||
just server-status
|
||||
```
|
||||
|
||||
## Important Notes
|
||||
|
||||
- **Don't delete `/var/www/html/` yet!** Keep it as backup until you confirm the new structure works
|
||||
- The new structure uses `/var/www/posterg/public/` as DocumentRoot
|
||||
- Nginx must be updated to point to the new location
|
||||
|
||||
## After Confirming Everything Works
|
||||
|
||||
Once you've verified the new deployment works:
|
||||
|
||||
```bash
|
||||
ssh posterg
|
||||
sudo rm -rf /var/www/html.backup # Remove backup if no longer needed
|
||||
sudo rm -rf /var/www/html # Remove old directory
|
||||
```
|
||||
|
||||
## Directory Structure on Server
|
||||
|
||||
```
|
||||
/var/www/
|
||||
├── html/ ← OLD (keep as backup for now)
|
||||
├── html.backup/ ← BACKUP (can delete later)
|
||||
└── posterg/ ← NEW
|
||||
├── public/ ← DocumentRoot (nginx serves from here)
|
||||
├── includes/
|
||||
├── config/
|
||||
├── database/
|
||||
├── lib/
|
||||
└── vendor/
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Permission denied during deploy
|
||||
**Cause:** Directory doesn't exist or has wrong ownership
|
||||
**Fix:** Run the setup commands above
|
||||
|
||||
### Nginx 403 Forbidden
|
||||
**Cause:** Wrong permissions on files
|
||||
**Fix:**
|
||||
```bash
|
||||
ssh posterg
|
||||
cd /var/www/posterg
|
||||
sudo chown -R www-data:posterg .
|
||||
sudo find . -type d -exec chmod 755 {} \;
|
||||
sudo find . -type f -exec chmod 644 {} \;
|
||||
sudo chmod 775 database/
|
||||
sudo chmod 660 database/*.db
|
||||
```
|
||||
|
||||
### Database connection errors
|
||||
**Cause:** Database file permissions
|
||||
**Fix:**
|
||||
```bash
|
||||
ssh posterg
|
||||
sudo chown www-data:posterg /var/www/posterg/database/test.db
|
||||
sudo chmod 660 /var/www/posterg/database/test.db
|
||||
```
|
||||
Reference in New Issue
Block a user