mirror of
https://github.com/10h30/ols-docker-env.git
synced 2026-05-12 15:21:24 +09:00
modified: .travis/verify.sh
modified: README.md
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -o errexit
|
set -o errexit
|
||||||
|
EX_DM='example.com'
|
||||||
|
|
||||||
install_demo(){
|
install_demo(){
|
||||||
./bin/demosite.sh
|
./bin/demosite.sh
|
||||||
@@ -22,6 +23,7 @@ verify_page(){
|
|||||||
echo '[O] http://localhost:80/'
|
echo '[O] http://localhost:80/'
|
||||||
else
|
else
|
||||||
echo '[X] http://localhost:80/'
|
echo '[X] http://localhost:80/'
|
||||||
|
curl -sIk http://localhost:80/
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
curl -sIk https://localhost:443/ | grep -i WordPress
|
curl -sIk https://localhost:443/ | grep -i WordPress
|
||||||
@@ -29,6 +31,7 @@ verify_page(){
|
|||||||
echo '[O] https://localhost:443/'
|
echo '[O] https://localhost:443/'
|
||||||
else
|
else
|
||||||
echo '[X] https://localhost:443/'
|
echo '[X] https://localhost:443/'
|
||||||
|
curl -sIk https://localhost:443/
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -50,10 +53,65 @@ verify_phpadmin(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
verify_add_vh_wp(){
|
||||||
|
echo "Setup a WordPress site with ${EX_DM} domain"
|
||||||
|
bash bin/domain.sh --add "${EX_DM}"
|
||||||
|
bash bin/database.sh --domain "${EX_DM}"
|
||||||
|
bash bin/appinstall.sh --app wordpress --domain "${EX_DM}"
|
||||||
|
curl -sIk http://${EX_DM}:80/ --resolve ${EX_DM}:80:127.0.0.1 | grep -i WordPress
|
||||||
|
if [ ${?} = 0 ]; then
|
||||||
|
echo "[O] http://${EX_DM}:80/"
|
||||||
|
else
|
||||||
|
echo "[X] http://${EX_DM}:80/"
|
||||||
|
curl -sIk http://${EX_DM}:80/
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
verify_del_vh_wp(){
|
||||||
|
echo "Remove ${EX_DM} domain"
|
||||||
|
bash bin/domain.sh --del ${EX_DM}
|
||||||
|
if [ ${?} = 0 ]; then
|
||||||
|
echo "[O] ${EX_DM} VH is removed"
|
||||||
|
else
|
||||||
|
echo "[X] ${EX_DM} VH is not removed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Remove examplecom DataBase"
|
||||||
|
bash bin/database.sh --delete -DB examplecom
|
||||||
|
}
|
||||||
|
|
||||||
|
verify_owasp(){
|
||||||
|
echo 'Updating LSWS'
|
||||||
|
bash bin/webadmin.sh --upgrade 2>&1 /dev/null
|
||||||
|
echo 'Enabling OWASP'
|
||||||
|
bash bin/webadmin.sh --mod-secure enable
|
||||||
|
curl -sIk http://localhost:80/phpinfo.php | awk '/HTTP/ && /403/'
|
||||||
|
if [ ${?} = 0 ]; then
|
||||||
|
echo '[O] OWASP enable'
|
||||||
|
else
|
||||||
|
echo '[X] OWASP enable'
|
||||||
|
curl -sIk http://localhost:80/phpinfo.php | awk '/HTTP/ && /403/'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
bash bin/webadmin.sh --mod-secure disable
|
||||||
|
curl -sIk http://localhost:80/phpinfo.php | grep -i WordPress
|
||||||
|
if [ ${?} = 0 ]; then
|
||||||
|
echo '[O] OWASP disable'
|
||||||
|
else
|
||||||
|
echo '[X] OWASP disable'
|
||||||
|
curl -sIk http://localhost:80/phpinfo.php
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
main(){
|
main(){
|
||||||
verify_lsws
|
verify_lsws
|
||||||
verify_phpadmin
|
verify_phpadmin
|
||||||
install_demo
|
install_demo
|
||||||
verify_page
|
verify_page
|
||||||
|
verify_owasp
|
||||||
|
verify_add_vh_wp
|
||||||
|
verify_del_vh_wp
|
||||||
}
|
}
|
||||||
main
|
main
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
[<img src="https://img.shields.io/badge/slack-LiteSpeed-blue.svg?logo=slack">](litespeedtech.com/slack)
|
[<img src="https://img.shields.io/badge/slack-LiteSpeed-blue.svg?logo=slack">](litespeedtech.com/slack)
|
||||||
[<img src="https://img.shields.io/twitter/follow/litespeedtech.svg?label=Follow&style=social">](https://twitter.com/litespeedtech)
|
[<img src="https://img.shields.io/twitter/follow/litespeedtech.svg?label=Follow&style=social">](https://twitter.com/litespeedtech)
|
||||||
|
|
||||||
Install a lightweight WordPress container with OpenLiteSpeed Edge or Stable version based on Ubuntu 22.04 Linux.
|
Install a lightweight WordPress container with OpenLiteSpeed Edge or Stable version based on Ubuntu 24.04 Linux.
|
||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
1. [Install Docker](https://www.docker.com/)
|
1. [Install Docker](https://www.docker.com/)
|
||||||
|
|||||||
@@ -129,15 +129,15 @@ del_domain(){
|
|||||||
echo "# Domain non-exist! Check the ${LS_HTTPD_CONF} if you believe this is a mistake!"
|
echo "# Domain non-exist! Check the ${LS_HTTPD_CONF} if you believe this is a mistake!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
del_ls_domain ${1}
|
||||||
elif [ "${LSV}" = 'openlitespeed' ]; then
|
elif [ "${LSV}" = 'openlitespeed' ]; then
|
||||||
check_duplicate "member.*${DOMAIN}" ${OLS_HTTPD_CONF}
|
check_duplicate "member.*${DOMAIN}" ${OLS_HTTPD_CONF}
|
||||||
if [ "${CK_RESULT}" = '' ]; then
|
if [ "${CK_RESULT}" = '' ]; then
|
||||||
echo "# Domain non-exist! Check the ${OLS_HTTPD_CONF} if you believe this is a mistake!"
|
echo "# Domain non-exist! Check the ${OLS_HTTPD_CONF} if you believe this is a mistake!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
del_ols_domain ${1}
|
||||||
fi
|
fi
|
||||||
del_ls_domain ${1}
|
|
||||||
del_ols_domain ${1}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_input ${1}
|
check_input ${1}
|
||||||
|
|||||||
Reference in New Issue
Block a user