Download and extract php source to /opt/software folder
cd /opt/software/php-7.2.7
yum install libjpeg-devel libpng-devel
./configure --prefix=/usr/local/apache/php --with-config-file-path=/usr/local/apache/php --with-apxs2=/usr/local/apache/bin/apxs --disable-cgi --with-zlib --with-gettext --with-sqlite3 --enable-mbstring --enable-calendar --with-curl=/usr/lib64 --with-gd --with-jpeg-dir=/usr/lib64/libjpeg.so --with-png-dir=/usr/lib64/libpng.so --enable-soap --with-libdir=/lib64 --enable-zip --with-mysqli --with-pdo-mysql --with-openssl-dir
make
make install
Add following lines in httpd.conf to enable php
LoadModule php7_module modules/libphp7.so
AddType application/x-httpd-php .php
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
Restart httpd
/etc/init.d/web.system restart
This Blog is about new technologies, Linux, Sysadmin, Devops, Programming, AWS, Cloud platforms, HP, Hardware, Tech news, Networking, How tos, Configurations, Apache, PHP, Java, Kubernetes, Docker, Openstack, MySQL,
Tuesday, October 23, 2018
Monday, October 22, 2018
Installing nagios NRPE on AWS EC2
yum install nagios-plugins-all nagios-plugins-nrpe nrpe
chkconfig nrpe on
update the config by checking allowed_hosts and
vi /etc/nagios/nrpe.cfg
sudo /etc/init.d/nrpe start
How to install Nagios on AWS
Prerequisites
=========
* Apache
* PHP
* GCC compiler
* GD development libraries
Steps
====
sudo yum install httpd php
sudo yum install gcc glibc glibc-common
sudo yum install gd gd-devel
Create Users
=========
sudo adduser -m nagios
sudo passwd nagios
sudo groupadd nagcmd
sudo usermod -a -G nagcmd nagios
sudo usermod -a -G nagcmd apache
Download Nagios Core
=================
mkdir ~/downloads
cd ~/downloads
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.8.tar.gz
wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
Compile and Install Nagios
====================
tar zxvf nagios-4.0.8.tar.gz
cd nagios-4.0.8
./configure --with-command-group=nagcmd
make all
sudo make install
sudo make install-init
sudo make install-config
sudo make install-commandmode
Customize Configuration
==================
Sample configuration files have now been installed in the /usr/local/nagios/etc directory. These sample files should work fine for getting started with Nagios. You'll need to make just one change before you proceed...
Edit the /usr/local/nagios/etc/objects/contacts.cfg config file with your favorite editor and change the email address associated with the nagiosadmin contact definition to the address you'd like to use for receiving alerts.
sudo vim /usr/local/nagios/etc/objects/contacts.cfg
Configure the Web Interface
====================
Install the Nagios web config file in the Apache conf.d directory.
sudo make install-webconf
Create a nagiosadmin account for logging into the Nagios web interface. Remember the password you assign to this account - you'll need it later.
sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Type the new password twice. Restart Apache to make the new settings take effect.
sudo service httpd restart
Compile and Install the Nagios Plugins
============================
cd ~/downloads
tar zxvf nagios-plugins-2.0.3.tar.gz
cd nagios-plugins-2.0.3
Compile and install the plugins.
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
sudo make install
Start Nagios
=========
sudo chkconfig --add nagios
sudo chkconfig nagios on
Verify the sample Nagios configuration files.
sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
If there are no errors, start Nagios.
sudo service nagios start
Enable 80 port in AWS
=================
* From the EC2 console select Security Groups from the left navigation pane.
* Select the Security Group applicable for the instance that Nagios was installed on and open the Inbound tab
* If there is no rule to allow HTTP traffic on port 80 then click edit in the Inbound tab to add a new rule
* Click on New Rule button
* Scroll down to select HTTP from the list under Type
* If you want to be able to access nagios from anywhere then select Save, otherwise enter the IP address or range of IP address you want to be able to access it from then select Save.
Access Nagios
===========
http://ec2-xx-xxx-xxx-xx.ap-southeast-2.compute.amazonaws.com/nagios/
=========
* Apache
* PHP
* GCC compiler
* GD development libraries
Steps
====
sudo yum install httpd php
sudo yum install gcc glibc glibc-common
sudo yum install gd gd-devel
Create Users
=========
sudo adduser -m nagios
sudo passwd nagios
sudo groupadd nagcmd
sudo usermod -a -G nagcmd nagios
sudo usermod -a -G nagcmd apache
Download Nagios Core
=================
mkdir ~/downloads
cd ~/downloads
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.8.tar.gz
wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
Compile and Install Nagios
====================
tar zxvf nagios-4.0.8.tar.gz
cd nagios-4.0.8
./configure --with-command-group=nagcmd
make all
sudo make install
sudo make install-init
sudo make install-config
sudo make install-commandmode
Customize Configuration
==================
Sample configuration files have now been installed in the /usr/local/nagios/etc directory. These sample files should work fine for getting started with Nagios. You'll need to make just one change before you proceed...
Edit the /usr/local/nagios/etc/objects/contacts.cfg config file with your favorite editor and change the email address associated with the nagiosadmin contact definition to the address you'd like to use for receiving alerts.
sudo vim /usr/local/nagios/etc/objects/contacts.cfg
Configure the Web Interface
====================
Install the Nagios web config file in the Apache conf.d directory.
sudo make install-webconf
Create a nagiosadmin account for logging into the Nagios web interface. Remember the password you assign to this account - you'll need it later.
sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Type the new password twice. Restart Apache to make the new settings take effect.
sudo service httpd restart
Compile and Install the Nagios Plugins
============================
cd ~/downloads
tar zxvf nagios-plugins-2.0.3.tar.gz
cd nagios-plugins-2.0.3
Compile and install the plugins.
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
sudo make install
Start Nagios
=========
sudo chkconfig --add nagios
sudo chkconfig nagios on
Verify the sample Nagios configuration files.
sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
If there are no errors, start Nagios.
sudo service nagios start
Enable 80 port in AWS
=================
* From the EC2 console select Security Groups from the left navigation pane.
* Select the Security Group applicable for the instance that Nagios was installed on and open the Inbound tab
* If there is no rule to allow HTTP traffic on port 80 then click edit in the Inbound tab to add a new rule
* Click on New Rule button
* Scroll down to select HTTP from the list under Type
* If you want to be able to access nagios from anywhere then select Save, otherwise enter the IP address or range of IP address you want to be able to access it from then select Save.
Access Nagios
===========
http://ec2-xx-xxx-xxx-xx.ap-southeast-2.compute.amazonaws.com/nagios/
Subscribe to:
Posts (Atom)