-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnetminHTTPD
More file actions
45 lines (39 loc) · 1.04 KB
/
netminHTTPD
File metadata and controls
45 lines (39 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
clear
tput cup 10 30
echo -n "Enter the ipaddress: "
read ip
tput cup 11 30
echo -n "Enter the servername"
read name
tput cup 12 30
echo -n "Enter Document Root"
read root
tput cup 13 30
echo "select default port or specified one"
tput cup 14 30
echo "1.default"
tput cup 15 30
echo "2.selected"
tput cup 16 30
echo "3.any"
read choice
case $choice in
1)
echo "<VirtualHost $ip>">>/etc/httpd/conf/httpd.conf
echo "DocumentRoot \"$root\"">>/etc/httpd/conf/httpd.conf
echo "ServerName $name">>/etc/httpd/conf/httpd.conf
echo "</VirtualHost>">>/etc/httpd/conf/httpd.conf;;
2)
echo "enter port"
read port
echo "<VirtualHost $ip:$port>">>/etc/httpd/conf/httpd.conf
echo "DocumentRoot \"$root\"">>/etc/httpd/conf/httpd.conf
echo "ServerName $name">>/etc/httpd/conf/httpd.conf
echo "</VirtualHost>">>/etc/httpd/conf/httpd.conf;;
3)
echo "<VirtualHost $ip:*>">>/etc/httpd/conf/httpd.conf
echo "DocumentRoot \"$root\"">>/etc/httpd/conf/httpd.conf
echo "ServerName $name">>/etc/httpd/conf/httpd.conf
echo "</VirtualHost>">>/etc/httpd/conf/httpd.conf;;
esac