-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apache replaced by ngnix, http service descript and php now optional
- Loading branch information
1 parent
ac70155
commit 05b5a35
Showing
8 changed files
with
88 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,47 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
site=tiny-ssdp | ||
|
||
# apache | ||
site=tiny-ssdp.conf | ||
if [ -d "/etc/apache2/sites-available/" -a -d "/etc/apache2/sites-enabled/" ] | ||
# nginx | ||
if [ -d "/etc/nginx/sites-available/" ] | ||
then | ||
cp "/usr/lib/tiny-ssdp/apache2/$site" "/etc/apache2/sites-available/" | ||
cd "/etc/apache2/sites-enabled/" | ||
ln -sf "../sites-available/$site" . | ||
cp "/usr/lib/tiny-ssdp/nginx/$site" "/etc/nginx/sites-available/" | ||
#if [ -d "/etc/nginx/sites-enabled/" ] | ||
#then | ||
# cd "/etc/nginx/sites-enabled/" | ||
# ln -sf "../sites-available/$site" . | ||
# nginx=true | ||
#fi | ||
fi | ||
|
||
# apache2 | ||
if [ -d "/etc/apache2/sites-available/" ] | ||
then | ||
cp "/usr/lib/tiny-ssdp/apache2/$site.conf" "/etc/apache2/sites-available/" | ||
#if [ -d "/etc/apache2/sites-enabled/" ] | ||
#then | ||
# cd "/etc/apache2/sites-enabled/" | ||
# ln -sf "../sites-available/$site.conf" . | ||
# apache2=true | ||
#fi | ||
fi | ||
invoke-rc.d apache2 restart | ||
|
||
if which systemd > /dev/null | ||
then | ||
# configure and enable systemd | ||
cp -f "/usr/lib/tiny-ssdp/startup/tiny-ssdp.service" /etc/systemd/system/ | ||
systemctl enable tiny-ssdp.service | ||
systemctl start tiny-ssdp.service | ||
systemctl enable tiny-ssdp.service && systemctl start tiny-ssdp.service | ||
|
||
[ ! -z "$nginx" ] && systemctl reload nginx | ||
[ ! -z "$apache2" ] && systemctl restart apache2 | ||
else | ||
# configure and enable systemV-init | ||
cp -f "/usr/lib/tiny-ssdp/startup/tiny-ssdp" /etc/init.d/ | ||
update-rc.d -f tiny-ssdp defaults | ||
service tiny-ssdp start | ||
update-rc.d -f tiny-ssdp defaults && service tiny-ssdp start | ||
|
||
[ ! -z "$nginx" ] && invoke-rc.d nginx reload | ||
[ ! -z "$apache2" ] && invoke-rc.d apache2 restart | ||
fi | ||
|
||
exit 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,39 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
# nginx | ||
site=tiny-ssdp | ||
if [ -f "/etc/nginx/sites-enabled/$site" ] | ||
then | ||
nginx=true | ||
fi | ||
|
||
if [ -f "/etc/apache2/sites-available/$site.conf" ] | ||
then | ||
apache2=true | ||
fi | ||
|
||
# apache2 | ||
rm -f "/etc/apache2/sites-enabled/tiny-ssdp.conf" || : | ||
rm -f "/etc/apache2/sites-available/tiny-ssdp.conf" || : | ||
invoke-rc.d apache2 restart || : | ||
rm -f "/etc/nginx/sites-available/$site" | ||
rm -f "/etc/nginx/sites-enabled/$site" | ||
|
||
rm -f "/etc/apache2/sites-available/$site" | ||
rm -f "/etc/apache2/sites-enabled/$site" | ||
|
||
if which systemd > /dev/null | ||
then | ||
# remove sytemd | ||
systemctl disable tiny-ssdp.service | ||
rm -f "/etc/systemd/system/tiny-ssdp.service" || : | ||
# remove systemd | ||
systemctl is-active --quiet tiny-ssdp.service && systemctl disable tiny-ssdp.service | ||
rm -f "/etc/systemd/system/tiny-ssdp.service" | ||
|
||
[ ! -z "$nginx" ] && systemctl reload nginx | ||
[ ! -z "$apache2" ] && systemctl restart apache2 | ||
else | ||
# remove systemV-init | ||
update-rc.d -f tiny-ssdp remove | ||
rm -f "/etc/init.d/tiny-ssdp" || : | ||
# remove SystemV-init | ||
update-rc.d -f tiny-ssdp remove || : | ||
rm -f "/etc/init.d/tiny-ssdp" | ||
|
||
[ ! -z "$nginx" ] && invoke-rc.d nginx reload | ||
[ ! -z "$apache2" ] && invoke-rc.d apache2 restart | ||
fi | ||
|
||
exit 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
if which systemd > /dev/null | ||
then | ||
# stop systemd | ||
systemctl stop tiny-ssdp.service || : | ||
systemctl is-active --quiet tiny-ssdp.service && systemctl stop tiny-ssdp.service | ||
else | ||
# stop systemV-init | ||
service tiny-ssdp stop || : | ||
fi | ||
|
||
exit 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
server { | ||
server_name ssdp; | ||
root /usr/lib/tiny-ssdp/www/; | ||
index index.html index.php; | ||
autoindex off; | ||
server_tokens off; | ||
|
||
listen 1900 default_server; | ||
|
||
location ~ \.php$ { | ||
try_files $uri =404; | ||
fastcgi_split_path_info ^(.+\.php)(/.+)$; | ||
fastcgi_index index.php; | ||
fastcgi_read_timeout 60s; | ||
include fastcgi.conf; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_param PHP_ADMIN_VALUE session.cookie_secure=On; | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters