花了半天的时间把阿里云的centos 换成了ubuntu 14.04 lts ,原因是因为我想安装个gogs git服务,但是centos的glibc版本太低,折腾了半天没有成功。

迁移Ghost数据

#更新
sudo apt-get update
sudo apt-get upgrade
sudo apt-get update

#挂载数据盘
sudo mount -rw /dev/xvdb1 /opt/
#注:
sudo mount /dev/xvdb1 /opt/
mount -o remount rw /
#安装node环境
#apt-get install unzip
#wget  http://nodejs.org/dist/v0.10.33/node-v0.10.33-linux-x64.tar.gz
#tar zxvf node-v0.10.33-linux-x64.tar.gz
#配置环境变量
#vi /etc/profile
#输入保存

  1. #set for nodejs by irving
  2. export NODE_HOME=/opt/node-v0.10.33-linux-x64
  3. export PATH=$NODE_HOME/bin:$PATH
  4. export NODE_PATH=$NODE_HOME/lib/node_modules:$PATH

#保存退出
#:wq

#重启生效

#source /etc/profile

#检查是否安装成功

#node -v

#npm –v

#更换npm源

npm install -g cnpm --registry=https://registry.npm.taobao.org   (说明:https://npm.taobao.org)

#安装Ghost

wget http://ghost.org/zip/ghost-latest.zip

unzip -uo ghost-0.5.3.zip -d ghost

#修改配置

复制config.example.js文件重命名/opt/ghost/config.js修改production节点为下面内容,更换为mysql

  1. production: {
  2. url: 'http://115.29.174.111/',
  3. mail: {},
  4. database: {
  5. client: 'mysql',
  6. connection: {
  7. host : '127.0.0.1',
  8. user : 'root', //我们暂且用 MySQL 的 root 账户
  9. password : '123456', //输入你的 MySQL 密码
  10. database : 'ghost', //我们前面为 Ghost 创建的数据库名称
  11. charset : 'utf8'
  12. }
  13. },
  14.  
  15. server: {
  16. // Host to be passed to node's `net.Server#listen()`
  17. host: '127.0.0.1',
  18. // Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
  19. port: '2368'
  20. }
  21. }

#安装包
cd ghost

