shell – Jenkins安装在Vagrant后,无法从浏览器连接
发布时间:2020-12-15 22:37:51 所属栏目:安全 来源:网络整理
导读:我正在尝试在Vagrant上为我的开发环境安装Jenkins. 我为我的盒子选择了Ubuntu http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-vagrant-amd64-disk1.box.这是我用来配置我的盒子的shell.一切都很顺利,但当我尝试从端口80或甚至8080
我正在尝试在Vagrant上为我的开发环境安装Jenkins.
我为我的盒子选择了Ubuntu http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-vagrant-amd64-disk1.box.这是我用来配置我的盒子的shell.一切都很顺利,但当我尝试从端口80或甚至8080访问该框时,它只是没有响应.浏览一直在旋转.不知道我在这里做错了什么. 这是我的剧本. sudo apt-get update echo "APT::Cache-Limit "100000000";" >> /etc/apt/apt.conf.d/70debconf wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add - sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list' sudo apt-get -y --force-yes install jenkins sudo apt-get -y --force-yes install apache2 sudo a2enmod proxy sudo a2enmod proxy_http sudo a2enmod vhost_alias sudo a2dissite default echo ' ServerAdmin webmaster@localhost ServerName ci.company.com ServerAlias ci ProxyRequests Off Order deny,allow Allow from all ProxyPreserveHost on ProxyPass / http://localhost:8080/ ' >> /etc/apache2/sites-available/jenkins sudo a2ensite jenkins sudo sh -c 'echo "ServerName localhost" >> /etc/apache2/conf.d/name' && sudo service apache2 restart sudo apache2ctl restart 我也是流浪汉ssh并且跑 curl 'http://localhost:8080' 它返回了Jenkins页面,所以我认为Jenkins正常运行.我无法从外面访问它. 这是我的Vagrantfile Vagrant.configure("2") do |config| config.vm.provision :shell,:path => "install-jenkins.sh" config.vm.provider "virtualbox" do |v| v.customize ["modifyvm",:id,"--memory","2024"] end # Every Vagrant virtual environment requires a box to build off of. config.vm.box = "ubuntu64" # Create a forwarded port mapping which allows access to a specific port # within the machine from a port on the host machine. In the example below,# accessing "localhost:8080" will access port 80 on the guest machine. config.vm.network :forwarded_port,guest: 80,host: 8080 end 解决方法
我通过向Vagrant框提供IP来完成这项工作,如下所示:
config.vm.network :hostonly,"33.33.33.10" (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- Anorm Scala executeUpdate和executeInsert之间的区别
- angular2学习笔记之服务和http
- MyEclispe基于JAX-WS的WebService服务端客户端简单实现示例
- 【数据结构】非比较排序算法(实现计数排序和基数排序)
- scala – Play Framework 2.0.升级bonecp
- 同步 – Angular2,保持模型在组件之间同步
- Polymer元素和AngularJS指令有什么区别?
- jax-ws webservice部署到tomcat 遇到的问题
- AngularJS HTML5模式在手动URL更改时执行整页重新加载
- angularjs – mean.js应用程序中的ngDialog