Skip to content

Instantly share code, notes, and snippets.

I'm installed phoenix 0.9.0 follow by doc get started, and configured ssl follow by SSL.

My config/prod.exs configurations are:

use Mix.Config

config :user_system, UserSystem.Endpoint,
  url: [host: "localhost"],
  http: [port: System.get_env("PORT")],
~/ElixirProjects/elixir-usersystem/app ¥MIX_ENV=prod sudo iex -S mix phoenix.server
Erlang/OTP 17 [erts-6.3] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
Compiled lib/user_system.ex
Compiled web/controllers/page_controller.ex
Compiled lib/user_system/endpoint.ex
Compiled web/view.ex
Compiled web/router.ex
Compiled web/views/error_view.ex
Compiled web/views/layout_view.ex
~/ElixirProjects/elixir-usersystem/app ¥sudo MIX_ENV=prod iex -S mix phoenix.server
Erlang/OTP 17 [erts-6.3] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
Compiled lib/user_system.ex
Compiled web/controllers/page_controller.ex
Compiled lib/user_system/endpoint.ex
Compiled web/view.ex
Compiled web/router.ex
Compiled web/views/error_view.ex
Compiled web/views/layout_view.ex
defmodule UserSystem.Repo do
use Ecto.Repo, adapter: Ecto.Adapters.MySQL
# Connection options
#
#:hostname - Server hostname;
#:port - Server port (default: 3306);
#:username - Username;
#:password - User password;
#:parameters - Keyword list of connection parameters;
~/ElixirProjects/elixir-usersystem/app ¥mix compile
Compiled lib/user_system.ex
Compiled web/controllers/page_controller.ex
== Compilation error on file web/models/repo.ex ==
** (KeyError) key :otp_app not found in: [adapter: Ecto.Adapters.MySQL]
(elixir) lib/keyword.ex:165: Keyword.fetch!/2
lib/ecto/repo/config.ex:8: Ecto.Repo.Config.parse/2
web/models/repo.ex:2: (module)
(stdlib) erl_eval.erl:657: :erl_eval.do_apply/6
defmodule UserSystem.Mixfile do
use Mix.Project
def project do
[app: :user_system,
version: "0.0.1",
elixir: "~> 1.0",
elixirc_paths: ["lib", "web"],
compilers: [:phoenix] ++ Mix.compilers,
deps: deps]
defmodule UserSystem.User do
use Ecto.Model
schema "user" do
field :username, :string
field :first_name, :string
field :last_name, :string
field :email, :string
timestamps
mysql> show create database usersystem;
+------------+---------------------------------------------------------------------+
| Database | Create Database |
+------------+---------------------------------------------------------------------+
| usersystem | CREATE DATABASE `usersystem` /*!40100 DEFAULT CHARACTER SET utf8 */ |
+------------+---------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> show create table user;
ERROR 1046 (3D000): No database selected
@developerworks
developerworks / gist:ae24afd047e0f8044f6a
Created March 17, 2015 07:55
Segmentation fault Ejabberd
15:47:01.846 [info] (#Port<0.20783>) Accepted connection 192.168.8.200:6444 -> 192.168.8.33:5222
15:47:01.847 [info] (#Port<0.20785>) Accepted connection 192.168.8.31:4422 -> 192.168.8.33:5222
15:47:01.854 [info] (#Port<0.20787>) Accepted connection 192.168.8.200:6447 -> 192.168.8.33:5222
15:47:01.859 [info] (#Port<0.20789>) Accepted connection 192.168.8.200:6371 -> 192.168.8.33:5222
15:47:01.862 [info] (#Port<0.20791>) Accepted connection 192.168.8.200:6457 -> 192.168.8.33:5222
15:47:01.863 [info] (#Port<0.20793>) Accepted connection 192.168.8.31:4684 -> 192.168.8.33:5222
15:47:01.865 [info] (#Port<0.20795>) Accepted connection 192.168.8.31:4928 -> 192.168.8.33:5222
15:47:01.872 [info] (#Port<0.20797>) Accepted connection 192.168.8.31:6544 -> 192.168.8.33:5222
15:47:01.874 [info] (#Port<0.20799>) Accepted connection 192.168.8.31:6489 -> 192.168.8.33:5222
15:47:01.878 [info] (#Port<0.20801>) Accepted connection 192.168.8.31:6547 -> 192.168.8.33:5222
@developerworks
developerworks / gist:0d90883f67a757031254
Created March 17, 2015 07:56
Segmentation fault Ejabberd
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd">
<tsung loglevel="debug" dumptraffic="false" version="1.0">
<clients>
<client host="scm" maxusers="200000">
<ip value="192.168.8.200"></ip>
</client>
<client host="compile" maxusers="200000">
<ip value="192.168.8.31"></ip>
</client>