Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Recent Posts

Pages: 1 ... 7 8 [9] 10
81
General Linux / Change Hostname in CentOS Linux 5/6
« Last post by akhilt on August 04, 2018, 10:26:34 am »
Change Hostname in CentOS Linux 5/6


You need to use the following commands to set or view current hostname, domain name and/or FQDN (Fully Qualified Domain Name):

 - dnsdomainname command: Display the system’s DNS domain name.
 - hostname command: Show or set the system’s hostname.

You also need to edit the following files for a hostname change:

1. /etc/sysconfig/network file.
2. /etc/hosts file.

In this tutorial, I will show you how to set/change a server hostname in CentOS Linux to “server.domainname.com”.

Display current hostname


Type the following command:
Code: [Select]
# hostname
Sample outputs:
Code: [Select]
server1
To display current domain name:

Type the following command:
Code: [Select]
# dnsdomainname
Sample outputs:
Code: [Select]
domainname.com
Hostname change procedure on CentOS

Open the terminal or login to the remote server using ssh client. Edit /etc/sysconfig/network file, enter:
Code: [Select]
# vi /etc/sysconfig/network
Find and modify HOSTNAME value to set to FQDN such as 'server.domainname.com'
Code: [Select]
HOSTNAME="server.domainname.com"
Save and close the file.

Edit hosts file

Edit /etc/hosts file, enter:
Code: [Select]
# vi /etc/hosts
You need to set or change the host that is set to your IP address on the server.

Code: [Select]
127.0.0.1 localhost
10.240.40.209 server.domainname.com server
 

Save and close the file.

Set hostname manually without rebooting the server

Type the following command:
Code: [Select]
# hostname server.domainname.com
Restart the CentOS networking and other services

You need to restart the networking service on CentOS Linux, enter:
Code: [Select]
# service network restart OR
Code: [Select]
# /etc/init.d/network restart
Verify new hostnames

Simply type the following commands:
Code: [Select]
# hostname
# dnsdomainname

Hoping the information will come in handy,
Thank You! :)
82
General Linux / How to Install Nagios 4.3.4 on CentOS
« Last post by vichithrakumart on August 04, 2018, 08:57:18 am »
Nagios, now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services

Install Required Dependencies

Code: [Select]
# yum install -y httpd httpd-tools php gcc glibc glibc-common gd gd-devel make net-snmp
Create Nagios User and Group
Code: [Select]
# useradd nagios
# groupadd nagcmd

Next, add both the nagios user and the apache user to the nagcmd group.

Code: [Select]
# usermod -G nagcmd nagios
# usermod -G nagcmd apache

Download Nagios Core 4.3.4 and Nagios Plugin 2.2.1

Create a directory for your Nagios installation and all its future downloads.

Code: [Select]
# mkdir /root/nagios
# cd /root/nagios

Now download latest Nagios Core 4.3.4 and Nagios plugins 2.2.1 packages with wget command.

Code: [Select]
#wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.3.4.tar.gz
# wget https://nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz

Extract Nagios Core and its Plugins

Code: [Select]
# tar -xvf nagios# tar -xvf nagios-4.3.4.tar.gz-4.3.4.tar.gz
# tar -xvf nagios-plugins-2.2.1.tar.gz

Configure Nagios Core

Code: [Select]
# cd nagios-4.3.4/
# ./configure --with-command-group=nagcmd
# make all
# make install

Following command will install the init scripts for Nagios.

Code: [Select]
# make install-init
To make nagios work from command line we need to install command-mode.

Code: [Select]
# make install-commandmode
Next, install sample nagios files, please run following command.

Code: [Select]
# make install-config
Customizing Nagios Configuratio

Open the “contacts.cfg” file with your choice of editor and set the email address associated with the nagiosadmin contact definition to receiving email alerts.

Code: [Select]
# vi /usr/local/nagios/etc/objects/contacts.cfg
Code: [Select]
Install and Configure Web Interface for Nagios
Code: [Select]
# make install-webconf
In this step, we will be creating a password for “nagiosadmin”. After executing this command, please provide a password twice and keep it remember because this password will be used when you login in the Nagios Web interface

Code: [Select]
# htpasswd -s -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Restart Apache to make the new settings take effect.

Code: [Select]
# service httpd start

Login to the Nagios Web Interface

Your nagios is ready to work, please open it in your browser with “http://Your-server-IP-address/nagios” or “http://FQDN/nagios” and Provide the username “nagiosadmin” and password.
83
General Linux / how to manage the Fan speed of a Linux powered laptop
« Last post by vichithrakumart on August 04, 2018, 07:46:39 am »
Open terminal and log in as root user and run the following command

Code: [Select]
# sensors-detect
and answered "y" (yes) to all the questions.

Reboot the laptop
84
General Windows / Disable User Account Control (UAC) on Windows 7,8 or 10
« Last post by vichithrakumart on July 28, 2018, 04:51:15 pm »
UAC is a pop-up which warns when we install a program that makes changes on the computer.  It may show like this:



