ERROR: “/lib/cpp” fails sanity check

Dedicated Server Hosting, Linux VPS Hosting 1 Comment »

ERROR:

Recently while running “./configure” while installing a component on a Server I got following Error.

checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... unsupported
checking how to run the C preprocessor... /lib/cpp
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
[root@server1 ]#

_
SOLUTION:

I have checked and found that gcc and cpp modules are already installed on the server. This can be checked using command “rpm -qa | grep gcc” “rpm -qa | grep cpp“. I have searched on many websites and found that glibc-headers were not installed on the server. I have installed glibc-headers using command “yum install glibc-headers“. If you face this problem please make sure that following components are installed on the server:

1) GCC and GCC-C++

[root@server1 ~]# rpm -qa | grep gcc
gcc-c++-4.1.2-42.el5
compat-gcc-34-c++-3.4.6-4
libgcc-4.1.2-42.el5
gcc-4.1.2-42.el5
compat-gcc-34-3.4.6-4
compat-libgcc-296-2.96-138
gcc-objc-4.1.2-42.el5
compat-gcc-34-g77-3.4.6-4
gcc-objc++-4.1.2-42.el5
[root@server1 ~]#

_

2) CPP

[root@server1 ~]# rpm -qa | grep cpp
cpp-4.1.2-42.el5
[root@server1 ~]

_

3) GLIBC, GLIBC-DEVEL and GLIBC-HEADERS

[root@server1 ~]# rpm -qa | grep glibc
glibc-2.5-24
glibc-headers-2.5-24
compat-glibc-headers-2.3.4-2.26
glibc-common-2.5-24
glibc-devel-2.5-24
compat-glibc-2.3.4-2.26
[root@server1 ~]#

_

How to use Apache mod_ssl/OpenSSL to generate CSR ?

Linux VPS Hosting, Plesk For Linux, VPS hosting, linux No Comments »

Certificate Signing Request (CSR) contains all the information regarding certificate application. It also includes the Public key.

Following steps will show how to generate a pair of private key and public Certificate Signing Request (CSR) for a webserver, “server” using Apache mod_ssl/OpenSSL.

root@vps [~]# openssl req -new -nodes -keyout vps.key -out vps.csr

This creates a two files. The file vps.key contains a private key;

Following is the output from the above command, you will have to fill some of the fields here:

root@vps [~]# openssl req -new -nodes -keyout vps.key -out vps.csr

Generating a 1024 bit RSA private key
……………++++++
……++++++
writing new private key to ‘vps.key’
—–
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [GB]:GB
State or Province Name (full name) [Berkshire]:Berkshire
Locality Name (eg, city) [Newbury]:Newbury
Organization Name (eg, company) [My Company Ltd]:Trulymanaged
Organizational Unit Name (eg, section) []:Webhosting
Common Name (eg, your name or your server’s hostname) []:vps.server.com
Email Address []:vps@server.com

Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:sdfhsdfj
An optional company name []:

Your CSR will now have been created. Open the vps.csr in a text editor and copy and paste the contents into the online enrollment form when requested.

make: *** [libavdevice/v4l.o] Error 1

Dedicated Server Hosting, Linux VPS Hosting No Comments »

ERROR:

While installing FFMPEG on a server when we run “make” after “./configure” it gives following error:

