Update install.sh
This commit is contained in:
parent
333af0dd0a
commit
34895681a3
21
install.sh
21
install.sh
|
@ -9,6 +9,7 @@ MD_DIR="$WEBROOT/md"
|
|||
APACHE_CONF="/etc/apache2/sites-available/markdown.conf"
|
||||
SCRIPT_NAME="render.py"
|
||||
SCRIPT_PATH="$CGI_DIR/$SCRIPT_NAME"
|
||||
UPLOAD_USER="anon"
|
||||
|
||||
echo "==> Installing dependencies..."
|
||||
sudo apt update
|
||||
|
@ -93,7 +94,7 @@ EOF
|
|||
sudo tee "$MD_DIR/docs/tutorial.md" > /dev/null << EOF
|
||||
# Tutorial Page
|
||||
|
||||
This is a **nested Markdown file** inside `docs/`.
|
||||
This is a **nested Markdown file** inside \`docs/\`.
|
||||
EOF
|
||||
|
||||
echo "==> Creating Apache virtual host config..."
|
||||
|
@ -108,6 +109,11 @@ sudo tee "$APACHE_CONF" > /dev/null << EOF
|
|||
Require all granted
|
||||
</Directory>
|
||||
|
||||
<Directory $MD_DIR>
|
||||
Options +Indexes
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
Alias /markdown/ $WEBROOT/
|
||||
</VirtualHost>
|
||||
EOF
|
||||
|
@ -116,8 +122,15 @@ echo "==> Enabling site and restarting Apache..."
|
|||
sudo a2ensite markdown
|
||||
sudo systemctl reload apache2
|
||||
|
||||
echo "==> Granting FileZilla user 'anon' permission to upload to md/ folder..."
|
||||
sudo usermod -aG www-data $UPLOAD_USER
|
||||
sudo chown -R www-data:www-data "$MD_DIR"
|
||||
sudo chmod -R 775 "$MD_DIR"
|
||||
|
||||
echo ""
|
||||
echo "✅ Setup Complete!"
|
||||
echo "Open in your browser:"
|
||||
echo " Root file: http://localhost/cgi-bin/render.py?file=index.md"
|
||||
echo " Nested file: http://localhost/cgi-bin/render.py?file=docs/tutorial.md"
|
||||
echo "📁 Upload Markdown files to: /var/www/html/markdown/md/"
|
||||
echo "🖥️ View raw directory listing: http://localhost/markdown/md/"
|
||||
echo "🖥️ View root file: http://localhost/cgi-bin/render.py?file=index.md"
|
||||
echo "📄 View nested file: http://localhost/cgi-bin/render.py?file=docs/tutorial.md"
|
||||
echo "🧑 Log out and back in as '$UPLOAD_USER' to apply group changes if needed."
|
||||
|
|
Loading…
Reference in New Issue