diff options
Diffstat (limited to 'httpd/httpd_vhost.sh')
-rwxr-xr-x | httpd/httpd_vhost.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/httpd/httpd_vhost.sh b/httpd/httpd_vhost.sh new file mode 100755 index 0000000..2021e9f --- /dev/null +++ b/httpd/httpd_vhost.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# A small Apache HTTPd test suite +# Author: Athmane Madjoudj <athmane@fedoraproject.org> + +echo "Running $0 - httpd virtual host test." + +echo "127.0.0.1 test" >> /etc/hosts +cat > /etc/httpd/conf.d/vhost-test.conf <<EOF +NameVirtualHost *:80 + +<VirtualHost *:80> + ServerAdmin webmaster@test + DocumentRoot /var/www/vhosts/test/ + ServerName test +</VirtualHost> +EOF + +mkdir -p /var/www/vhosts/test/ +echo "Virtual Host Test Page" > /var/www/vhosts/test/index.html +service httpd reload +curl -s http://test/ | grep 'Virtual Host Test Page' > /dev/null 2>&1 + |