Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing sudo & Make apache better #111

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/guides/ssl.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,10 @@ These tutorials briefly cover creating a new SSL certificates for your panel and

```sh
# Set ownership of the `.secrets.env` file to `caddy` system user
chown caddy:caddy /etc/caddy/.secrets.env
sudo chown caddy:caddy /etc/caddy/.secrets.env

# Set read-write permissions only to owner - the `caddy` system user
chmod 0600 /etc/caddy/.secrets.env
sudo chmod 0600 /etc/caddy/.secrets.env
```

Modify the systemd unit file, to load environment variables from file (add `--envfile /etc/caddy/.secrets.env` flag to `ExecStart`), the default systemd unit file location is `/etc/systemd/system/caddy.service`:
Expand Down
2 changes: 1 addition & 1 deletion docs/panel/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The first step in this process is to create the folder where the panel will live
newly created folder.

```sh
mkdir -p /var/www/pelican
sudo mkdir -p /var/www/pelican
cd /var/www/pelican
```

Expand Down
112 changes: 56 additions & 56 deletions docs/panel/panel-setup.mdx
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
import Admonition from '@theme/Admonition';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Panel Setup
The core environment is easily configured using a single CLI command & the web installer built into the app.
These steps will cover setting up things such as sessions, caching, database credentials, and email sending.
Running `php artisan p:environment:setup` will, if it does not exist, auto create the required `.env` file and generate a `APP_KEY`.
```sh
php artisan p:environment:setup
```
<Admonition type="warning" title="BACK UP APP_KEY!">
**Back up** your encryption key (APP_KEY in the `.env` file). This is used as an encryption key for all data that needs to be stored securely (e.g. api keys).
Store it somewhere safe - not just on your server. If you lose it all encrypted data is irrecoverable -- **even if you have database backups.**
</Admonition>
### Setting Permissions
The next step in the installation process is to set the correct permissions on the Panel files so that the webserver can
use them correctly.
```sh
chmod -R 755 storage/* bootstrap/cache/
```
<Tabs groupId="webserver">
<TabItem value='NGINX/Apache/Caddy'>
```sh
chown -R www-data:www-data /var/www/pelican
```
</TabItem>
<TabItem value='Rocky Linux NGINX'>
```sh
chown -R nginx:nginx /var/www/pelican
```
</TabItem>
<TabItem value='Rocky Linux Apache'>
```sh
chown -R apache:apache /var/www/pelican
```
</TabItem>
</Tabs>
### Web-Installer
Once you've set the proper permissions, continue the Panel install on the web interface.
The web installer is located at `<domain>/installer` or `<ip>/installer`.
<Admonition type="info" title="Want something advanced?">
Make sure to read the [MySQL guide](./advanced/mysql) first if you want to use MySQL/ MariaDB instead of SQLite!
If you want to use Redis make sure to read the [Redis guide](./advanced/redis) first.
</Admonition>
import Admonition from '@theme/Admonition';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Panel Setup

The core environment is easily configured using a single CLI command & the web installer built into the app.
These steps will cover setting up things such as sessions, caching, database credentials, and email sending.

Running `php artisan p:environment:setup` will, if it does not exist, auto create the required `.env` file and generate a `APP_KEY`.

```sh
php artisan p:environment:setup
```

<Admonition type="warning" title="BACK UP APP_KEY!">
**Back up** your encryption key (APP_KEY in the `.env` file). This is used as an encryption key for all data that needs to be stored securely (e.g. api keys).
Store it somewhere safe - not just on your server. If you lose it all encrypted data is irrecoverable -- **even if you have database backups.**
</Admonition>

### Setting Permissions

The next step in the installation process is to set the correct permissions on the Panel files so that the webserver can
use them correctly.

```sh
sudo chmod -R 755 storage/* bootstrap/cache/
```

<Tabs groupId="webserver">
<TabItem value='NGINX/Apache/Caddy'>
```sh
sudo chown -R www-data:www-data /var/www/pelican
```
</TabItem>
<TabItem value='Rocky Linux NGINX'>
```sh
sudo chown -R nginx:nginx /var/www/pelican
```
</TabItem>
<TabItem value='Rocky Linux Apache'>
```sh
sudo chown -R apache:apache /var/www/pelican
```
</TabItem>
</Tabs>

### Web-Installer

Once you've set the proper permissions, continue the Panel install on the web interface.
The web installer is located at `<domain>/installer` or `<ip>/installer`.

<Admonition type="info" title="Want something advanced?">
Make sure to read the [MySQL guide](./advanced/mysql) first if you want to use MySQL/ MariaDB instead of SQLite!
If you want to use Redis make sure to read the [Redis guide](./advanced/redis) first.
</Admonition>
10 changes: 5 additions & 5 deletions docs/panel/update.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Proceeds to download the latest release, extracts to install directory, Sets som
If you do not wish to use the script and wish to do it manually, You can delete everything except the `.env` and the sqlite database file, if using sqlite. then follow the standard update process below.

```sh
bash <(curl -s https://pelican.dev/updatePanel.sh)
sudo bash <(curl -s https://pelican.dev/updatePanel.sh)
```

