httpd is a virtual package provided by multiple packages, you must explicitly select one - apache

I was following the chef tutorial. My workstation is Ubuntu. At the step 'Install the Apache package'.
I wrote a recipe which contains only "package 'httpd'". I was supposed to install Apache after that. However, I got an error:
Error executing action `install` on resource 'apt_package[httpd]'
================================================================================
Chef::Exceptions::Package
-------------------------
httpd is a virtual package provided by multiple packages, you must explicitly select one
Resource Declaration:
---------------------
# In /home/local/ANT/yuqiw/chef-repo/webserver.rb
2: apt_package("httpd")
Compiled Resource:
------------------
# Declared in /home/local/ANT/yuqiw/chef-repo/webserver.rb:2:in `from_file'
apt_package("httpd") do
package_name "httpd"
action [:install]
retries 0
retry_delay 2
default_guard_interpreter :default
declared_type :apt_package
cookbook_name "#recipe_files"
recipe_name "/home/local/ANT/yuqiw/chef-repo/webserver.rb"
end
Platform:
---------
x86_64-linux
Can anyone help me out?

The package called httpd on RHEL/CentOS/Fedora is called apache2 in Debian/Ubuntu. At the start of the tutorial you had to pick if you were using Ubuntu or CentOS, you probably picked the incorrect one. Just go back to that screen and click the other link.

service 'apache2' do
action :install
end
Try to use it further in the tutorial.

Related

SSL Error while installing any package from conda prompt

I use Anaconda Navigator for my machine learning experiments. Recently, I have started getting this strange SSL error no matter what I try to install using conda prompt. The error is SSL error. I am posting the error message that I get
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url
https://repo.anaconda.com/pkgs/free/linux-64/repodata.json.bz2
Elapsed: -
An HTTP error occurred when trying to retrieve this URL. HTTP errors
are often intermittent, and a simple retry will get you on your way.
If your current network has https://www.anaconda.com blocked, please
file a support request with your network engineering team.
SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\',
port=443): Max retries exceeded with url:
/pkgs/free/linux-64/repodata.json.bz2 (Caused by
SSLError(SSLError("bad handshake: Error([(\'SSL routines\',
\'ssl3_get_server_certificate\', \'certificate verify
failed\')],)",),))',),)
I have an institutional proxy server; the credentials, apt.conf file etc are all OK.
Even then I am not able to install any package using conda.
Interestingly, I have installed numerous packages using conda prompt and I never faced any such error until recently. Also, I am able to follow the links (using the browser) given in the error message which means that the proxy is not blocking the site.
I was asked to use
conda config --set ssl_verify True
but even this did not help. Any help ?
I even entered the proxy server details as given in HTTP error while using conda for installation of any packages
Try copying these files from Anaconda3/Library/bin to Anaconda3/DLLs :
libcrypto-1_1-x64.dll
libssl-1_1-x64.dll
When I had an SSL error related to conda on my work laptop behind a firewall, I had to set ssl_verify to false to get it to work.
This should do the job.
conda config --set ssl_verify False
This is due to .dll error
go to location where you've install anaconda3>Library>bin. search and copy following dll files
libcrypto-1_1-x64.dll
libssl-1_1-x64.dll
and paste to anaconda3>DLLs.
then restart your pc.
issue will get resolved.
The following steps worked for me:
Use this command to see proxy_servers
conda config --show
This will remove saved proxy servers from anaconda configuration.
conda config --remove-key proxy_servers
conda clean --source-cache
Hope this helps you.

Cannot deploy smart contract with Eris / Monax

I'm following the Getting Started Tutorial, using eris version 0.12.0
I stuck at the point where to deploy the smart contract ~/.eris/apps/idi/idi.sol
eris pkgs do --chain simplechain --address $addr
By random I get either of following two errors:
Performing action. This can sometimes take a wee while
Could not perform pkg action service: Could not perform pkg action: Docker: {"m
ssage":"Cannot link to a non running container: /simplechain-a49e7fc2-45d4-44df
83bf-1dfab6246c13 AS /interactive-67fff395-600b-4161-912b-df11dc6b2807/chain"}
or:
Performing action. This can sometimes take a wee while
Could not perform pkg action service: Docker: {"message":"Invalid container name
(.eris_tmp_-798bc8a1-70bb-45fd-ac23-8468503cdbad), only [a-zA-Z0-9][a-zA-Z0-9_.
-] are allowed"}
When I install eris version 0.11.4 the error looks like this:
Performing action. This can sometimes take a wee while
Sorry, the marmots were unable to load the eris-pm jobs file. Please check your
path.
ERROR => Unsupported Config Type ""
Container interactive-39ac3a49-52fa-4f1d-953e-1662b1af7f21 exited with status 1
I restarted Docker Quickstart Terminal several times and also deleted the default VM in VirtualBox.
What I'm doing wrong? Thanks for help!
In addition to David's answer, you also should run
eval $(docker-machine env eris) to activate the docker-image.
I had been missing the eris docker-machine running. You can check this with
docker-machine ls
And you can recreate it with:
docker-machine create -d virtualbox eris
Thanks to quick help from Monax / Eris team.

Puppet Does not load class in custom module

A beginner environment with Puppet(3.8.4)+Apache(2.2.15)+Passenger on CentOS6.5
An agent run returns with
Error: /File[/var/lib/puppet/lib]: Could not evaluate: Could not retrieve
information from environment production source(s)
puppet://puppetmaster/plugins
Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
Puppet::Parser::AST::Resource failed with error ArgumentError: Could not
find declared class mediawiki at
/etc/puppet/environments/production/manifests/nodes.pp:10 on node wikitest
This is sequence of installing the module:
$>sudo puppet module generate my-mediawiki --environment production
$>sudo mv my-mediawiki mediawiki (just renaming the folder)
$sudo puppet module list
/etc/puppet/modules (no modules installed)
/usr/share/puppet/modules (no modules installed)
I have tried adding $confdir/environments/production/modules to environment.conf of the production environment and
to the basemodulepath in puppet.conf as the first entry, but it doesn't seem to be looking there.
$confdir/environments/production/modules/mediawiki/manifests/init.pp has the empty class declaration. '$confdir/environments/production/nodes.pp`
has the class statements in both nodes and both have the same error.
I've already tried:
1) removing the module and trying again, with all the puppet service stopped/started etc
2) there are no spelling or quotation mark errors
3) I've modified metadata.json in the mediawiki folder to be same as folder name just in case that mattered, but no luck.
4) Certificates are fine, communication is fine. I have another class defined as resource within the nodes.pp file and that runs fine.
Any help appreciated!

