{"id":21896745,"url":"https://github.com/matteomorreale/secure-wp-installation-litespeed","last_synced_at":"2026-05-21T07:02:05.502Z","repository":{"id":265115003,"uuid":"895184297","full_name":"matteomorreale/secure-wp-installation-litespeed","owner":"matteomorreale","description":"This script allows you to create a custom User for your LiteSpeed server and automatically assign files and permissions, so that the WP installation is isolated from the others in a shared environment","archived":false,"fork":false,"pushed_at":"2024-11-27T18:05:14.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-27T05:51:17.453Z","etag":null,"topics":["litespeed","litespeed-web-server","openlitespeed","wordpress","wordpress-site"],"latest_commit_sha":null,"homepage":"https://matteomorreale.it","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matteomorreale.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-27T17:58:08.000Z","updated_at":"2024-11-27T18:07:12.000Z","dependencies_parsed_at":"2024-11-27T19:33:41.555Z","dependency_job_id":null,"html_url":"https://github.com/matteomorreale/secure-wp-installation-litespeed","commit_stats":null,"previous_names":["matteomorreale/secure-wp-installation-litespeed"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matteomorreale%2Fsecure-wp-installation-litespeed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matteomorreale%2Fsecure-wp-installation-litespeed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matteomorreale%2Fsecure-wp-installation-litespeed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matteomorreale%2Fsecure-wp-installation-litespeed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matteomorreale","download_url":"https://codeload.github.com/matteomorreale/secure-wp-installation-litespeed/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244907456,"owners_count":20529867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["litespeed","litespeed-web-server","openlitespeed","wordpress","wordpress-site"],"created_at":"2024-11-28T14:12:01.117Z","updated_at":"2026-05-21T07:02:00.483Z","avatar_url":"https://github.com/matteomorreale.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WordPress Permission Configuration Script for OpenLiteSpeed\n\nThis script automates the setup of permissions for WordPress installations on OpenLiteSpeed servers to ensure that one installation cannot access another one's.\n\n---\n\n## Prerequisites\n\n- Ensure you have OpenLiteSpeed installed and running.\n- Verify that you have root or sudo privileges to execute the commands.\n- Replace all occurrences of **`yourusername`** with your actual username on the server.\n\n---\n\n## Notes\n\n- Replace **`yourusername`** in the script where necessary to match your server's setup.\n- Verify that your Virtual Host is **not using a template** before applying the suEXEC settings, if so instantiate if first.\n\n---\n\n## Features\n\n- Automatically creates a system user and group for each WordPress site.\n- Assigns proper permissions to `public`, `wp-content/cache`, and `wp-content/uploads` directories.\n- Ensures compatibility with OpenLiteSpeed's **suEXEC User** and **suEXEC Group** settings for enhanced security.\n\n---\n\n## Usage\n\n1. **Download the Script**  \n   Save the script to your server, e.g., `/usr/local/lsws/scripts/wp_permission_config.sh`.\n\n2. **Run the Script**  \n   ```bash\n   sudo bash wp_permission_config.sh \u003cfolder_name\u003e\n   ```\n   Replace `\u003cfolder_name\u003e` with the name of the WordPress installation folder, e.g., `example-site`.\n\n3. **Update OpenLiteSpeed Virtual Host Settings**  \n   - Log in to the OpenLiteSpeed Web Admin Panel.\n   - Navigate to the **Virtual Hosts** section.\n   - Select the Virtual Host where your WordPress site is hosted.\n   - Go to **Basic \u003e Security**.\n   - In the **suEXEC User** and **suEXEC Group** fields, enter:\n     - The **username** created by the script.\n     - The **group name** created by the script.\n   - Save changes and restart the server.\n\n   ⚠️ **Important:**  \n   - This method is **only applicable to single Virtual Hosts**.  \n   - If you're using a Virtual Host Template, instantiate a single Virtual Host from the template before applying these changes.\n\n4. **Restore .htaccess (Optional)**  \n   If necessary, replace the `.htaccess` file in the `public` directory with the default WordPress `.htaccess` content.\n\n---\n\n## Example\n\n### Script Execution\n```bash\nsudo chmod +x wp_permission_config.sh\nsudo bash wp_permission_config.sh example-site\n```\n\n- The script will create a user and group based on the folder name.  \n  Example:\n  - User: `example-site`\n  - Group: `example-site-\u003chash\u003e`\n\n### Virtual Host Configuration\n- In the OpenLiteSpeed Admin Panel:\n  - **suEXEC User**: `example-site`\n  - **suEXEC Group**: `example-site-\u003chash\u003e`\n\n---\n\n## License\n\nThis script is provided under the MIT License. Use at your own risk. Contributions are welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatteomorreale%2Fsecure-wp-installation-litespeed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatteomorreale%2Fsecure-wp-installation-litespeed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatteomorreale%2Fsecure-wp-installation-litespeed/lists"}