cnpm install --production

  1. root@AY1406151605405725a8Z:/opt/ghost# cnpm install --production
  2. npm WARN engine html-to-text@0.1.0: wanted: {"node":"~0.8.0"} (current: {"node":"0.10.33","npm":"2.1.6"})
  3. \
  4. > sqlite3@2.2.7 install /opt/ghost/node_modules/sqlite3
  5. > node-pre-gyp install --fallback-to-build
  6.  
  7. make: Entering directory `/opt/ghost/node_modules/sqlite3/build'
  8. ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3080500/sqlite3.c
  9. TOUCH Release/obj.target/deps/action_before_build.stamp
  10. CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3080500/sqlite3.o
  11. AR(target) Release/obj.target/deps/sqlite3.a
  12. COPY Release/sqlite3.a
  13. CXX(target) Release/obj.target/node_sqlite3/src/database.o
  14. CXX(target) Release/obj.target/node_sqlite3/src/node_sqlite3.o
  15. CXX(target) Release/obj.target/node_sqlite3/src/statement.o
  16. SOLINK_MODULE(target) Release/obj.target/node_sqlite3.node
  17. SOLINK_MODULE(target) Release/obj.target/node_sqlite3.node: Finished
  18. COPY Release/node_sqlite3.node
  19. COPY /opt/ghost/node_modules/sqlite3/lib/binding/node-v11-linux-x64/node_sqlite3.node
  20. TOUCH Release/obj.target/action_after_build.stamp
  21. make: Leaving directory `/opt/ghost/node_modules/sqlite3/build'
  22. connect-slashes@1.2.0 node_modules/connect-slashes
  23.  
  24. colors@0.6.2 node_modules/colors
  25.  
  26. xml@0.0.12 node_modules/xml
  27.  
  28. node-uuid@1.4.1 node_modules/node-uuid
  29.  
  30. validator@3.4.0 node_modules/validator
  31.  
  32. passport-http-bearer@1.0.1 node_modules/passport-http-bearer
  33. 忖?passport-strategy@1.0.0
  34.  
  35. morgan@1.3.1 node_modules/morgan
  36. 忖?basic-auth@1.0.0
  37. 忖?depd@0.4.5
  38. 忖?on-finished@2.1.0 (ee-first@1.0.5)
  39.  
  40. showdown@0.3.2-ghost node_modules/showdown
  41.  
  42. passport@0.2.0 node_modules/passport
  43. 忖?pause@0.0.1
  44. 忖?passport-strategy@1.0.0
  45.  
  46. semver@2.2.1 node_modules/semver
  47.  
  48. bcryptjs@0.7.10 node_modules/bcryptjs
  49.  
  50. fs-extra@0.8.1 node_modules/fs-extra
  51. 忖?jsonfile@1.1.1
  52. 忖?rimraf@2.2.8
  53. 忖?ncp@0.4.2
  54. 忖?mkdirp@0.3.5
  55.  
  56. passport-oauth2-client-password@0.1.1 node_modules/passport-oauth2-client-password
  57. 忖?pkginfo@0.2.3
  58. 忖?passport@0.1.18 (pause@0.0.1)
  59.  
  60. oauth2orize@1.0.1 node_modules/oauth2orize
  61. 忖?uid2@0.0.3
  62. 忖?utils-merge@1.0.0
  63. 忖?debug@0.7.4
  64.  
  65. rss@0.2.1 node_modules/rss
  66. 忖?mime@1.2.11
  67.  
  68. downsize@0.0.5 node_modules/downsize
  69. 忖?xregexp@2.0.0
  70.  
  71. compression@1.1.0 node_modules/compression
  72. 忖?vary@1.0.0
  73. 忖?on-headers@1.0.0
  74. 忖?bytes@1.0.0
  75. 忖?debug@2.0.0 (ms@0.6.2)
  76. 忖?compressible@2.0.1 (mime-db@1.1.2)
  77. 忖?accepts@1.1.2 (negotiator@0.4.9, mime-types@2.0.2)
  78.  
  79. body-parser@1.8.2 node_modules/body-parser
  80. 忖?bytes@1.0.0
  81. 忖?media-typer@0.3.0
  82. 忖?raw-body@1.3.0
  83. 忖?depd@0.4.5
  84. 忖?on-finished@2.1.0 (ee-first@1.0.5)
  85. 忖?qs@2.2.3
  86. 忖?type-is@1.5.2 (mime-types@2.0.2)
  87. 忖?iconv-lite@0.4.4
  88.  
  89. express@4.9.2 node_modules/express
  90. 忖?utils-merge@1.0.0
  91. 忖?merge-descriptors@0.0.2
  92. 忖?fresh@0.2.4
  93. 忖?cookie@0.1.2
  94. 忖?escape-html@1.0.1
  95. 忖?range-parser@1.0.2
  96. 忖?cookie-signature@1.0.5
  97. 忖?finalhandler@0.2.0
  98. 忖?vary@1.0.0
  99. 忖?media-typer@0.3.0
  100. 忖?parseurl@1.3.0
  101. 忖?methods@1.1.0
  102. 忖?path-to-regexp@0.1.3
  103. 忖?depd@0.4.5
  104. 忖?on-finished@2.1.1 (ee-first@1.1.0)
  105. 忖?debug@2.0.0 (ms@0.6.2)
  106. 忖?qs@2.2.3
  107. 忖?etag@1.3.1 (crc@3.0.0)
  108. 忖?proxy-addr@1.0.1 (ipaddr.js@0.1.2)
  109. 忖?send@0.9.2 (ms@0.6.2, destroy@1.0.3, on-finished@2.1.0, mime@1.2.11)
  110. 忖?type-is@1.5.2 (mime-types@2.0.2)
  111. 忖?accepts@1.1.2 (negotiator@0.4.9, mime-types@2.0.2)
  112. 忖?serve-static@1.6.4 (send@0.9.3)
  113.  
  114. bluebird@2.3.0 node_modules/bluebird
  115.  
  116. html-to-text@0.1.0 node_modules/html-to-text
  117. 忖?underscore@1.7.0
  118. 忖?htmlparser@1.7.7
  119. 忖?optimist@0.6.1 (wordwrap@0.0.2, minimist@0.0.10)
  120. 忖?underscore.string@2.3.3
  121.  
  122. lodash@2.4.1 node_modules/lodash
  123.  
  124. unidecode@0.1.3 node_modules/unidecode
  125.  
  126. cheerio@0.17.0 node_modules/cheerio
  127. 忖?dom-serializer@0.0.1 (domelementtype@1.1.3)
  128. 忖?entities@1.1.1
  129. 忖?htmlparser2@3.7.3 (domelementtype@1.1.3, domutils@1.5.0, entities@1.0.0, domhandler@2.2.1, readable-stream@1.1.13)
  130. 忖?CSSselect@0.4.1 (domutils@1.4.3, CSSwhat@0.4.7)
  131.  
  132. busboy@0.2.8 node_modules/busboy
  133. 忖?readable-stream@1.1.13 (isarray@0.0.1, inherits@2.0.1, string_decoder@0.10.31, core-util-is@1.0.1)
  134. 忖?dicer@0.2.3 (streamsearch@0.1.2)
  135.  
  136. bookshelf@0.7.6 node_modules/bookshelf
  137. 忖?inherits@2.0.1
  138. 忖?trigger-then@0.3.0
  139. 忖?simple-extend@0.1.0
  140. 忖?create-error@0.3.1
  141. 忖?inflection@1.3.8
  142. 忖?semver@2.3.2
  143. 忖?backbone@1.1.0 (underscore@1.7.0)
  144. 忖?bluebird@2.0.7
  145.  
  146. knex@0.6.21 node_modules/knex
  147. 忖?tildify@0.2.0
  148. 忖?interpret@0.3.7
  149. 忖?inherits@2.0.1
  150. 忖?commander@2.5.0
  151. 忖?generic-pool-redux@0.1.0
  152. 忖?chalk@0.4.0 (has-color@0.1.7, ansi-styles@1.0.0, strip-ansi@0.1.1)
  153. 忖?minimist@0.0.10
  154. 忖?semver@2.3.2
  155. 忖?mkdirp@0.5.0 (minimist@0.0.8)
  156. 忖?readable-stream@1.1.13 (isarray@0.0.1, string_decoder@0.10.31, core-util-is@1.0.1)
  157. 忖?bluebird@1.2.4
  158. 忖?liftoff@0.11.3 (extend@1.2.1, minimist@0.1.0, resolve@0.7.4, findup-sync@0.1.3)
  159.  
  160. moment@2.4.0 node_modules/moment
  161.  
  162. express-hbs@0.7.11 node_modules/express-hbs
  163. 忖?readdirp@0.3.3 (graceful-fs@2.0.3, minimatch@0.2.14)
  164. 忖?js-beautify@1.4.2 (mkdirp@0.3.5, nopt@2.1.2, config-chain@1.1.8)
  165. 忖?handlebars@2.0.0 (optimist@0.3.7, uglify-js@2.3.6)
  166.  
  167. nodemailer@0.7.1 node_modules/nodemailer
  168. 忖?public-address@0.1.1
  169. 忖?directmail@0.1.8
  170. 忖?he@0.3.6
  171. 忖?readable-stream@1.1.13 (isarray@0.0.1, inherits@2.0.1, string_decoder@0.10.31, core-util-is@1.0.1)
  172. 忖?simplesmtp@0.3.33 (xoauth2@0.1.8, rai@0.1.11)
  173. 忖?mailcomposer@0.2.12 (mime@1.2.11, dkim-signer@0.1.2, follow-redirects@0.0.3, mimelib@0.2.18)
  174. 忖?aws-sdk@2.0.5 (xmlbuilder@0.4.2, xml2js@0.2.6, aws-sdk-apis@3.1.10)
  175.  
  176. mysql@2.1.1 node_modules/mysql
  177. 忖?require-all@0.0.3
  178. 忖?readable-stream@1.1.13 (isarray@0.0.1, inherits@2.0.1, string_decoder@0.10.31, core-util-is@1.0.1)
  179. 忖?bignumber.js@1.0.1
  180.  
  181. sqlite3@2.2.7 node_modules/sqlite3
  182. 忖?set-immediate@0.1.1
  183. 忖?nan@1.1.2

