Trying to install apache on CentOS7 using Chef - apache

I'm trying to use Chef on CentOS7 and I'm at the beginning ... following the tutorial I0m trying to install apache using this recipe.
package 'apache2' do
action :install
end
service 'apache2' do
action [:enable, :start]
end
file '/var/www/index.html' do
content '<html>
<body>
<h1>Hello world!!</h1>
</body>
</html>'
end
When I try to execute I obtain this error ...
[osboxes#osboxes chef-repo]$ sudo chef-apply hello.rb
Recipe: (chef-apply cookbook)::(chef-apply recipe)
* yum_package[apache2] action install
* No candidate version available for apache2
================================================================================
Error executing action `install` on resource 'yum_package[apache2]'
================================================================================
Chef::Exceptions::Package
-------------------------
No candidate version available for apache2
The same if I use a simpler recipe like this
package 'apache2'
My Chef client workstation installation is the following
[osboxes#osboxes chef-repo]$ chef --version
Chef Development Kit Version: 3.0.36
chef-client version: 14.1.12
delivery version: master (7206afaf4cf29a17d2144bb39c55b7212cfafcc7)
berks version: 7.0.2
kitchen version: 1.21.2
inspec version: 2.1.72

On CentOS / RHEL etc (and on Fedora) the package name for Apache is "httpd".
Alternatively, there is a standard cookbook for installing and configuring Apache2:
https://supermarket.chef.io/cookbooks/apache2
It is fairly sophisticated, and includes recipes for configuring a number of common Apache modules.

Related

Install Ambari, can't download hortonworks HDP from amazon S3

I'm tring to install apache ambari on my wsl(ubuntu 20.04) as the Ambari User Guides step by step. while install and packing the project to deb files use command:
mvn -B clean install jdeb:jdeb -DnewVersion=2.7.5.0.0 -DbuildNumber=5895e4ed6b30a2da8a90fee2403b6cab91d19972 -DskipTests -Dpython.ver="python >= 2.6" .
got this error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (default) on project ambari-metrics-timelineservice: An Ant BuildException has occured: Can't get https://s3.amazonaws.com/dev.hortonworks.com/HDP/centos7/3.x/BUILDS/3.1.4.0-315/tars/hbase/hbase-2.0.2.3.1.4.0-315-bin.tar.gz to /root/apache-ambari-2.7.5-src/ambari-metrics/ambari-metrics-timelineservice/target/embedded/hbase.tar.gz
[ERROR] around Ant part ...<get usetimestamp="true" src="https://s3.amazonaws.com/dev.hortonworks.com/HDP/centos7/3.x/BUILDS/3.1.4.0-315/tars/hbase/hbase-2.0.2.3.1.4.0-315-bin.tar.gz" dest="/root/apache-ambari-2.7.5-src/ambari-metrics/ambari-metrics-timelineservice/target/embedded/hbase.tar.gz"/>... # 5:273 in /root/apache-ambari-2.7.5-src/ambari-metrics/ambari-metrics-timelineservice/target/antrun/build-Download HBase.xml
apache-ambari-2.7.5-src/ambari-metrics/pom.xml defined the nortonworks HDP sources:
<hbase.tar>http://dev.hortonworks.com.s3.amazonaws.com/HDP/centos7/3.x/BUILDS/3.0.0.0-1634/tars/hbase/hbase-2.0.0.3.0.0.0-1634-bin.tar.gz</hbase.tar>
<hbase.folder>hbase-2.0.0.3.0.0.0-1634</hbase.folder>
<hadoop.tar>http://dev.hortonworks.com.s3.amazonaws.com/HDP/centos7/3.x/BUILDS/3.0.0.0-1634/tars/hadoop/hadoop-3.1.0.3.0.0.0-1634.tar.gz</hadoop.tar>
<hadoop.folder>hadoop-3.1.0.3.0.0.0-1634</hadoop.folder>
<phoenix.tar>http://dev.hortonworks.com.s3.amazonaws.com/HDP/centos7/3.x/BUILDS/3.0.0.0-1634/tars/phoenix/phoenix-5.0.0.3.0.0.0-1634.tar.gz</phoenix.tar>
<phoenix.folder>phoenix-5.0.0.3.0.0.0-1634</phoenix.folder>
I tried to download official Hbase-2.3.2, Hadoop-3.3.0,phoenix-5.0.0-HBase-2.0 to instead hotonworks HDP, but failed and got an other error.
I tried to download hortonworks HDP directly use wget and got:
Resolving dev.hortonworks.com.s3.amazonaws.com (dev.hortonworks.com.s3.amazonaws.com)... 52.217.40.204
Connecting to dev.hortonworks.com.s3.amazonaws.com
(dev.hortonworks.com.s3.amazonaws.com)|52.217.40.204|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
where/how can i download these hortonworks HDP files and continue to install ambari?
This solution from the Apache Ambari team fixed this and other similar issues with HDP urls: https://github.com/apache/ambari/pull/3283
You need to make the corresponding code changes: https://github.com/apache/ambari/pull/3283/commits/3dca705f831383274a78a8c981ac2b12e2ecce85
replace the downlink with
<hbase.tar>https://s3.amazonaws.com/dev.hortonworks.com/HDP/centos7/3.x/BUILDS/3.1.4.1-1/tars/hbase/hbase-2.0.2.3.1.4.1-1-bin.tar.gz</hbase.tar>
<hbase.tar>https://private-repo-1.hortonworks.com/HDP/centos7/3.x/updates/3.1.4.1-1/tars/hbase/hbase-2.0.2.3.1.4.1-1-bin.tar.gz</hbase.tar>
<hbase.folder>hbase-2.0.2.3.1.4.1-1</hbase.folder>
<hadoop.tar>https://s3.amazonaws.com/dev.hortonworks.com/HDP/centos7/3.x/BUILDS/3.1.4.1-1/tars/hadoop/hadoop-3.1.1.3.1.4.1-1.tar.gz</hadoop.tar>
<hadoop.tar>https://private-repo-1.hortonworks.com/HDP/centos7/3.x/updates/3.1.4.1-1/tars/hadoop/hadoop-3.1.1.3.1.4.1-1.tar.gz</hadoop.tar>
<hadoop.folder>hadoop-3.1.1.3.1.4.1-1</hadoop.folder>
<grafana.folder>grafana-6.4.2</grafana.folder>
<grafana.tar>https://dl.grafana.com/oss/release/grafana-6.4.2.linux-amd64.tar.gz</grafana.tar>
<phoenix.tar>https://s3.amazonaws.com/dev.hortonworks.com/HDP/centos7/3.x/BUILDS/3.1.4.1-1/tars/phoenix/phoenix-5.0.0.3.1.4.1-1.tar.gz</phoenix.tar>
<phoenix.tar>https://private-repo-1.hortonworks.com/HDP/centos7/3.x/updates/3.1.4.1-1/tars/phoenix/phoenix-5.0.0.3.1.4.1-1.tar.gz</phoenix.tar>
<phoenix.folder>phoenix-5.0.0.3.1.4.1-1</phoenix.folder>
edit file ambari-metrics/pom.xml and replace download link, for example I changed
https://s3.amazonaws.com/dev.hortonworks.com/HDP/centos7/3.x/BUILDS/3.1.4.0-315/tars/hbase/hbase-2.0.2.3.1.4.0-315-bin.tar.gz
for
https://downloads.apache.org/hbase/2.3.5/hbase-2.3.5-src.tar.gz

Apache prefolk module cannot run concurrently with php7.2 module

1.Environment
Uname 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Apache/2.4.29 (Ubuntu)
PHP 7.2.17-0ubuntu0.18.04.1 (cli)
2.Problem
I use the a2dismod command to close the mpm_prefolk and php7.2 modules, continue to use a2enmod to open the mpm_event module, open the event successfully, but after I continue to try to open the php7.2 module, an error occurred.
Operation process & ErrorCode
So I just turned off mpm_prefolk and then opened php7.2 as it said, php7.2 loaded successfully, but it automatically loaded the mpm_prefolk module.
Operation process
But at this time, the mpm_event module cannot be loaded.
ErrorCode
It needs to let me close mpm_prefolk,Just like an infinite loop, I don't know if I should reinstall the php environment or apache server, or php7.2 can only work with apache mpm_prefolk working mode, so I can only temporarily change it back.
3.Solution & Analyze
I solved the problem by reinstall the suit of php and apache ,and i read the apache documentation. So i found that apache mod_php only spport the prefolk module. You must install the php fpm Module

Trafodion installation ERROR: Error while running traf_start

I am trying to install trafodion on Hortonworks 2.2 virtual machine.The following are the machine configurations.
Hotonwork 2.2 virual machine
HBase version 0.98.
Centos version.
I have tried following steps to install trafodion.
1) I have downloaded
log4c++ RPM
Trafodion Installer
Trafodion Server
2)mkdir $HOME/trafodion
mkdir $HOME/trafodion/downloads
cd $HOME/trafodion/downloads
3) yum install to install the log4c++ RPM
4)cd $HOME/trafodion/downloads
tar -zxf apache-trafodion-installer-1.3.0-incubating-bin.tar.gz -C $HOME/trafodion
5)cd $HOME/trafodion/installer
cp trafodion_config_default my_config and Edit Configuration File.
6)cd $HOME/trafodion/installer
./trafodion_install --accept_license --config_file my_config
When running installation I obtain following message.
home/trafodion/traf
****INFO: Copying over sqenvcom.sh
***INFO: untarring build file /usr/lib/trafodion/apache-trafodion-1.3.0-incubating-bin/trafodion_server-1.3.0.tgz to home/trafodion/traf
***ERROR: SQ config file cannot be found (home/trafodion/traf/sql/scripts/sqconfig).
***ERROR: Error while running traf_start.
***ERROR: Setup not complete, review logs.
***ERROR: Exiting....
I don't understand why is it saying that. I have defined all configurations in myconfig file.
Any help is appreciated.
See also the discussion on the Trafodion dev mailing list on Apr. 21. Here is the answer Amanda gave on that list:
Amanda Moran via trafodion.incubator.apache.org Apr 22 (4 days ago)
to dev Hi there Devidas-
If you are on a single node instance SQCONFIG should equal "". This
will signal the installer to go grab our standard file located in
$SQ_ROOT/sql/scripts.
Thanks!
Amanda

