2019独角兽企业重金招聘Python工程师标准>>>
@oldfeel
你好,很感谢分享的最新安装教程,但还想请教一个问题,今天按照你的教程安装后,登录本地主页只显示 504 bad gateway。
安装环境是在虚拟机中全新的ubuntu 12.04下尝试安装gitlab。
我的gitlab_error.log 提示错误如下:
2013/07/16 15:34:52 [error] 9342#0: *765 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: gitlab.local, request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:80/", host: "gitlab.local"
在网上搜了半天也没有弄明白,自己的确也不知道怎么配置本地主机访问文件/etc/nginx/sites-available/gitlab,请前辈明示!
_____________________________________________________________________________________
结果504错误只是一个小问题,用127.0.0.1登录本地主页就可以显示登录界面或直接把主机名改为localhost登录即可。
但又遇到另外一问题,困扰我大半天,进入login界面,并输入默认账户和密码后,提示不正确。
百思不得其解,都准备在debian或者mac os上直接安装了。
幸运的是最后找到问题所在和解决方案,问题是没有安装最新版Ruby2.0,而且必须先删除以前的1.8旧版本,详细代码如下:
一. 移除老版本 1.8
sudo apt-get remove -y ruby1.8
二. 下载Ruby并编译它:
mkdir /tmp/ruby && cd /tmp/ruby
curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz | tar xz
cd ruby-2.0.0-p247
./configure
make
sudo make install
三. 安装 Bundler Gem:
sudo gem install bundler --no-ri --no-rdoc
然后再运行两个最重要的命令,初始化mysql数据库!!!
sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
# Type 'yes' to create the database.
# When done you see 'Administrator account created:'
最关键的一步显示如下,检查状态并完成数据库初始化生成初始账户:
leon@leon-VirtualBox:/home/git/gitlab$ sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
Checking Environment ...
Git configured for git user? ... yes
Has python2? ... yes
python2 is supported version? ... yes
Checking Environment ... Finished
Checking GitLab Shell ...
GitLab Shell version >= 1.4.0 ? ... OK (1.4.0)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
post-receive hook up-to-date? ... yes
post-receive hooks in repos are links: ... can't check, you have no projects
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Checking Sidekiq ... Finished
Checking GitLab ...
Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
Projects have satellites? ... can't check, you have no projects
Redis version >= 2.0.0? ... yes
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (1.8.3)
Checking GitLab ... Finished
leon@leon-VirtualBox:/home/git/gitlab$ sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
This will create the necessary database tables and seed the database.
You will lose any previous data stored in the database.
Do you want to continue (yes/no)? yes
gitlabhq_production already exists
-- create_table("deploy_keys_projects", {:force=>true})
-> 0.0568s
-- create_table("events", {:force=>true})
-> 0.0142s
-- add_index("events", ["action"], {:name=>"index_events_on_action"})
-> 0.0333s
-- add_index("events", ["author_id"], {:name=>"index_events_on_author_id"})
-> 0.0222s
-- add_index("events", ["created_at"], {:name=>"index_events_on_created_at"})
-> 0.0193s
-- add_index("events", ["project_id"], {:name=>"index_events_on_project_id"})
-> 0.0263s
-- add_index("events", ["target_id"], {:name=>"index_events_on_target_id"})
-> 0.0172s
-- add_index("events", ["target_type"], {:name=>"index_events_on_target_type"})
-> 0.0259s
-- create_table("forked_project_links", {:force=>true})
-> 0.0135s
-- add_index("forked_project_links", ["forked_to_project_id"], {:name=>"index_forked_project_links_on_forked_to_project_id", :unique=>true})
-> 0.0256s
-- create_table("issues", {:force=>true})
-> 0.0216s
-- add_index("issues", ["assignee_id"], {:name=>"index_issues_on_assignee_id"})
-> 0.0250s
-- add_index("issues", ["author_id"], {:name=>"index_issues_on_author_id"})
-> 0.0228s
-- add_index("issues", ["created_at"], {:name=>"index_issues_on_created_at"})
-> 0.0319s
-- add_index("issues", ["milestone_id"], {:name=>"index_issues_on_milestone_id"})
-> 0.0324s
-- add_index("issues", ["project_id"], {:name=>"index_issues_on_project_id"})
-> 0.0262s
-- add_index("issues", ["title"], {:name=>"index_issues_on_title"})
-> 0.0324s
-- create_table("keys", {:force=>true})
-> 0.0140s
-- add_index("keys", ["identifier"], {:name=>"index_keys_on_identifier"})
-> 0.0380s
-- add_index("keys", ["user_id"], {:name=>"index_keys_on_user_id"})
-> 0.0219s
-- create_table("merge_requests", {:force=>true})
-> 0.0200s
-- add_index("merge_requests", ["assignee_id"], {:name=>"index_merge_requests_on_assignee_id"})
-> 0.0197s
-- add_index("merge_requests", ["author_id"], {:name=>"index_merge_requests_on_author_id"})
-> 0.0269s
-- add_index("merge_requests", ["created_at"], {:name=>"index_merge_requests_on_created_at"})
-> 0.0203s
-- add_index("merge_requests", ["milestone_id"], {:name=>"index_merge_requests_on_milestone_id"})
-> 0.0198s
-- add_index("merge_requests", ["project_id"], {:name=>"index_merge_requests_on_project_id"})
-> 0.0262s
-- add_index("merge_requests", ["source_branch"], {:name=>"index_merge_requests_on_source_branch"})
-> 0.0269s
-- add_index("merge_requests", ["target_branch"], {:name=>"index_merge_requests_on_target_branch"})
-> 0.0201s
-- add_index("merge_requests", ["title"], {:name=>"index_merge_requests_on_title"})
-> 0.0253s
-- create_table("milestones", {:force=>true})
-> 0.0092s
-- add_index("milestones", ["due_date"], {:name=>"index_milestones_on_due_date"})
-> 0.0319s
-- add_index("milestones", ["project_id"], {:name=>"index_milestones_on_project_id"})
-> 0.0293s
-- create_table("namespaces", {:force=>true})
-> 0.0121s
-- add_index("namespaces", ["name"], {:name=>"index_namespaces_on_name"})
-> 0.0249s
-- add_index("namespaces", ["owner_id"], {:name=>"index_namespaces_on_owner_id"})
-> 0.0291s
-- add_index("namespaces", ["path"], {:name=>"index_namespaces_on_path"})
-> 0.0368s
-- add_index("namespaces", ["type"], {:name=>"index_namespaces_on_type"})
-> 0.0236s
-- create_table("notes", {:force=>true})
-> 0.0102s
-- add_index("notes", ["commit_id"], {:name=>"index_notes_on_commit_id"})
-> 0.0288s
-- add_index("notes", ["created_at"], {:name=>"index_notes_on_created_at"})
-> 0.0199s
-- add_index("notes", ["noteable_type"], {:name=>"index_notes_on_noteable_type"})
-> 0.0249s
-- add_index("notes", ["project_id", "noteable_type"], {:name=>"index_notes_on_project_id_and_noteable_type"})
-> 0.0207s
-- add_index("notes", ["project_id"], {:name=>"index_notes_on_project_id"})
-> 0.0289s
-- create_table("projects", {:force=>true})
-> 0.0123s
-- add_index("projects", ["creator_id"], {:name=>"index_projects_on_owner_id"})
-> 0.0239s
-- add_index("projects", ["last_activity_at"], {:name=>"index_projects_on_last_activity_at"})
-> 0.0323s
-- add_index("projects", ["namespace_id"], {:name=>"index_projects_on_namespace_id"})
-> 0.0229s
-- create_table("protected_branches", {:force=>true})
-> 0.0126s
-- create_table("services", {:force=>true})
-> 0.0103s
-- add_index("services", ["project_id"], {:name=>"index_services_on_project_id"})
-> 0.0298s
-- create_table("snippets", {:force=>true})
-> 0.0140s
-- add_index("snippets", ["created_at"], {:name=>"index_snippets_on_created_at"})
-> 0.0208s
-- add_index("snippets", ["expires_at"], {:name=>"index_snippets_on_expires_at"})
-> 0.0277s
-- add_index("snippets", ["project_id"], {:name=>"index_snippets_on_project_id"})
-> 0.0249s
-- create_table("taggings", {:force=>true})
-> 0.0100s
-- add_index("taggings", ["tag_id"], {:name=>"index_taggings_on_tag_id"})
-> 0.0203s
-- add_index("taggings", ["taggable_id", "taggable_type", "context"], {:name=>"index_taggings_on_taggable_id_and_taggable_type_and_context"})
-> 0.0259s
-- create_table("tags", {:force=>true})
-> 0.0122s
-- create_table("user_team_project_relationships", {:force=>true})
-> 0.0094s
-- create_table("user_team_user_relationships", {:force=>true})
-> 0.0126s
-- create_table("user_teams", {:force=>true})
-> 0.0121s
-- create_table("users", {:force=>true})
-> 0.0114s
-- add_index("users", ["admin"], {:name=>"index_users_on_admin"})
-> 0.0204s
-- add_index("users", ["email"], {:name=>"index_users_on_email", :unique=>true})
-> 0.0303s
-- add_index("users", ["extern_uid", "provider"], {:name=>"index_users_on_extern_uid_and_provider", :unique=>true})
-> 0.0400s
-- add_index("users", ["name"], {:name=>"index_users_on_name"})
-> 0.0334s
-- add_index("users", ["reset_password_token"], {:name=>"index_users_on_reset_password_token", :unique=>true})
-> 0.0233s
-- add_index("users", ["username"], {:name=>"index_users_on_username"})
-> 0.0299s
-- create_table("users_projects", {:force=>true})
-> 0.0154s
-- add_index("users_projects", ["project_access"], {:name=>"index_users_projects_on_project_access"})
-> 0.0216s
-- add_index("users_projects", ["project_id"], {:name=>"index_users_projects_on_project_id"})
-> 0.0205s
-- add_index("users_projects", ["user_id"], {:name=>"index_users_projects_on_user_id"})
-> 0.0284s
-- create_table("web_hooks", {:force=>true})
-> 0.0130s
-- initialize_schema_migrations_table()
-> 0.0006s
-- assume_migrated_upto_version(20130614132337, ["/home/git/gitlab/db/migrate"])
-> 0.0015s
== Seed from /home/git/gitlab/db/fixtures/production/001_admin.rb
2013-07-17T16:19:15Z 27318 TID-orelt2ctw INFO: Sidekiq client using redis://localhost:6379 with options {:namespace=>"resque:gitlab"}
Administrator account created:
[email protected]
password......5iveL!fe