安装mysql

sudo apt-get install mysql-server mysql-client (会提示设置密码)
#安全设置

  1. root@AY1406151605405725a8Z:~# sudo mysql_secure_installation
  2.  
  3. NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
  4. SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
  5.  
  6. In order to log into MySQL to secure it, we'll need the current
  7. password for the root user. If you've just installed MySQL, and
  8. you haven't set the root password yet, the password will be blank,
  9. so you should just press enter here.
  10.  
  11. //输入安装 MySQL 时为 root 账户设置的密码
  12.  
  13. Enter current password for root (enter for none):
  14. OK, successfully used password, moving on...
  15.  
  16. Setting the root password ensures that nobody can log into the MySQL
  17. root user without the proper authorisation.
  18.  
  19. //是否修改 root 账户的密码?前面设置过 root 账户的密码了,如果不打算修改密码的话,输入 'n'
  20.  
  21. You already have a root password set, so you can safely answer 'n'.
  22.  
  23. Change the root password? [Y/n] n
  24. ... skipping.
  25.  
  26. By default, a MySQL installation has an anonymous user, allowing anyone
  27. to log into MySQL without having to have a user account created for
  28. them. This is intended only for testing, and to make the installation
  29. go a bit smoother. You should remove them before moving into a
  30. production environment.
  31.  
  32. //是否删除匿名用户?
  33.  
  34. Remove anonymous users? [Y/n] y
  35. ... Success!
  36.  
  37. Normally, root should only be allowed to connect from 'localhost'. This
  38. ensures that someone cannot guess at the root password from the network.
  39.  
  40. //是否禁止 root 账户远程登录?
  41.  
  42. Disallow root login remotely? [Y/n] y
  43. ... Success!
  44.  
  45. By default, MySQL comes with a database named 'test' that anyone can
  46. access. This is also intended only for testing, and should be removed
  47. before moving into a production environment.
  48.  
  49. //是否删除 MySQL 默认创建的 test 数据库,并删除所有对 test 数据库的权限设置?
  50.  
  51. Remove test database and access to it? [Y/n] y
  52. - Dropping test database...
  53. ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
  54. ... Failed! Not critical, keep moving...
  55. - Removing privileges on test database...
  56. ... Success!
  57.  
  58. Reloading the privilege tables will ensure that all changes made so far
  59. will take effect immediately.
  60.  
  61. //是否重新加载权限表?
  62.  
  63. Reload privilege tables now? [Y/n] y
  64. ... Success!
  65.  
  66. Cleaning up...
  67.  
  68. All done! If you've completed all of the above steps, your MySQL
  69. installation should now be secure.
  70.  
  71. Thanks for using MySQL!