PHP Warning: PHP Startup: Unable to load dynamic library

I am installing the ElastiCache Cluster Client for PHP on Red Hat 7.2 and centos 6.5 Amazon AMI , but issue still same on all.
cat /etc/os-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.2 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="7.2"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.2 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.2:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.2
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.2"
after install elastcache cluster cleint for php i got this error
php -v
PHP Warning: PHP Startup: Unable to load dynamic library '/etc/php/lib/php/extensions/no-debug-non-zts-20131226/amazon-elasticache-cluster- client.so' - libsasl2.so.2: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.6.15 (cli)
i have installed php by compiling/configure.
please let me know how to get out from this error, i tried everything but issue still same.
On some systems, notably CentOS7 and Red Hat Enterprise Linux (RHEL) 7.1, libsasl2.so.3 has replaced libsasl2.so.2. On those systems, when you load the ElastiCache cluster client, it attempts and fails to find and load libsasl2.so.2. To resolve this issue, create a symbolic link to libsasl2.so.3 so that when the client attempts to load libsasl2.so.2, it is redirected to libsasl2.so.3. The following code creates this symbolic link.
cd /usr/lib64
sudo ln libsasl2.so.3 libsasl2.so.2
Source: From AWS documentation http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Appendix.PHPAutoDiscoverySetup.Installing.html

