> For the complete documentation index, see [llms.txt](https://docs.xenoraa.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xenoraa.com/xenoraa-super-admin-operations-manual/system-administration-seo-and-staff-management.md).

# System Administration, SEO & Staff Management

## System Administration, SEO, & Staff Management

Managing the infrastructure, security, search engine visibility, and internal administrative staff is critical to maintaining a secure and high-performing platform. This chapter covers staff roles, global SEO settings, system log auditing, and post-deployment procedures.

***

### 1. Administrative Staff & Role-Based Access Control

The Staff Management module (`/superadmin/staff`) allows you to invite and manage internal administrative staff (e.g., support agents, developers, content managers) and assign them specific permissions.

#### Core Staff Roles & Permissions

| Role                | Dashboard Access |    Users/Tenants   | Billing & Plans | SEO & Settings | System Logs |
| ------------------- | :--------------: | :----------------: | :-------------: | :------------: | :---------: |
| **Super Admin**     |       Full       |        Full        |       Full      |      Full      |     Full    |
| **Developer**       |       Full       |      View Only     |    View Only    |      Full      |     Full    |
| **Support Agent**   |       Full       | Full (Impersonate) |    View Only    |    View Only   |  View Only  |
| **Content Manager** |       Full       |      View Only     |    View Only    |    SEO Only    |  View Only  |

#### Workflow: Inviting a New Staff Member

1. Navigate to **Staff Directory** (`/superadmin/staff`).
2. Click **Invite Staff Member** (`/superadmin/staff/create`).
3. Enter their name, email, and select their **Role** (Super Admin, Developer, Support Agent, Content Manager).
4. Click **Send Invitation**. The system will send an automated invitation email with a secure registration link.
5. Once registered, they will appear in the **Staff List** where you can manage, edit, or revoke their access at any time.

***

### 2. Search Engine Optimization (SEO) & Marketing

You can manage global SEO metadata, sitemaps, and public marketing pages directly from the Super Admin panel to ensure Xenoraa ranks highly on search engines.

#### Workflow: Updating Global SEO Metadata

1. Navigate to **SEO Manager** (`/superadmin/seo`).
2. **Edit Metadata:** Update the Meta Title, Meta Description, and Open Graph (OG) Image for the public homepage and marketing pages.
3. **Configure Sitemaps:** Click **Regenerate Sitemap** to automatically compile all public blog posts, showcase pages, and marketing URLs into a search-engine-friendly XML sitemap.
4. **Configure Analytics:** Paste your Google Analytics or Facebook Pixel tracking IDs in the **Analytics Integration** field.
5. Click **Save SEO Settings**. The public pages update instantly with the new metadata.

***

### 3. Infrastructure Auditing & System Logs

When debugging application issues, performance bottlenecks, or security incidents, the Super Admin log viewer is your primary tool.

#### Workflow: Auditing Application Logs

1. Navigate to **System Logs** (`/superadmin/logs`).
2. The log viewer aggregates:
   * **Laravel Application Logs:** (`storage/logs/laravel.log`) for PHP exceptions and application errors.
   * **Nginx Access & Error Logs:** For web server traffic and routing issues.
   * **Queue Worker Logs:** For Supervisor background job processing status.
3. Use the **Search Bar** to filter by keywords (e.g., `Exception`, `500`, `SQLSTATE`).
4. Select a log entry to view the full stack trace and request context.

***

### 4. Post-Deployment Checklist

Whenever changes are made to the production server (e.g., pulling code from GitHub, running migrations, or updating middleware), you must run the following commands in sequence to ensure peak performance and clear all caches:

```bash
# 1. Pull latest code
cd /var/www/gopi.blog/gopi-portfolio
git pull origin main

# 2. Run database migrations
php artisan migrate --force

# 3. Clear and rebuild all application caches
php artisan view:clear
php artisan config:cache
php artisan route:cache
php artisan view:cache

# 4. Restart PHP-FPM to clear OPcache (CRITICAL)
systemctl restart php8.3-fpm
```

> **Why is PHP-FPM restart critical?** Xenoraa uses a high-performance PHP OPcache configuration. When PHP files (especially middleware or service providers) are updated, the compiled code is cached in memory. Restarting PHP-FPM forces the server to reload and compile the updated PHP files immediately, preventing stale code execution and 500/404 errors.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xenoraa.com/xenoraa-super-admin-operations-manual/system-administration-seo-and-staff-management.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