#配置编码
打开 /etc/mysql/my.cnf 文件,为 [mysqld] 添加如下设置

[mysqld]

collation-server = utf8_unicode_ci

init-connect='SET NAMES utf8'

character-set-server = utf8

一般也会把下面节点也配置下

[client]

default-character-set=utf8

[mysql]

default-character-set=utf8

  1. #
  2. # The MySQL database server configuration file.
  3. #
  4. # You can copy this to one of:
  5. # - "/etc/mysql/my.cnf" to set global options,
  6. # - "~/.my.cnf" to set user-specific options.
  7. #
  8. # One can use all long options that the program supports.
  9. # Run program with --help to get a list of available options and with
  10. # --print-defaults to see which it would actually understand and use.
  11. #
  12. # For explanations see
  13. # http://dev.mysql.com/doc/mysql/en/server-system-variables.html
  14.  
  15. # This will be passed to all mysql clients
  16. # It has been reported that passwords should be enclosed with ticks/quotes
  17. # escpecially if they contain "#" chars...
  18. # Remember to edit /etc/mysql/debian.cnf when changing the socket location.
  19. [client]
  20. default-character-set=utf8
  21. port = 3306
  22. socket = /var/run/mysqld/mysqld.sock
  23.  
  24. # Here is entries for some specific programs
  25. # The following values assume you have at least 32M ram
  26.  
  27. # This was formally known as [safe_mysqld]. Both versions are currently parsed.
  28. [mysqld_safe]
  29. socket = /var/run/mysqld/mysqld.sock
  30. nice = 0
  31.  
  32. [mysqld]
  33. collation-server = utf8_unicode_ci
  34. init-connect='SET NAMES utf8'
  35. character-set-server = utf8
  36. #
  37. # * Basic Settings
  38. #
  39. user = mysql
  40. pid-file = /var/run/mysqld/mysqld.pid
  41. socket = /var/run/mysqld/mysqld.sock
  42. port = 3306
  43. basedir = /usr
  44. datadir = /var/lib/mysql
  45. tmpdir = /tmp
  46. lc-messages-dir = /usr/share/mysql
  47. skip-external-locking
  48. #
  49. # Instead of skip-networking the default is now to listen only on
  50. # localhost which is more compatible and is not less secure.
  51. bind-address = 127.0.0.1
  52. #
  53. # * Fine Tuning
  54. #
  55. key_buffer = 16M
  56. max_allowed_packet = 16M
  57. thread_stack = 192K
  58. thread_cache_size = 8
  59. # This replaces the startup script and checks MyISAM tables if needed
  60. # the first time they are touched
  61. myisam-recover = BACKUP
  62. #max_connections = 100
  63. #table_cache = 64
  64. #thread_concurrency = 10
  65. #
  66. # * Query Cache Configuration
  67. #
  68. query_cache_limit = 1M
  69. query_cache_size = 16M
  70. #
  71. # * Logging and Replication
  72. #
  73. # Both location gets rotated by the cronjob.
  74. # Be aware that this log type is a performance killer.
  75. # As of 5.1 you can enable the log at runtime!
  76. #general_log_file = /var/log/mysql/mysql.log
  77. #general_log = 1
  78. #
  79. # Error log - should be very few entries.
  80. #
  81. log_error = /var/log/mysql/error.log
  82. #
  83. # Here you can see queries with especially long duration
  84. #log_slow_queries = /var/log/mysql/mysql-slow.log
  85. #long_query_time = 2
  86. #log-queries-not-using-indexes
  87. #
  88. # The following can be used as easy to replay backup logs or for replication.
  89. # note: if you are setting up a replication slave, see README.Debian about
  90. # other settings you may need to change.
  91. #server-id = 1
  92. #log_bin = /var/log/mysql/mysql-bin.log
  93. expire_logs_days = 10
  94. max_binlog_size = 100M
  95. #binlog_do_db = include_database_name
  96. #binlog_ignore_db = include_database_name
  97. #
  98. # * InnoDB
  99. #
  100. # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
  101. # Read the manual for more InnoDB related options. There are many!
  102. #
  103. # * Security Features
  104. #
  105. # Read the manual, too, if you want chroot!
  106. # chroot = /var/lib/mysql/
  107. #
  108. # For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
  109. #
  110. # ssl-ca=/etc/mysql/cacert.pem
  111. # ssl-cert=/etc/mysql/server-cert.pem
  112. # ssl-key=/etc/mysql/server-key.pem
  113.  
  114. [mysqldump]
  115. quick
  116. quote-names
  117. max_allowed_packet = 16M
  118.  
  119. [mysql]
  120. default-character-set=utf8
  121. #no-auto-rehash # faster start of mysql but no tab completition
  122.  
  123. [isamchk]
  124. key_buffer = 16M
  125.  
  126. #
  127. # * IMPORTANT: Additional settings that can override those from this file!
  128. # The files must end with '.cnf', otherwise they'll be ignored.
  129. #
  130. !includedir /etc/mysql/conf.d/