To disable it, click start and type "uac" on the search box, and then click the “Change User Account Control settings” result.



In the “User Account Control Settings” window, drag the slider all the way down to the “Never Notify” setting. Click “OK” when you’re done.



85
General Linux / How to Find MySQL, PHP and Apache Configuration Files:awk and sed
« Last post by sibij on July 28, 2018, 01:47:21 pm »
Check configuration file of mysql, php, nginx
Code: [Select]
$ mysql --help | awk '$0~/Default options/{getline;print}'
/etc/my.cnf ~/.my.cnf
$ mysqladmin --help | awk '$0~/Default options/{getline;print}'
/etc/my.cnf ~/.my.cnf

Check PHP Configuration File.
Code: [Select]
$ php -i | awk '$0~/^Loaded Configuration File/{print $NF}'
/etc/php.ini

Check Nginx Configuration File.

$ nginx -V 2>&1 | sed -r -n 's@.*conf-path=(.*) --error.*@\1@p'
/etc/nginx/nginx.conf
86
General Linux / Install Zabbix Server
« Last post by sibij on July 28, 2018, 01:31:55 pm »
Install Zabbix Server

Install Zabbix server and Zabbix PHP frontend application by adding the official Zabbix repositories to your system package manager by issuing the following commands with root privileges.

Install Zabbix on Debian

Code: [Select]
# wget http://repo.zabbix.com/zabbix/3.4/debian/pool/main/z/zabbix-release/zabbix-release_3.4-1+stretch_all.deb
# dpkg -i zabbix-release_3.4-1+stretch_all.deb
# apt update
# apt install zabbix-server-mysql zabbix-frontend-php

Install Zabbix on Ubuntu

Code: [Select]
# wget http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+xenial_all.deb
# dpkg -i zabbix-release_3.4-1+xenial_all.deb
# apt-get update
# apt install zabbix-server-mysql zabbix-frontend-php

Install Zabbix on CentOS

Code: [Select]
# rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
# yum install zabbix-server-mysql zabbix-web-mysql

If you want to download and compile an older version, please visit Zabbix official Sourceforge repositories.

8. Next, issue the below command with root privileges in order to install Zabbix agent in your system. Zabbix client will be used to actively monitor server’s local system resources.
Code: [Select]
# apt install zabbix-agent    [On Debian/Ubuntu]
# yum install zabbix-agent    [On RHEL/CentOS 7]

9. On the next step, restart Apache HTTP server in order to apply Zabbix configuration file installed for Apache.

Code: [Select]
# systemctl restart apache2   [On Debian/Ubuntu]
# systemctl restart httpd     [On RHEL/CentOS 7]
# setenforce 0                [Disable SELinux on RHEL/CentOS 7]

Step 4: Configure Zabbix Server and Agent

10. Before configuring the server, first, import Zabbix initial database schema to MySQL database. Import the schema against the database created for Zabbix application, by issuing the below command.

Code: [Select]
# zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -u zabbixuser zabbixdb -p
11. On the next step, setup Zabbix server by opening the main configuration file for editing with the following command.

Code: [Select]
# nano /etc/zabbix/zabbix_server.conf
In zabbix_server.conf file search and modify the following lines as presented in the below excerpt. Update the variables to reflect your own database settings.

Code: [Select]
DBHost=localhost
DBName=zabbixdb
DBUser=zabbixuser
DBPassword=password1

12. Finally, save and close Zabbix server configuration file by pressing Ctrl+o and Ctrl+x file and restart Zabbix daemon to apply changes by issuing the below command.

Code: [Select]
# systemctl restart zabbix-server.service
13. Next, configure Zabbix Agent configuration file by updating the following lines. First, open the file for editing.

Code: [Select]
# nano /etc/zabbix/zabbix_agentd.conf
Zabbix agent configuration file excerpt:

Server=127.0.0.1
ListenPort=10050

14. Save and close Zabbix agent configuration file and restart Zabbix Agent to reflect changes by issuing the following command.

Code: [Select]
# systemctl restart zabbix-agent.service
Install and Configure Zabbix Frontend Interface

 it’s time to install Zabbix Server Frontend web interface. In order to accomplish this step open a browser and navigate to your server IP Address using HTTP or HTTPS protocol and the welcome screen should appear. Hit the Next button to move forward.

Code: [Select]
http://192.168.1.151/setup.php
OR
https://192.168.1.151/setup.php

1. On the first welcome screen, just hit the Next step button to move to the new step of the installation process.

2. After a series of checks, if all pre-requires values are satisfied, hit the Next button to proceed further.

3. On the next step provide the settings for MySQL database, hit the Test connection button to test MySQL connectivity and move to the step by pressing the Next button.

4. On the next step provide the settings for MySQL database, hit the Test connection button to test MySQL connectivity and move to the step by pressing the Next button.

