-
Notifications
You must be signed in to change notification settings - Fork 0
/
fastbsd
95 lines (86 loc) · 2.52 KB
/
fastbsd
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/sh
if [ $(id -u) != "0" ]; then
echo "Error: You must be root to run this script"
exit 1
fi
echo "========================================================================="
echo "FREEBSD APACHE PHP SETUP"
echo "========================================================================="
export PACKAGESITE=http://cvsup10.tw.freebsd.org/FreeBSD/ports/i386/packages-9.0-release/Latest/
if [ -s .install ]; then
echo "UPDATING"
else
echo "install">.install
echo 'apache_enable="YES"'>>/etc/rc.conf
echo 'mysql_enable="YES"'>>/etc/rc.conf
echo 'memcached_enable="YES"'>>/etc/rc.conf
echo 'mongod_enable="YES"'>>/etc/rc.conf
pkg_add -r autoconf268 pcre libmemcached mysql55-server memcached mongodb subversion libxml2 oniguruma curl mcrypt freetype jpeg png kbproto libICE libSM libX11 xextproto printproto libXext libXp libXt libXmu libXpm libXaw
fetch http://7shell.googlecode.com/svn/loader.conf
mv loader.conf /boot/defaults/
kldload accf_http
fi
if [ -s up.tar.gz ]; then
echo "apache + php [found]"
tar zxvf up.tar.gz
else
echo "Error: up.tar.gz not found!!!download now......"
fetch http://7shell.googlecode.com/svn/freebsd/up.tar.gz
tar zxvf up.tar.gz
fi
if [ -s apache.tar.gz ]; then
echo "apache [found]"
tar zxvf apache.tar.gz
else
echo "Error: apache.tar.gz not found!!!download now......"
tar zxvf up.tar.gz
tar zxvf apache.tar.gz
fi
if [ -s php.tar.gz ]; then
echo "php [found]"
tar zxvf php.tar.gz
else
echo "Error: php.tar.gz not found!!!download now......"
fetch http://7shell.googlecode.com/svn/freebsd/up.tar.gz
tar zxvf up.tar.gz
tar zxvf php.tar.gz
fi
if [ -s apr.tar.gz ]; then
echo "apr [found]"
tar zxvf apr.tar.gz
else
echo "Error: apr-1.4.6.tar.gz not found!!!download now......"
fetch http://7shell.googlecode.com/svn/freebsd/apr.tar.gz
tar zxvf apr.tar.gz
fi
if [ -s /usr/local/apr ];then
rm -rf /usr/local/apr
fi
mv apr /usr/local/
if [ -s /usr/local/apache ];then
rm -rf /usr/local/apache
fi
mv apache /usr/local/
if [ -s /usr/local/php ];then
rm -rf /usr/local/php
fi
mv php /usr/local/
mkdir -p /var/www
chown -R www:www /var/www
echo "<?php phpinfo();?>">/var/www/index.php
if [ -s /usr/local/etc/rc.d/apache ]; then
rm /usr/local/etc/rc.d/apache
fi
mv apache2 /usr/local/etc/rc.d/apache
chmod +x /usr/local/etc/rc.d/apache
fetch http://7shell.googlecode.com/svn/my.cnf
mv my.cnf /var/db/mysql/
pkill -9 httpd
pkill -9 mysqld
pkill -9 memcached
pkill -9 mongod
service apache start
service mysql-server start
service memcached start
service mongod start
rm *.gz