File tree 6 files changed +87
-13
lines changed
6 files changed +87
-13
lines changed Original file line number Diff line number Diff line change
1
+ server {
2
+ root /opt/colorit/web;
3
+ error_page 404 /404.html;
4
+ index index.html index.htm;
5
+
6
+ gzip on;
7
+ gzip_min_length 1k;
8
+ gzip_buffers 4 16k;
9
+ gzip_http_version 1.0;
10
+ gzip_comp_level 2;
11
+ gzip_types text/plain application/x-javascript text/css application/xml;
12
+ gzip_vary on;
13
+
14
+ server_name en.colorit.us colorit.us www.colorit.us colorit;
15
+
16
+ # For safety
17
+ rewrite ^/cgi/.*$ /404.html break;
18
+ rewrite ^/sessions/.*$ /404.html break;
19
+
20
+ # Rewrite rules
21
+ rewrite ^/$ /html/index_en.html last;
22
+ rewrite ^/sitemap$ /html/sitemap last;
23
+ rewrite ^/robots.txt$ /html/robots.txt last;
24
+ rewrite ^/img/(.*)$ /img/$1 last;
25
+ rewrite ^/css/(.*)$ /css/$1 last;
26
+ rewrite ^/js/(.*)$ /js/$1 last;
27
+ rewrite ^/swf/(.*)$ /swf/$1 last;
28
+ rewrite ^/getcolorcode$ /cgi/getcolorcode last;
29
+ rewrite ^/(.*)$ /html/$1 last;
30
+
31
+ location / {
32
+ try_files $uri $uri/;
33
+ }
34
+
35
+ location /cgi {
36
+ include uwsgi_params;
37
+ uwsgi_pass 127.0.0.1:20003;
38
+ }
39
+
40
+ }
Original file line number Diff line number Diff line change 1
1
server {
2
- root /opt/colorcode /web;
2
+ root /opt/colorit /web;
3
3
error_page 404 /404.html;
4
4
index index.html index.htm;
5
5
@@ -15,7 +15,7 @@ server {
15
15
gzip_types text/plain application/x-javascript text/css application/xml;
16
16
gzip_vary on;
17
17
18
- server_name en.colorit.us colorit.us www.colorit.us colorcode ;
18
+ server_name en.colorit.us colorit.us www.colorit.us colorit ;
19
19
20
20
# For safety
21
21
rewrite ^/cgi/.*$ /404.html break;
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ if [ " x$( whoami) " != " xroot" ]; then
3
+ echo " Only root can run this script."
4
+ exit 1
5
+ fi
6
+
7
+ PWD=" /opt/colorit"
8
+
9
+ cd " /opt"
10
+ ln -s ~ /colorit colorit
11
+ echo " ln -s ~/colorit /opt/colorit"
12
+ ret=$?
13
+ if [ " x${ret} " != " x0" ]; then
14
+ echo " An error occurs when ln -s~/colorit /opt/colorit, please contact sparker5."
15
+ exit 1
16
+ fi
17
+
18
+ mkdir " ${PWD} /logs"
19
+ echo " mkdir ${PWD} /logs"
20
+ ret=$?
21
+ if [ " x${ret} " != " x0" ]; then
22
+ echo " An error occurs when ln -s~/colorit /opt/colorit, please contact sparker5."
23
+ exit 1
24
+ fi
25
+
26
+ echo " 127.0.0.1 colorit" >> /etc/hosts
27
+ echo " echo \" 127.0.0.1 colorit\" >> /etc/hosts"
28
+ ret=$?
29
+ if [ " x${ret} " != " x0" ]; then
30
+ echo " An error occurs when ln -s~/colorit /opt/colorit, please contact sparker5."
31
+ exit 1
32
+ fi
33
+
34
+ echo " success"
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- # replace for colorcode
2
+ # replace for colorit
3
3
4
4
if [ " x$( whoami) " != " xroot" ]; then
5
5
echo " Only root can run this script."
@@ -13,22 +13,22 @@ if [ "x${rev}" == "x" ]; then
13
13
exit 1
14
14
fi
15
15
16
- cd /opt/colorcode .git
17
- git archive " ${rev} " -o /tmp/colorcode .tgz
16
+ cd /opt/colorit .git
17
+ git archive " ${rev} " -o /tmp/colorit .tgz
18
18
ret=$?
19
19
20
20
if [ " x${ret} " != " x0" ]; then
21
21
echo " An error occurs when archiving."
22
22
exit 1
23
23
fi
24
24
25
- cd /opt/colorcode
26
- tar xf /tmp/colorcode .tgz
25
+ cd /opt/colorit
26
+ tar xf /tmp/colorit .tgz
27
27
28
- cat /opt/colorcode /conf/colorcode .nginx.conf > /etc/nginx/sites-enabled/colorcode .nginx.conf
28
+ cat /opt/colorit /conf/colorit .nginx.conf > /etc/nginx/sites-enabled/colorit .nginx.conf
29
29
30
- chown www-data:www-data -R /opt/colorcode
30
+ chown www-data:www-data -R /opt/colorit
31
31
32
- /opt/colorcode /tool/spawn-fcgi.sh stop
33
- /opt/colorcode /tool/spawn-fcgi.sh start
32
+ /opt/colorit /tool/spawn-fcgi.sh stop
33
+ /opt/colorit /tool/spawn-fcgi.sh start
34
34
/etc/init.d/nginx restart
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ if [ "x$(whoami)" != "xroot" ]; then
5
5
exit 1
6
6
fi
7
7
8
- PWD=" /opt/colorcode /web/cgi"
9
- PIDFILE=" /var/run/colorcode -spawn-fcgi.pid"
8
+ PWD=" /opt/colorit /web/cgi"
9
+ PIDFILE=" /var/run/colorit -spawn-fcgi.pid"
10
10
11
11
case $1 in
12
12
" start" )
You can’t perform that action at this time.
0 commit comments