5. Next, check all the configurations parameters, enter command line and issue the following command to grant zabbix permissions to write the apache web configuration file in conf directory.

Then switch back to web interface and hit Next button to write zabbix configuration file.

6. After the installation process completes, a congratulations message will appear in your browser. Hit on Finish button to exit Zabbix frontend installer.

7. Finally, navigate to your server IP address or domain name by appending /zabbix URL address and log in to Zabbix web admin panel with the default credentials presented below.

Code: [Select]
https://your_domain.tld/zabbix/
Username: Admin
Password: zabbix

8. After you’ve logged in to Zabbix admin panel, you can start to configure Zabbix and add new network resources to be monitored by Zabbix server.

9. To change Zabbix frontend admin account password, navigate to Administration -> Users –> User and hit on Change password button and add your new password, as illustrated in the below screenshot. Finally, hit on the bottom Update button in order to save admin account new password.
87
General Linux / Install Lighttpd with PHP5 and MySQL (LLMP Stack) on Ubuntu 14.04
« Last post by vichithrakumart on July 27, 2018, 12:47:24 am »
Lighttpd is a popular event-based web server alternative to Nginx. Lighttpd can be used to serve high traffic sites even on a small VPS.

Follow below steps to install Lighttpd with PHP 5 (PHP5-FPM) and MySQL on Ubuntu 14.04

Step 1: Install Lighttpd

Install Lighttpd with the following commands.

Code: [Select]
sudo apt-get update
sudo apt-get install lighttpd

This will start Lighttpd once the install finishes. You can test the status of the server by accessing the IP address of your VPS in a web browser. Upon success, you will see the Lighttp welcome page.

If the page does not load, you can force-restart the service.

Code: [Select]
sudo service lighttpd start
Step 2: Install PHP 5

Install PHP5 with the following command.

Code: [Select]
sudo apt-get install php5-cgi php5-mysql
Note that the "php5-mysql" package is needed to use MySQL server with PHP

Step 3: Enable FastCGI

Enable PHP5 CGI modules in Lighttpd with the following commands.

Code: [Select]
sudo lighty-enable-mod fastcgi
sudo lighty-enable-mod fastcgi-php

After enabling the modules, you need to restart the Lighttpd service

Code: [Select]
sudo service lighttpd force-reload
Step 4: Test PHP integration

Test the PHP integration with Lighttpd. To do this, create a test file inside the /var/www/ folder.

Code: [Select]
vim /var/www/info.php
Paste the following content into this file.

Code: [Select]
<?php phpinfo(); ?>
Now, access http://[SERVER_IP]/info.php in your web browser. If the configuration was setup properly, you will see the PHP info page

Step 5: Install MySQL

Run the following command to install MySQL server. During the installation, you need to give the administrator password for MySQL root.

Code: [Select]
sudo apt-get install mysql-server
Once the install finishes, install a MySQL database.

Code: [Select]
mysql_install_db
Additionally, you can use the secure MySQL installation by running the following command.

Code: [Select]
mysql_secure_installation
88
cPanel / Round cube database error on cPanel
« Last post by vichithrakumart on July 27, 2018, 12:36:07 am »
When logging into RoundCube you get the following error:

DATABASE ERROR: CONNECTION FAILED!
Unable to connect to the database!e
Please contact your server-administrator.


To fix this, log into your server via SSH as root and run:

Code: [Select]
# /usr/local/cpanel/bin/update-roundcube --force
89
Plesk / Nginx warning: could not build optimal map_hash
« Last post by vichithrakumart on July 26, 2018, 12:02:34 am »
Nginx configuration check show below warning:

# nginx -t
nginx: [warn] could not build optimal map_hash, you should increase either map_hash_max_size: 2048 or map_hash_bucket_size: 64; ignoring map_hash_bucket_size


This happens because default values for map_hash_bucket_size or map_hash_max_size are not enough.

To resolve the issue we have to add below directives to /etc/nginx/nginx.conf under http {} section:

Code: [Select]
map_hash_bucket_size 128;
or

Code: [Select]
map_hash_max_size 4096;
90
Plesk / warning: [pagespeed:warn] ModPagespeedInheritVHostConfig is deprecated.
« Last post by vichithrakumart on July 25, 2018, 11:53:40 pm »
This warning shows while we use "httpd -t " command

# httpd -t
[pagespeed:warn] [pid 123456:tid 1234567890123] ModPagespeedInheritVHostConfig is deprecated. Please remove it from your configuration.


This happens when page speed is deprecated. This can be resolved by disabling the page speed module.

Code: [Select]
# mv /etc/httpd/conf.d/pagespeed.conf.rpmnew /root/
# mv /etc/httpd/conf.d/pagespeed_libraries.conf /root/
# mv /etc/httpd/conf.d/pagespeed.conf /root/
# systemctl restart httpd
Pages: 1 ... 7 8 [9] 10