#重启服务
sudo service mysql restart

mysql -uroot –p

#查看编码

show variables like 'char%';

show variables like 'collation%';

  1. mysql> show variables like 'char%';
  2. +--------------------------+----------------------------+
  3. | Variable_name | Value |
  4. +--------------------------+----------------------------+
  5. | character_set_client | utf8 |
  6. | character_set_connection | utf8 |
  7. | character_set_database | utf8 |
  8. | character_set_filesystem | binary |
  9. | character_set_results | utf8 |
  10. | character_set_server | utf8 |
  11. | character_set_system | utf8 |
  12. | character_sets_dir | /usr/share/mysql/charsets/ |
  13. +--------------------------+----------------------------+
  14. 8 rows in set (0.00 sec)
  15.  
  16. mysql> show variables like 'collation%';
  17. +----------------------+-----------------+
  18. | Variable_name | Value |
  19. +----------------------+-----------------+
  20. | collation_connection | utf8_general_ci |
  21. | collation_database | utf8_unicode_ci |
  22. | collation_server | utf8_unicode_ci |
  23. +----------------------+-----------------+
  24. 3 rows in set (0.00 sec)

#创建数据库
SET GLOBAL storage_engine ='InnoDB';

create database ghost;

#安装forever启动服务

cnpm install forever -g