Create local debian repository

My goal is to demonstrate creating a local debian repository with controlled versions of tools used (e.g. compiler versions) to make a build system more predictable.
I've tried to follow this example: http://linuxconfig.org/easy-way-to-create-a-debian-package-and-local-package-repository
but when I get to the apt-get update stage, I always get a 404 not found on the repository I've added.
The apache2 server is running, I can view the default page installed at http://localhost/html/index.html.
I am trying this with the file fortune-mod_1%3a1.99.1-7_amd64.deb installed to /var/www/debs. I create the Packages.gz file as the tutorial suggests:
dpkg-scanpackages debs /dev/null | gzip -9c > debs/Packages.gz
I also add a new file: /etc/apt/sources.list.d/myppa.list with this line:
deb http://localhost debs/
I restart the apache2 service just in case:
sudo service apache2 restart
but running:
sudo apt-get update
still produces this error:
W: Failed to fetch http://localhost/debs/Packages 404 Not Found
Is there something basic I'm missing? Ultimately, I'd like to get this working over a LAN, but first have to get it working on a single machine.
EDIT: I'm doing this on Ubuntu 14.04.
EDIT: Show contents of file /etc/apt/sources.list.d/myppa.list
tldr; use aptly
It's the easiest apt repository management tool I've found and it comes with neat tutorial showing how to create, populate, and publish your own apt repository.
References:
https://www.aptly.info/
https://www.aptly.info/tutorial/repo/
I ended up solving the problem. It was an issue with the default document root being different for the tutorial than on my system. All I did was move my debs folder to html (document root turns out to be /var/www/html, not just /var/www on my install). That did the trick.

From where my package openvpn getting installed?

When I write in my recipe:
package "openvpn" do
action :install
end
The package is being installed, but
I want to know where my package is installing from.
I want to do it differently - I want to download the openvpn software and put it in S3 from there I want to get it back.
package "openvpn" do
action :install
end
remote_file "\etc\openvpn" do
source "I want to take it from S3"
action :install
end
Can I do it the second way if yes my package name should be openvpn or something else.
Openvpn is packaged by Ubuntu, so it is coming from the Ubuntu package repository. Chef uses the apt package provider for the package resource. This means while you say package "openvpn" in your recipe, under the covers Chef looks at the node's platform (e.g., ubuntu 12.04) and uses apt-get install to install it. If you were using CentOS, it would use yum instead.
If you want to use S3 to store a config file, you would specify the source as the URI to the actual file with remote file:
Example:
remote_file "/etc/openvpn/openvpn.conf" do
source "https://your-bukket.s3.amazonaws.com/openvpn.conf"
action :create
end
If the bucket is private, you'll need to use an alternative resource such as aws_s3_file from Opscode's "aws" cookbook. See the README for information about how to use that resource - it passes in the AWS credentials to access the item in the bucket.
If you want to provide your own openvpn package and download it from S3, you can do so with this:
remote_file "/tmp/openvpn-VERSION.deb" do
source "https://your-bukket.s3.amazonaws.com/openvpn-VERSION.deb"
action :create_if_missing
end
dpkg_package "openvpn" do
source "/tmp/openvpn-VERSION.deb"
action :install
end
(Replace VERSION with your actual version, or otherwise change the filename to suit your preferences)