-
Notifications
You must be signed in to change notification settings - Fork 1
/
ubuntu_server.bash
149 lines (83 loc) · 2.62 KB
/
ubuntu_server.bash
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#ubuntu server 12.04
apt-get update
apt-get -y upgrade
apt-get install -y python-software-properties
add-apt-repository -y ppa:ondrej/php5
apt-get update
apt-get install -y php5 apache2 php-pear
apt-get install -y graphviz
#install mariadb
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
add-apt-repository 'deb http://mirror.stshosting.co.uk/mariadb/repo/10.0/ubuntu precise main'
apt-get update
apt-get install -y mariadb-server
#others
apt-get install -y curl php5-curl php5-gd php5-mcrypt php5-mysqlnd tree iftop nmap php5-xsl libssh2-php
sed -i 's/;date.timezone =/date.timezone =Europe\/Paris/g' /etc/php5/apache2/php.ini
sed -i 's/;date.timezone =/date.timezone =Europe\/Paris/g' /etc/php5/cli/php.ini
sed -i 's/\/var\/www\/html/\/data\/www/g' /etc/apache2/sites-enabled/000-default.conf
sed -i 's/\/var\/www/\/data\/www/g' /etc/apache2/apache2.conf
mkdir -p /data/www/
cd /data/www/
a2enmod php5
a2enmod rewrite
service apache2 restart
mkdir -p /data/www/
cd /data/www/
curl -sS https://getcomposer.org/installer | php --
mv composer.phar /usr/local/bin/composer
apt-get install postfix
#samba
apt-get install -y samba
smbpasswd -a alequoy
cat >> /etc/samba/smb.conf << EOF
[data]
path = /data/www
read only = no
browseable = yes
guest ok = no
browseable = yes
create mask = 0644
directory mask = 0755
force user = www-data
EOF
/etc/init.d/smbd restart
chown www-data:www-data -R /data/www
#custom cnf for photobox
[client]
#default-character-set = utf8
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8
collation-server = utf8_general_ci
bind-address = 0.0.0.0
external-locking = off
skip-name-resolve
#make a crc32 of ip server
server-id=2577252028
#replicate-do-db=PRODUCTION,SHIPPINGENGINE
replicate-ignore-db=mysql,information_schema,performance_schema
#innodb
innodb_buffer_pool_size = 14G
#for master
log_bin = /var/lib/log_mysql/mariadb-bin
log_bin_index = /var/lib/log_mysql/mariadb-bin.index
max_binlog_size = 500M
expire_logs_days = 15
binlog-ignore-db = information_schema,mysql,performance_schema
#log
slow_query_log_file = /var/log/mysql/mariadb-slow.log
long_query_time = 10
# * Fine Tuning
#
max_connections = 500
connect_timeout = 60
wait_timeout = 600
max_allowed_packet = 16M
thread_cache_size = 128
sort_buffer_size = 10M
bulk_insert_buffer_size = 16M
tmp_table_size = 64M
max_heap_table_size = 64M
[mysql]
default-character-set = utf8