#启动

NODE_ENV=production forever start index.js

#停止

forever stop index.js

#检查Ghost运行情况

forever list

安装nginx

#模块依赖性

gzip 模块需要 zlib 库

rewrite 模块需要 pcre 库

ssl 功能需要 openssl 库

预先编译好的安装包

sudo apt-get install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev

cd /opt

wget http://nginx.org/download/nginx-1.7.7.tar.gz

mkdir nginx

tar zxvf nginx-1.7.7.tar.gz

cd nginx-1.7.7

./configure --prefix=/opt/nginx --with-http_stub_status_module --with-http_gzip_static_module

make && make install

#配置nginx

  1. location / {
  2. proxy_set_header X-Real-IP $remote_addr;
  3. proxy_set_header Host $http_host;
  4. proxy_set_header X-NginX-Proxy true;
  5. proxy_pass http://127.0.0.1:2368;
  6. }

#检查配置是否正确
/opt/nginx/sbin/nginx -t

#启动

/opt/nginx/sbin/nginx

#重新加载配置

/opt/nginx/sbin/nginx -s reload

#停止

/opt/nginx/sbin/nginx -s stop

导出数据

进入 http://your-domain.com/ghost/debug 页面,导入数据即可。

安装Gogs

#创建用户及安装依赖

sudo apt-get update

sudo apt-get install git

#下载

wget http://gogs.dn.qbox.me/gogs_v0.5.5_linux_amd64.zip

unzip gogs_v0.5.5_linux_amd64.zip

#创建数据库

可以使用 etc/mysql.sql 来自动创建名为 gogs 的数据库。如果您选择手动创建,请务必将编码设置为 utf8

$mysql -u root -p

DROP DATABASE IF EXISTS gogs;

CREATE DATABASE IF NOT EXISTS gogs CHARACTER SET utf8 COLLATE utf8_general_ci;

#安装supervisord 守护进程

http://supervisord.org/

安装

sudo apt-get install supervisor

#进程

/usr/bin/supervisord             --  supervisor服务守护进程

/usr/bin/supervisorctl           --  supervisor控制台进程

在/etc/supervisor目录中存放着supervisor的配置文件:其中conf.d是一个子目录,其中存放着supervisor监管的进程的配置信息,一个进程有一个对应的配置文件supervisord.conf是supervisor的主配置文件,定义服务名称以及接口等等。

#配置

现在要用supervisor监控一个脚本进程,在/etc/supervisor/conf.d中新建一个关于这个脚本进程的配置文件

cd /etc/supervisor/conf.d

vim gogs.conf

  1. [program:gogs]
  2. command=/opt/gogs/scripts/start.sh
  3. directory=/opt/gogs
  4. autostart=true
  5. autorestart=true
  6. stdout_logfile=/var/log/supervisor/gogs_supervisor_out.log
  7. stderr_logfile=/var/log/supervisor/gogs__supervisor_err.log

#保存
:qw

#配置更改生效

supervisorctl update 或者用supervisorctl reload 重新重新启动supervisor程序

#查看状态

supervisorctl status

#停止所有gogs

supervisorctl stop all

#启动gogs

supervisorctl start gogs

#查看3000端口进程

lsof -i:3000

netstat -anl | grep "3000"
#查看某一端口是否开放

lsof -i:80
netstat -nupl  (UDP类型的端口)
netstat -ntpl  (TCP类型的端口)

#杀死进程
kill -9 pid

#开启http的UI控制台

修改主配置文件

vim /etc/supervisor/supervisord.conf,添加如下内容:

[inet_http_server]

port = 192.168.1.60:9001 #IP和绑定端口

username = admin #管理员名称

password = 123456 #管理员密码

这样,在浏览器中输入配置中写的地址和端口号,输入配置好的用户名和密码,便可以看到基于网页的控制台

界面。从中,可以察看supervisor监控的>信息,可以察看进程的日志等

#初始化配置

然后访问 /install 来完成首次运行的配置

Refer:

http://docs.ghost.org/zh/installation/deploy/

http://gogs.io/docs/advanced/configuration_cheat_sheet.html

