How to install EduSoho in Ubuntu

Server environment

1
2
$ cat /etc/issue
Ubuntu 14.04.5 LTS

Install nginx

1
$ sudo apt-get install -y nginx

Config Nginx

1
$ sudo vim /etc/nginx/nginx.conf

Add this in http{} field

1
client_max_body_size 1024M;

Install mysql

1
$ sudo apt-get install -y mysql-server

Create database

1
$ mysql -uroot -p

Create edusoho database, add database user

1
2
CREATE DATABASE `edusoho` DEFAULT CHARACTER SET utf8 ; 
GRANT ALL PRIVILEGES ON `edusoho`.* TO 'esuser'@'localhost' IDENTIFIED BY 'edusoho';

username: esuser
password: edusoho

Install PHP

1
$ sudo apt-get -y install php5 php5-cli php5-curl php5-fpm php5-intl php5-mcrypt php5-mysqlnd php5-gd

Change PHP file upload size limit

1
$ sudo vim /etc/php5/fpm/php.ini
1
2
3
post_max_size = 1024M 
memory_limit = 1024M
upload_max_filesize = 1024M

Config PHP-FPM

1
$ sudo vim /etc/php5/fpm/pool.d/www.conf
1
2
3
;listen.owner = www-data
;listen.group = www-data
;listen.mode = 0660

Remove the semicolon then restart PHP-FPM

1
$ sudo /etc/init.d/php5-fpm restart

Install EduSoho

1
2
3
4
5
6
$ sudo -s
$ mkdir -p /var/www
$ cd /var/www
$ wget http://download.edusoho.com/edusoho-8.2.5.tar.gz
$ tar -zxvf edusoho-8.2.5.tar.gz
$ chown www-data:www-data edusoho/ -Rf

If this zip package can not download, please visit the edusoho home page for it.

Configure nginx virtual host

1
$ sudo vim /etc/nginx/sites-enabled/default

Replace all its contents with following

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
server {

listen 80;
server_name _;

root /var/www/edusoho/web;

access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;

location / {
index app.php;
try_files $uri @rewriteapp;
}

location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}

location ~ ^/udisk {
internal;
root /var/www/edusoho/app/data/;
}

location ~ ^/(app|app_dev)\.php(/|$) {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
fastcgi_param HTTP_X-Sendfile-Type X-Accel-Redirect;
fastcgi_param HTTP_X-Accel-Mapping /udisk=/var/www/edusoho/app/data/udisk;
fastcgi_buffer_size 128k;
fastcgi_buffers 8 128k;
}

location ~* \.(jpg|jpeg|gif|png|ico|swf)$ {
# three year expire time
expires 3y;

# close log record
access_log off;

# close gzip compression to reduce CPU pressure because the picture compression rate is low
gzip off;
}

location ~* \.(css|js)$ {
access_log off;
expires 3y;
}

# forbidden to access user upload file directory for security
location ~ ^/files/.*\.(php|php5)$ {
deny all;
}

location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
fastcgi_param HTTP_PROXY "";
}
}

Restart nginx

1
$ sudo /etc/init.d/nginx restart

Open you browse to visit http://localhost/

Share