math-errno       -c -o libavdevice/v4l.o libavdevice/v4l.c
In file included from libavdevice/v4l.c:32:
/usr/include/linux/videodev.h:56: error: syntax error before "ulong"
/usr/include/linux/videodev.h:72: error: syntax error before '}' token
libavdevice/v4l.c: In function `grab_read_header':
libavdevice/v4l.c:77: error: storage size of 'tuner' isn't known
libavdevice/v4l.c:141: error: invalid application of `sizeof' to incomplete type `video_tuner'
libavdevice/v4l.c:148: error: invalid application of `sizeof' to incomplete type `video_tuner'
libavdevice/v4l.c:77: warning: unused variable `tuner'
make: *** [libavdevice/v4l.o] Error 1

_

SOLUTION:

This problem can be fixed by disabling v41 and v42 for FFMPEG. This can be done when we run “./configure” for FFMPEG

./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared --disable-demuxer=v4l --disable-demuxer=v4l2

_
Once this has been completed run “make” and “make install” to install FFMPEG.

Getting 404 error to “jsp” pages, even though Tomcat was auto-configured by [WHM/cPanel] installation

Dedicated Server Hosting, Linux VPS Hosting No Comments »

Error
Apache Web Server was not passing servlet requests to Apache Tomcat. It served 404 errors to jsp pages, even though the Apache Tomcat was auto-configured by the WHM / Cpanel installation.

SEVERE: Error starting static Resources java.lang.IllegalArgumentException: Document base ççç does not exist or is not a readable directory at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:141)

Cause
This was occurring because Tomcat could not read from the “public_html” directory for the site. This was a result of file protect being enabled in easyapache. This option causes all public_html directories to be owned by the user and the group nobody, leaving all other users unable to index those directories. Unfortunately this leaves tomcat, which runs as the user tomcat, unable to access those files as well.

Solution
It should be addressed by executing following script.

/scripts/disablefileprotect

Restart Tomcat service

/scripts/restartsrv_tomcat

Issue Fixed, now “jsp” pages works fine.

Enjoy :)

How to login webmail directly without acessing cPanel?

Dedicated Server Hosting, Linux VPS Hosting, linux No Comments »

How to login direct using “webmail.domain.com” in to Squirrelmail or Horde of any account?

First you need to create a subdomain that you want to redirect to your preferred Webmail client [Squirrelmail /Horde].

Following are the steps to create subdomain.

1. Login in to your cPanel interface.

2. Select the Subdomain option, and create the subdomain. (For eg: webmail.domain.com)

3. Once it has been created, go to the File Manager option of the cPanel.

4. Change path to “public_html” by selecting the folder image beside the text “public_html”

5. Now change the path to folder that was create by your subdomain. (as per our example it would be the “ebmail” folder)

6. Once inside this directory webmail you will see “.htaccess” file, if it’s not there then you need to create it manually.

* If it is not there then create new using below steps : (if it already exists proceed to step 10)

7. Create it [.htaccess] by selecting the “Create New File” option.

8. A menu appears in the top right corner of the File Manager interface. Choose “Text Document” and name it “.htaccess” [without quotes]

9. Now refresh File Manager and you will then see your new file [.htaccess] in the listing of that directory.

10. Click on the text title for the .htaccess file on the left side of the screen and a menu appears in the top right of the screen.

11. Choose the “Edit File” option, a new window opens.

12. Add the following lines:

If You Want To Redirect “webmail.domain.com” to the Squirrel Mail Client

RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail.domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.webmail.domain.com$
RewriteRule ^(.*)$ http://domain.com:2095/3rdparty/squirrelmail/index.php$1 [R=301,L]


If You Want To Redirect “webmail.domain.com”to the Horde Webmail Client

RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail.domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.webmail.domain.com$
RewriteRule ^(.*)$ http://domain.com:2095/horde/$1 [R=301,L][/QUOTE]


NOTE
:-
replace “domain.com” above with your actual domain name.
Enjoy Direct Webmail Client Login.

What is SPF?

Dedicated Server Hosting, Linux VPS Hosting, linux No Comments »

What is SPF? [Sender Policy Framework]
SPF (Sender Policy Framework) is a standard that was created in order to stop and eliminate the forged or spoofed sender email addresses in the mail envelope SMTP MAIL FROM or Return-Path that commonly used in spam message. SPF is not directly about stopping spam – junk email. SPF works as an extension to the Simple Mail Transfer Protocol (SMTP), and allows relay MTA (Mail Transport Agent) to identify and reject those e-mail spam sent from unauthorized and unapproved mail server. SPF was created in 2003 to help close loopholes in email delivery systems that allow spammers to “spoof” or steal your email address to send hundreds, thousands or even millions of emails illicitly.

How SPF Work?
SPF enable domain’s email delivery operation works in such a way, Owner of an Internet domain name defines SPF records using a special format of TXT records in the domain zone DNS name server. The SPF specifies which machines are authorized to transmit e-mail for that domain. When an email is received by a mail server, the MTA will query the SPF records from DNS resolver to determine whether the email is originated from a legitimate server. If SPF PASS result is returned, the email is accepted and got delivered. Else if SPF FAIL result is returned, the email is rejected and bounced.

Is SPF is Must?
SPF records is not must, but it’s a good to set up the SPF records to stop spam fault from illegally spoofing. If your domain does not have an SPF record. This means that spammers can easily send out E-mail that looks like it came from your domain, which can make your domain look bad (if the recipient thinks you really sent it), and can cost you money (when people complain to you, rather than the spammer).
Now many mail servers such as AOL and Hotmail now require valid SPF record for inclusion in their whitelist program so if you don’t have one your email will probably not be delivered to that server.

How to Set up SPF record for a domain?
The major issue for SPF records are how to write and create a properly SPF record which is valid and correct for the domains, as all SMTP server that sends email for the domains must be defined.

For SPF to work you have to add, to each DNS zone a record similar to this:

domain.com. 14400 IN TXT "v=spf1 a mx -all"

note:- “.” is necessary after the “domain.com” otherwise SPF fails to work.
“domain.com” is the domain for which you were adding SPF record.
Syntax used is as follows,
You will notice that all SPF record start with v=spf1. “v=” defines the version of SPF used, and is mandatory to identify it’s the SPF record. Currently only the only version supported is spf1.
A :- If the domain name has an A record corresponding to the sender’s address, it will match. (That is, the mail comes directly from the domain name.)
MX :- If the domain name has an MX record resolving to the sender’s address, it will match. (That is, the mail comes from one of the domain’s mail servers)
ALL :- Matches always, used for a default result like -all for no other IP’s are allowed to send emails.

You can read all the options that you have by visiting: http://www.openspf.org/SPF_Record_Syntax

Query Cache in MySQL

Dedicated Server Hosting, Linux VPS Hosting 1 Comment »

What is Query Cache and How it works?

One of the best ways to speed up your web application is to enable query caching in your database, which caches commonly used SQL queries in memory for virtually instant access by the next page that makes the same request.

The query cache stores the text of a SELECT statement together with the corresponding result that was sent to the client. If an identical statement is received later, the server retrieves the results from the query cache rather than parsing and executing the statement again.

How to enable caching in MySQL?

Query Cache Can be Enabled by two ways
1) Using MySQL Queries
2) Using MySQL Configuration file i.e. my.cnf

1) Enabling Query Cache by executing query:

Login to MySQL prompt

[root@server ~]# mysql -u root –p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 16 to server version: 

Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql>

Now setup cache size 16Mb (16*1024*1024=16777216):

mysql> SET GLOBAL query_cache_size = 16777216;
Query OK, 0 rows affected (0.00 sec)

You can check the cache size by executing following query:

mysql> SHOW VARIABLES LIKE 'query_cache_size';
 +------------------+----------+
 | Variable_name    | Value    |
 +------------------+----------+
 | query_cache_size | 16777216 |
 +------------------+----------+
mysql>


2) Enabling Query Cache in MySQL Configuration (my.cnf)

You can setup them in /etc/my.cnf (Red Hat) or /etc/mysql/my.cnf (Debian) file. Open my.cnf uing vi or pico editor and insert following into it:

query_cache_size = 268435456
query_cache_type=1
query_cache_limit=1048576

In above example the maximum size of individual query results that can be cached set to 1048576 using query_cache_limit system variable. Memory size in Kb.

How To Upgrade Perl Version On Cpanel Server

Dedicated Server Hosting, Linux VPS Hosting No Comments »

First check the current version of Perl

# perl -v

If the older version of Perl is running on server, you get an output something like,

This is perl, v5.8.7 built for i686-linux

Upgrade perl on the Cpanel server
1) Download the latest perl installer from cPanel site.

# wget http://layer1.cpanel.net/perl588installer.tar.gz


2)
Untar the file as,

# tar -zxvf perl588installer.tar.gz


3)
Change the directory to perl588installer

# cd perl588installer


4)
Now run the installer file as,

 # ./install


5)
Check perl modules

 # /scripts/checkperlmodules


6)
Force a cPanel update

 # /scripts/upcp –force


7)
Check the new installed perl version using “perl -v” and you get an output something like,

This is perl, v5.8.8 built for i686-linux

Install and Configure PowerDNS with MySQL

Dedicated Server Hosting, Linux VPS Hosting 1 Comment »

What is PowerDNS

PowerDNS is a versatile DNS server, written in C++ and licensed under the GPL. It runs on most Unix derivatives and on Microsoft Windows. PowerDNS features a large number of different backends ranging from simple BIND style zonefiles to relational databases and load balancing/failover algorithms. A DNS recursor is also included as a separate program. (Definition as per wikipedia.org)

Installation of PHP, MySQL other required modules

Installation of PowerDNS and PDNS requires certain modules which are PHP(if you are going to install PowerAdmin web client too) Mysql, DB and MDB2. you can install all these modules using following commands:

yum install mysql mysql-devel mysql-server -y
yum install php-devel php-imap php-pear php-ldap php-gd php-mbstring php-ncurses php-xmlrpc php-domxml php-mysql php-odbc
pear install DB
pear install pear/MDB2#mysql

Creating Database and Tables

Once you install these modules, next step is to create Database for PDNS. To do that login to MySQL Console using mysql root password and execute following query to create database:

mysql> create database power_admin;

You can create any user as database user for power_admin. Here I have used root.

Next Step is to create Empty tables inside this database. Following are the SQL Queries to create tables

use power_admin;

create table domains (
id INT auto_increment,
name VARCHAR(255) NOT NULL,
master VARCHAR(128) DEFAULT NULL,
last_check INT DEFAULT NULL,
type VARCHAR(6) NOT NULL,
notified_serial INT DEFAULT NULL,
account VARCHAR(40) DEFAULT NULL,
primary key (id)
);

CREATE UNIQUE INDEX name_index ON domains(name);

CREATE TABLE records (
id INT auto_increment,
domain_id INT DEFAULT NULL,
name VARCHAR(255) DEFAULT NULL,
type VARCHAR(6) DEFAULT NULL,
content VARCHAR(255) DEFAULT NULL,
ttl INT DEFAULT NULL,
prio INT DEFAULT NULL,
change_date INT DEFAULT NULL,
primary key(id)
);

CREATE INDEX rec_name_index ON records(name);
CREATE INDEX nametype_index ON records(name,type);
CREATE INDEX domain_id ON records(domain_id);

create table supermasters (
ip VARCHAR(25) NOT NULL,
nameserver VARCHAR(255) NOT NULL,
account VARCHAR(40) DEFAULT NULL
);

GRANT SELECT ON supermasters TO power_admin;
GRANT ALL ON domains TO power_admin;
GRANT ALL ON records TO power_admin;


Installation and Configuration of PDNS

PDNS can be installed using YUM or using by the RPM provided by PowerDNS. Following is the command to install PDNS using yum

yum install pdns pdns-backend-mysql

Now we have to configure PDNS to work with MySQL Server. Open file /etc/pdns/pdns.conf which is configuration file for PDNS and search for “launch=bind” and change
FROM:

#################################
# launch        Which backends to launch and order to query them in
#
launch=bind
bind-example-zones

TO:

#################################
# launch        Which backends to launch and order to query them in
#
#launch=bind
#bind-example-zones
launch=gmysql
gmysql-host=127.0.0.1
gmysql-user=root
gmysql-password=root_password
gmysql-dbname=power_admin


Save and exit from the file.

Now restart the pdns Service using command “service pdns restart”. Now check if the server is responding to port 53 i.e. Port for DNS service. You can check that using telnet i.e. “telnet localhost 53″.

telnet Install and Configure PowerDNS with MySQL

If you get something like above image then pdns has been installed sucessfully on your Server/VPS.

You can go through This Article for installing and configuring PowerAdmin.

PhpMyAdmin Error :: SQLite failed to open/create session database

Dedicated Server Hosting, Linux VPS Hosting No Comments »

Error :-
Getting following error whenever you access PhpMyAdmin either from WHM or cPanel.

Warning: session_start() [function.session-start]: SQLite: failed to
open/create session database
`/var/cpanel/userhomes/cpanelphpmyadmin/sessions/phpsess.sdb' - unable
to open database:
/var/cpanel/userhomes/cpanelphpmyadmin/sessions/phpsess.sdb in
/usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/session.inc.php on
line 86

Fatal error: session_start() [<a
href='function.session-start'>function.session-start</a>]:
Failed to initialize storage module: sqlite (path:
/var/cpanel/userhomes/cpanelphpmyadmin/sessions/phpsess.sdb) in
/usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/session.inc.php on
line 86

Cause :-
This is usually a bug in the PhpMyAdmin configuration on cPanel server.

Solution :-
Manually edit /usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini file as follow:

1) Login to shell of the server using root login details and open the file “/usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini” using vi or any other editor.

2) Search for the [Session] variable & underneath it, change the following
Replace:
——————————-
session.save_handler = sqlite
session.save_path = /var/cpanel/userhomes/cpanelphpmyadmin/sessions/phpsess.sdb

——————————-
To:
——————————-
session.save_handler = files
session.save_path = /tmp

——————————-
By default, PhpMyAdmin uses sqlite as as the file handler, but it needs to be changed to files & the location of the session files to be stored needs to be changed to /tmp which is the standard/default place to store temporary files.

3) Once all changes done, save & exit the php.ini file & restart the apache using “/scripts/restartsrv_httpd“.

4) Also ‘chattr’ the file “/usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini” so that it doesn’t get reverted back to original whenever cPanel updates run.

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in