Ubuntu安装Gogs服务的更多相关文章

  1. Ubuntu安装SSH服务

    1 SSH服务 Ubuntu默认并没有安装ssh服务,如果通过ssh远程连接到Ubuntu,需要自己手动安装ssh-server(openssh-server). 1.1 检测是否安装SSH服务 出现 ...

  2. 为Ubuntu安装SSH服务

    只有当Ubuntu安装了SSH服务后,我们才能够通过ssh工具登陆Ubuntu.我自己喜欢使用x-shell作为终端工具 1.安装Ubuntu缺省安装了openssh-client,所以在这里就不安装 ...

  3. ubuntu 安装nfs 服务

    1. 安装nfs服务软件 (1)服务器端 $sudo apt-get install nfs-kernel-server  rpcbind (2)客户端 (可以省略) $sudo apt-get in ...

  4. UBUNTU安装 SSH 服务

    输入命令"sudo apt -y install openssh-server" 输入当前用户密码,等待完成openssh-server安装. 安装完毕,运行命令"sud ...

  5. ubuntu 安装 ftp服务

    1. 更新源列表 ---> sudo apt-get update 2. 安装vsftpd ---> sudo apt-get install vsftpd (安装) ----> s ...

  6. 为Ubuntu安装FTP服务

    打开"终端窗口",输入"sudo apt-get update"-->回车-->"输入当前登录用户的管理员密码"-->回车 ...

  7. Ubuntu安装SHH服务

    1.打开"终端窗口",输入"sudo apt-get update"-->回车-->"输入当前登录用户的管理员密码"--> ...

  8. 解决ubuntu安装ssh服务无法打开解析包问题

    Windows下做Linux开发需要SSH强大功能的支持.安装SSH的过程会出现了很多问题,看完这篇文章可以让你少走些弯路,PS:折腾一下午的成果. Ubuntu的apt-get工具的牛逼之处简直无人 ...

  9. Linux Ubuntu 安装SSH服务

    1.安装SSH命令:sudo apt-get install openssh-server 2.启动SSH服务命令:/etc/init.d/ssh start 3.停止SSH服务命令:/etc/ini ...

随机推荐

  1. C#和java的对比及总结

    1.Java里的AClass.class得到的Class<T>类的对象对应C#的typeof(AClass)得到的Type类型的对象:(但是C#如果要反射创建对象是用Type对象的Asse ...

  2. 程序重复报more than 'max_user_connections' active connections问题解决

    早晨,开发扔过来一个问题,截图如下: ums already has more than 'max_user_connections' active connections 查看数据库发现: 最大连接 ...

  3. Spring 整合 RocketMQ

    1. 引入jar包 <!-- RocketMQ --> <dependency> <groupId>com.alibaba.rocketmq</groupId ...

  4. 深入浅出javascript(五)函数

    全局函数 自定义函数 函数对象 函数的属性和方法 一.全局函数 全局函数不同于内置对象的方法(来源于网络),一共有7个,可以直接使用. escape( ).eval( ).isFinite( ).is ...

  5. poj2774 sa模版

    学习地址:http://blog.csdn.net/yxuanwkeith/article/details/50636898 #include<iostream> #include< ...

  6. POJ3692 Kindergarten

    Kindergarten Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 6882   Accepted: 3402 Desc ...

  7. codeforces820B Mister B and Angle in Polygon 2017-06-28 09:42 123人阅读 评论(0) 收藏

    B. Mister B and Angle in Polygon time limit per test 2 seconds memory limit per test 256 megabytes i ...

  8. 使用Windows 8 Pro密钥光盘安装Windows 8.1 Pro

    在Windows 8.1发布接近半年的时候,自己终于腾出来了时间,准备升级一下自己的系统.作为一名极度强迫症患者,加上校园网的悲剧网速,最后决定使用光盘镜像全新安装而不是通过应用商店的升级. Figu ...

  9. 《mysql必知必会》学习_第13章_20180803_欢

    第13章:分组过滤. P83 select count(*) as num_prods from products where vend_id=1003; #返回vend_id=1003的产品数目总值 ...

  10. 将一个浮点数转换成人民币读法字符串(java)

    public class Num2Rmb   {       private String[] hanArr = {"零" , "壹" , "贰&qu ...