Tôi đang cố gắng cài đặt Jenkins on Vagrant cho môi trường phát triển của mình.Sau khi Jenkins được cài đặt ở Vagrant, không thể kết nối từ trình duyệt
Tôi chọn Ubuntu http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-vagrant-amd64-disk1.box cho hộp của mình. Và đây là vỏ mà tôi sử dụng để cung cấp hộp của tôi lên. Mọi thứ đều ổn, nhưng khi tôi thử truy cập vào hộp từ cổng 80 hoặc thậm chí: 8080 nó không phản hồi. Trình duyệt chỉ tiếp tục quay. Không chắc tôi đã làm gì sai ở đây.
Đây là tập lệnh của tôi.
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 [email protected]
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
Ngoài ra tôi vagrant ssh
và chạy
curl 'http://localhost:8080'
và nó trở lại trang Jenkins, vì vậy tôi nghĩ rằng Jenkins là lên và chạy đúng. Tôi không thể truy cập nó từ bên ngoài.
Dưới đây là Vagrantfile tôi
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
Chuẩn câu hỏi: là có một số loại tường lửa tham gia? – cmur2
Nhưng từ sự hiểu biết của tôi rỗng ubuntu không có bất kỳ tường lửa lên? Hoặc là tôi sai? – toy
Có lẽ, tôi không biết interna của hộp cụ thể của bạn - là nghe Jenkins của bạn trên cổng 80 trong máy ảo của bạn, tôi có một số ý tưởng mơ hồ rằng nó có thể nghe trên cổng 8080 theo mặc định? – cmur2