Apache segfault with passenger

I have problem installin passenger under Linux.
The way I'm doning it is
Added repository: deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main to /etc/apt/sources.list.d/passenger.list
Installed it:
sudo apt-get install libapache2-mod-passenger
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libev4
Use 'apt-get autoremove' to remove it.
The following NEW packages will be installed:
libapache2-mod-passenger
0 upgraded, 1 newly installed, 0 to remove and 580 not upgraded.
Need to get 0 B/273 kB of archives.
After this operation, 1 281 kB of additional disk space will be used.
Selecting previously unselected package libapache2-mod-passenger.
(Reading database ... 287776 files and directories currently installed.)
Preparing to unpack .../libapache2-mod-passenger_1%3a5.0.13-1~trusty1_amd64.deb ...
Unpacking libapache2-mod-passenger (1:5.0.13-1~trusty1) ...
Setting up libapache2-mod-passenger (1:5.0.13-1~trusty1) ...
Then I tried to enable passenger module with sudo a2enmod passenger but for some reason I had /etc/apache2/mods-available/passenger.conf and /etc/apache2/mods-available/passenger.load files missed after installation. (They are not created and also not removed with libapache2-mod-passenger so I suppose this is some kind of a bug). So I created them manually:
s
set#set:~$ which ruby
/home/set/.rvm/rubies/ruby-2.1.5/bin/ruby
set#set:~$ which rails
/home/set/.rvm/gems/ruby-2.1.5/bin/rails
set#set:~$ ll /usr/lib/apache2/modules/ | grep passenger
-rw-r--r-- 1 root root 1209112 Jul 3 01:35 mod_passenger.so
/etc/apache2/mods-available/passenger.conf:
<IfModule passenger_module>
PassengerRoot /home/set/.rvm/gems/ruby-2.1.5/bin/passenger
PassengerRuby /home/set/.rvm/rubies/ruby-2.1.5/bin/ruby
</IfModule>
and /etc/apache2/mods-available/passenger.load:
LoadModule passenger_module /usr/lib/apache2/modules/mod_passenger.so
the module was successfully enabled then but when I was restarting apache it throw me a segfault:
a
Starting web server apache2 Segmentation fault (core dumped)
Action 'start' failed.
The Apache error log may have more information.
The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
and the coredump:
GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from apache2...(no debugging symbols found)...done.
[New LWP 30116]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/sbin/apache2 -k start'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007faa58b8e37e in std::_Rb_tree<std::string, std::pair<std::string const, std::string>, std::_Select1st<std::pair<std::string const, std::string> >, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::_M_begin() const () from /usr/lib/apache2/modules/mod_passenger.so
So I stuck at this point and have no idea where to move nex. Reinstalling of libapache2-mod-passenger does not help. How can I fix this problem?
This issue is more like memory issue.
I am facing something similar as your issue. But my case is happening with the virtual box VM's. A similar setup for me worked on a typical hardware with more RAM.
What I am doing now to fix this issue is to install the latest passenger module.
gem install passenger and running passenger-install-apache2-module which comes natively with passenger.
and I think the latest module just work.
Here is my puppetmaster.conf file entries under apache conf dir.
LoadModule passenger_module /usr/local/share/gems/gems/passenger-5.0.26/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/share/gems/gems/passenger-5.0.26