</Admonition>
Expand All @@ -61,7 +61,7 @@ Once the archive is downloaded and extracted we need to set the correct permissi
any webserver related errors.

```sh
chmod -R 755 storage/* bootstrap/cache
sudo chmod -R 755 storage/* bootstrap/cache
```

### Update Dependencies
Expand Down Expand Up @@ -110,17 +110,17 @@ is `www-data` but can vary from system to system &mdash; sometimes being `nginx`
<Tabs className="unique-tabs">
<TabItem value="NGINX/Apache">
```sh
chown -R www-data:www-data /var/www/pelican
sudo chown -R www-data:www-data /var/www/pelican
```
</TabItem>
<TabItem value="Rocky Linux NGINX">
```sh
chown -R nginx:nginx /var/www/pelican
sudo chown -R nginx:nginx /var/www/pelican
```
</TabItem>
<TabItem value="Rocky Linux Apache">
```sh
chown -R apache:apache /var/www/pelican
sudo chown -R apache:apache /var/www/pelican
```
</TabItem>
</Tabs>
Expand Down
18 changes: 13 additions & 5 deletions docs/panel/webserver-config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import TabItem from '@theme/TabItem';
</Admonition>
First, remove the default NGINX configuration.
```sh
rm /etc/nginx/sites-enabled/default
sudo rm /etc/nginx/sites-enabled/default
```
Now, you should paste the contents of the file below, replacing `<domain>` with your domain or IP being used in a file called
`pelican.conf` and place the file in `/etc/nginx/sites-available/`.
Expand Down Expand Up @@ -228,10 +228,17 @@ import TabItem from '@theme/TabItem';
### Enabling Configuration

Once you've created the file above, simply run the commands below.

<Admonition type="warning" title="php & fpm">
If you're **not** using php8.3, you will need to edit the command to point to enable the correct mod.

The line is highlighted below.
</Admonition>

```sh
sudo ln -s /etc/apache2/sites-available/pelican.conf /etc/apache2/sites-enabled/pelican.conf
```sh {3}
sudo a2ensite pelican.conf
sudo a2enmod rewrite
sudo a2enmod php8.3
```

#### You need to restart apache to load the new config file.
Expand All @@ -250,7 +257,7 @@ import TabItem from '@theme/TabItem';
First, remove the default Caddy configuration.

```sh
rm /etc/caddy/Caddyfile
sudo rm /etc/caddy/Caddyfile
```

The config file path is `/etc/caddy/`.
Expand Down Expand Up @@ -365,10 +372,11 @@ import TabItem from '@theme/TabItem';
```
</TabItem>
</Tabs>
### Enabling Configuration
The final step is to restart Caddy.

```sh
systemctl restart caddy
sudo systemctl restart caddy
```
</TabItem>
</Tabs>
8 changes: 4 additions & 4 deletions docs/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ tail -n 1000 /var/www/pelican/storage/logs/laravel-$(date +%F).log | grep "\[$(d
```

If the command above doesn't return anything you most likely have wrong permissions for your `storage` folder. So you first need to fix that.
You can set the correct permissions by running `chmod -R 755 /var/www/pelican/storage/* /var/www/pelican/bootstrap/cache/`. Also make sure that your panel files are owned by the correct user.
You can set the correct permissions by running `sudo chmod -R 755 /var/www/pelican/storage/* /var/www/pelican/bootstrap/cache/`. Also make sure that your panel files are owned by the correct user.

<Tabs groupId="webserver">
<TabItem value='NGINX/Apache'>
```sh
chown -R www-data:www-data /var/www/pelican
sudo chown -R www-data:www-data /var/www/pelican
```
</TabItem>
<TabItem value='Rocky Linux NGINX'>
```sh
chown -R nginx:nginx /var/www/pelican
sudo chown -R nginx:nginx /var/www/pelican
```
</TabItem>
<TabItem value='Rocky Linux Apache'>
```sh
chown -R apache:apache /var/www/pelican
sudo chown -R apache:apache /var/www/pelican
```
</TabItem>
</Tabs>
Expand Down
2 changes: 1 addition & 1 deletion docs/wings/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,5 @@ WantedBy=multi-user.target
Then, run the commands below to reload systemd and start Wings.

```sh
systemctl enable --now wings
sudo systemctl enable --now wings
```
2 changes: 1 addition & 1 deletion docs/wings/update.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Updating Wings is a painless process and should take less than a minute to compl

```sh
sudo wings update
systemctl restart wings
sudo systemctl restart wings
```

</Admonition>
Expand Down
4 changes: 2 additions & 2 deletions static/updatePanel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,13 @@ chmod_command="chmod -R 755 storage/* bootstrap/cache"
eval $chmod_command
if [ $? -ne 0 ]; then
echo "Failed to run chmod, Please run the following commands manually:"
echo "$chmod_command"
echo "sudo $chmod_command"
fi
chown_command="chown -R $owner:$group $install_dir"
eval $chown_command
if [ $? -ne 0 ]; then
echo "Failed to run chown, Please run the following commands manually:"
echo "$chown_command"
echo "sudo $chown_command"
fi

php artisan queue:restart
Expand Down