Sunday, 1 September 2019

Error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing (FIXED

Hi,
I was installing PHP-5.5.26 on my CentOS-6, 32-bit, deployment server and got this error while running ‘./configure’.
I fixed it by installing libc-client-devel package with the following command:
#yum install libc-client-devel.i386
(or)
#yum install libc-client-*

Configure : error : cannot find MySQL header files under /usr (FIXED)

Hi,
As part of LAMP installation and configuration on my deployment server CentOS-6, I was configuring PHP with MySQL support using the following,
./configure –with-apxs2=/usr/local/apache2/bin/apxs –with-mysql

And I got the following error:

configure: error: Cannot find MySQL header files under /usr.
Note that the MySQL client library is not bundled anymore!
I fixed it by installing mysql-devel by issuing the following command:

# yum install mysql-devel
And checked the installation using,
# find / -name mysql.h

Tuesday, 23 June 2015


Enrolling an Active Directory CentOS-7 client machine using adcli



In this example, my AD server domain is 'ejyothi.net' and the server that runs the domain is 'Pamba.ejyothi.net'.

Start the setup by enabling the EPEL repository and installing the 'adcli' package:

# yum install adcli

We can type just 'adcli' to get an overview of what commands adcli supports.

We're interested in joining the client to the AD domain in order to be able to log in as users from Active Directory.

Now you should be able to find your domain already:

# adcli info ejyothi.net
[domain]
domain-name = ejyothi.net
domain-short = EJYOTHI
domain-forest = ejyothi.net
domain-controller = Pamba.ejyothi.net
domain-controller-site = Default-First-Site-Name
domain-controller-flags = pdc gc ldap ds kdc timeserv closest writable good-timeserv full-secret ads-web
domain-controller-usable = yes
domain-controllers = Pamba.ejyothi.net mamba.ejyothi.net krait.ejyothi.net
[computer]
computer-site = Default-First-Site-Name

As we can see, adcli was able to discover quite a few details about our domain, so it's time to join the client:
# adcli join ejyothi.net
Password for Administrator@EJYOTHI.NET:

You'll be prompted for the Administrator password by default, but it's possible to specify another user with the -U option. See the adcli man page for full list of details.

The join operation creates a keytab the machine will authenticate with.

It's recommended to also configure /etc/krb5.conf to use the AD domain:
#vim /etc/krb5.conf

[libdefaults]
dns_lookup_realm = true
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
default_realm = ejyothi.net
dns_lookup_kdc = true

[realms]
EJYOTHI.NET = {
kdc = Pamba.ejyothi.net
admin_server = Pamba.ejyothi.net
}

[domain_realm]
.ejyothi.net = EJYOTHI.NET
ejyothi.net = EJYOTHI.NET

Next step is setting up the SSSD (or Winbind if you like) to actually make use of the keytab to resolve users.
#yum install authconfig sssd

And create /etc/sssd/sssd.conf with your favorite editor (Read, vim).

#vim /etc/sssd/sssd.conf

[sssd]
services = nss, pam, ssh, autofs
config_file_version = 2
domains = EJYOTHI.NET

[domain/EJYOTHI.NET]
id_provider = ad
ad_server = Pamba.ejyothi.net

default_shell = /bin/bash
fallback_homedir = /home/%d/%u

Due to a stupid bug in sssd, you should echo an empty line to the end of the file and set the permission right. You also need to enable it with authconfig.

#chown root:root /etc/sssd/sssd.conf
#echo >> /etc/sssd/sssd.conf 
#chmod 0600 /etc/sssd/sssd.conf
#authconfig --enablesssd --enablesssdauth --enablemkhomedir –update


And finaly start sssd:
#service sssd start

You should now be able to test it with:
Syntax:
getent passwd username@your.ad.domain
id username

Example:
# getent passwd tonym@ejyothi.net
tonym:*:1631204706:1631200513:Tony Mathew:/home/EJYOTHI.NET/tonym:/bin/bash

If it works, you should be able to login with your adusername, with the right uid/gid and shell all set from AD.
if not, you have tons of logs in /var/log/sssd/*

Friday, 19 June 2015

Subversion (svn)

  • Subversion is a popular open-source version control tool. 

Version Control System (VCS) 

  •  VCS is a software that helps software developers to work together and maintain a complete history of their work.
  • Goals of version control system 
    • Allow developers to work simultaneously
    • Do not overwrite each other's changes.
    • Maintain history of every version of everything.
  • A VCS is divided into two categories
    • Centralized Version Control System (CVCS)
    • Distributed Version Control System (DVCS)
  • Subversion falls under CVCS, meaning that it uses central server to store all files and enables team collaboration.

SVN Installation on CentOS 6/ RHEL 6/ Fedora

    Run the following commands as 'root' or,

#sudo yum install subversion mod_dav_svn

                    OR

#sudo wget http://apache.cs.utah.edu/subversion/subversion-1.6.11.tar.gz  % downloading subversion from source

#sudo yum install mod_dav_svn                      %installing                   

#cd /var/www/                                                   %changing directory

#sudo tar -xvzf subversion-1.6.11.tar.gz        %extracting

#sudo mv subversion-1.6.11 subversion        %renaming

#sudo vim /etc/httpd/conf.d/subversion.conf   %opening configuration file for editing

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so
<Location /svn>
   DAV svn
   SVNParentPath /var/www/svn
   # Limit write permission to list of valid users.
   <LimitExcept GET PROPFIND OPTIONS REPORT>
      # Require SSL connection for password protection.
      # SSLRequireSSL
      AuthType Basic
      AuthName "Subversion repositories"
      AuthUserFile /etc/svn-auth-users
      Require valid-user
   </LimitExcept>
</Location>

User Setup

%Creating user tonym
#htpasswd -cm /etc/svn-auth-users tonym
New password:
Re-type new password:
Adding password for user tonym
Note: Use exactly same file and path name as used on subversion.conf file. This example use /etc/svn-auth-users file.
  

Create and configure svn repository 


#mkdir /var/www/svn
#cd /var/www/svn
#svnadmin create testrepo
#chown -R apache.apache testrepo
%% If you have SELinux enabled (you can check it with "sestatus" command)
 %% 
then change SELinux security context with chcon command %%
#chcon -R -t httpd_sys_content_t /var/www/svn/testrepo
%%Following enables commits over http%%
#chcon -R -t httpd_sys_rw_content_t /var/www/svn/testrepo

Restart Apache

#sudo service httpd restart

Configure Repository

To disable anonymous access and enable access control add following rows to /var/www/svn/testrepo/conf/svnserve.conf file:

%% Disable anonymous access %%
anon-access = none
%% Enable access control %%
authz-db = authz

Create trunk,tags & branches directory structure under the testrepo repository

#mkdir -p /tmp/svn-structure-template/ {trunk,branches,tags}

Then import template to project repository using “svn import” command:


#svn import -m 'Initial import' /tmp/svn-structure-template/ http://localhost/svn/testrepo/
Adding         /tmp/svn-structure-template/trunk
Adding         /tmp/svn-structure-template/branches
Adding         /tmp/svn-structure-template/tags
Committed revision 1.
Check results on browser and see testrepo revision 1:

http://myserverip/svn/testrepo/ 

Saturday, 15 November 2014

APACHE

Apache Installation in Linux
 
 
·      The Apache HTTP Server, commonly referred to as Apache, is a web server software notable for playing a key role in the initial growth of the World Wide Web.  In 2009 it became the first web server software to surpass the 100 million website milestone.
·      Typically Apache is run on a Unix-like operating system, and was developed for use on Linux. 
·      Runs on Windows NT/9x, Netware 5.x and above, OS/2, and most versions of Unix, as well as several other operating systems.
·      Can be customised by writing “modules” using the Apache module API
·      Since April 1996 Apache has been the most popular HTTP server software in use. As of December 2012 Apache was estimated to serve 63.7% of all active websites and 58.49% of the top servers across all domains.
 
Prerequisites
·      Before going to start installation of new apache we need to remove completely the older httpd, if exists.
·       Run this command if you installed apache with RPM or through the automatic option during the Fedora/Red Hat OS installation.
# yum remove httpd
·      Check whether httpd list in system services
# chkconfig --list
·      Turn off httpd service
# chkconfig --levels 235 httpd off
·      To find packages that are installed try
# rpm -qa httpd
or
# rpm -qa *apache* { note "rpm -qa" lists all installed packages }
·      Remove httpd
# rpm -e --noscripts httpd
·      If you compiled apache on your own. If you did a manual install then just delete /usr/local/apache (or wherever it is installed).
# rm -rf /usr/local/apache2
·      Create a directory for where we need to configure the Apache
# mkdir -p /lamp/apache
·      Dependencies for Apache to work properly
# yum install gcc gcc-c++
# yum install libxml2-devel
# yum install openssl-devel
# yum install ncurses-devel
   # yum install make
            # yum install cmake
            # yum install automake
            # yum install openssl
   # yum install bison
 
 
รจ apr/apr-util -
·      apr and apr-util are bundled with the Apache httpd source releases, and will be used without any problems in almost all circumstances. However, if apr or apr-util, versions 1.0 or 1.1, are installed on your system, you must either upgrade your apr/apr-util installations to higher(1.2 or above), or have httpd use separate builds. To use the bundled apr/apr-util sources for this purpose you must install them manually:
 
Download
·      The Apache HTTP Server can be downloaded from the Apache HTTP Server download site.
# wget http://downloads/httpd-2.2.15.tar.gz
Extract
·      Extracting the source from the Apache HTTPD tarball,
# tar xvzf httpd-2.2.15.tar.gz
·      This will create a new directory under the current directory containing the source code for the distribution. You should cd into that directory before proceeding with compiling the server.
 
Configuring the source tree
·      To configure the source tree using all the default options, simply type ./configure. To change the default options, configure accepts a variety of variables and command line options.
·       The most important option is the location --prefix where Apache is to be installed later, because Apache has to be configured for this location to work correctly. Another commonly used option --enable-so turns on the DSO support. More fine-tuned control of the location of files is possible with additional configure options.
 
SSL support
·      To support secure connections, you need to specify --enable-ssl option when you run ./configure. In addition to that, you will also have to configure your httpd.conf file later.
 
Configuration
 
            # mkdir –p /lamp/apache
            # cd httpd-2.2.15
            # ./configure –prefix=/lamp/apache
  –enable-so –enable-ssl=shared
  --enable-cache=shared –enable-disk-cache=shared
  --enable-rewrite=shared
 
·      When configure is run it will take several minutes to test for the availability of features on your system and build Makefiles which will later be used to compile the server.

·      If you are upgrading from older Apache version, you may want to copy config.nice from the directory to which the previous version was unpacked (if available) to where you unpacked the new Apache tarball file. Run ./config.niceinstead of ./configure. This way all the previously used configure options will be applied to the new installation effortlessly.
 
 Build
·      Now you can build the various parts which form the Apache package by simply running the command:
# make
Install
·      Now it's time to install the package under the configured installation PREFIX (see --prefix option above) by running:
 
# make install
 
Post installations
            #ln –s /lamp/apache/bin/apachectl  /etc/init.d/webserver
            # service webserver start (to start the service)
            # service webserver stop (to stop the service)
For automatic start-up
# chmod 755 /etc/init.d/webserver
# chkconfig --add webserver
# chkconfig --level 35 webserver on
 To check
          # sevice apache start
            # netstat –ntulp | grep 80
            # elinks 192.168.1.203
                        OR
 Check in the browser
·      Restart apache service and check in browser by typing our ip 192.168.1.203 it shows,
 
IT WORKS!
 
Controlling Apache
·      /etc/httpd/conf/httpd.conf The configuration file for the Apache HTTP server.
·      .htaccess File used to control Apache's behaviour on a per-directory basis.
·      /etc/init.d/httpd Script used to control the httpd process - start, stop, restart, reload, status.
·      /var/log/httpd/ Contains the Apache logs - error.log, access.log
 
Apache content
·      /lamp/apache/htdocs/ The “DocumentRoot” - all websites are served from here by default.
·      $home/public html/ User‘s directory for serving webpages.
·      index.html “DirectoryIndex” that is used by default when a request specifies a directory.
 
 

Friday, 14 November 2014

Linux Installation Types...



One of the things that makes Linux special is that it can play nice with other operating systems. You can run Linux alongside of other operating systems quite easily. The most popular installation process for installing Linux is to install a Fresh Installation of Linux with no other operating system in place. This allows the computer to dedicated 100% of its resources to running Linux. However, it is quite easy to install Linux as a one of a series of operating systems that a computer has available to it.

Here are the most popular ways to install/run Linux on your computer

Dual Booting - If you want to keep an existing operating system, and install Linux as well, you will have what is known as a "dual-boot" system. That means that you have a PC that can use two different operating systems, and during the boot process you will need to decide which one you would like to boot into.

Note: Dual Booting between Windows and Linux is becoming somewhat less popular due to the rise of Virtual Machines. If you like the idea of running two operating systems, then you may want to consider running Linux as a VM inside of another operating system instead.

Live CD/DVD Booting Linux
If you are just looking to try Linux out to see if you like it, but don't want to commit to wiping out your main operating system, you may want to consider trying Linux from a \&quot;Live CD/DVD\&quot;. Many Linux installations provide the option of downloading and running Linux as a \&quot;Live CD\&quot;, which means that Linux runs as a completely bootable operating system from the CD/DVD. The files are loaded into your computer's memory, rather than being run for a hard disk drive. In layman's terms, this means that you can run Linux from a CD/DVD, and then when you reboot your PC, and remove the CD/DVD, it will boot back into its old operating system without any difference to your PC. This gives you an easy way to try out several distributions of Linux until you find the one that you like!

Linux as a VM inside another Operating System
If you like your current (non-linux) desktop operating system, but would like an easy way to access a Linux desktop or run your favorite open source software, you may want to consider running Linux as a VM inside another operating system. There are a number of ways to do this, but one simple one would be to download and install a Virtual Server application, and then install your Linux distribution under that host software. This topic is covered in the more advanced tutorials on this website I think that I should pause here and say that everything that you can do with your other operating system, you can do with Linux. That means word processing, databases, spreadsheets, Internet browsers, e-mail, photo touch-ups, MP3, CD Players, cameras and then there are a lot of things that Linux has to offer on top of all that that other operating systems don't.

Fresh Install of Linux
This method is by far the most popular installation method available. In this approach, you take the plunge and format your computer's hard drive and install Linux from a CD/DVD. Linux then runs as your computers only operating system.

Introduction to Linux

For Beginners! What is Linux?


 
Linux is an operating system that evolved from a kernel created by Linus Torvalds when he was a student at the University of Helsinki. Generally, it is obvious to most people what Linux is. However, both for political and practical reasons, it needs to be explained further. To say that Linux is an operating system means that it's meant to be used as an alternative to other operating systems, Windows, Mac OS, MS-DOS, Solaris and others. Linux is not a program like a word processor and is not a set of programs like an office suite. Linux is an interface between computer/server hardware, and the programs which run on it.

A brief history of Linux

When Linus Torvalds was studying at the University of Helsinki, he was using a version of the UNIX operating system called 'Minix'. Linus and other users sent requests for modifications and improvements to Minix's creator, Andrew Tanenbaum, but he felt that they weren't necessary. That's when Linus decided to create his own operating system that would take into account users' comments and suggestions for improvements.

Free Software pre-Linux

This philosophy of a****g for users' comments and suggestions and using them to improve computer programs was not new. Richard Stallman, who worked at the Massachusetts Institute of Technology, had been advocating just such an approach to computer programming and use since the early 1970's. He was a pioneer in the concept of 'free software', always pointing out that 'free' means 'freedom', not zero cost. Finding it difficult to continue working under conditions that he felt went against his concept of 'free software' he left MIT in 1984 and founded GNU. The goal of GNU was to produce software that was free to use, distribute and modify. Linus Torvalds' goal 6 years later was basically the same: to produce an operating system that took into account user feedback.

The kernel

We should point out here that the focal point of any operating system is its 'kernel'. Without going into great detail, the kernel is what tells the big chip that controls your computer to do what you want the program that you're using to do. To use a metaphor, if you go to your favorite Italian restaurant and order 'Spaghetti alla Bolognese', this dish is like your operating system. There are a lot of things that go into making that dish like pasta, tomato sauce, meatballs and cheese. Well, the kernel is like the pasta. Without pasta, that dish doesn't exist. You might as well find some bread and make a sandwich. A plate of just pasta is fairly unappetizing.
Without a kernel, an operating system doesn't exist. Without programs, a kernel is useless.

1991, a fateful year
In 1991, ideal conditions existed that would create Linux. In essence, Linus Torvalds had a kernel but no programs of his own, Richard Stallman and GNU had programs but no working kernel. Read the two men's own words about this:
 
 

Linux is introduced
Late in 1991, Linus Torvalds had his kernel and a few GNU programs wrapped around it so it would work well enough to show other people what he had done. And that's what he did. The first people to see Linux knew that Linus was on to something. At this point, though, he needed more people to help him. Here's what Linus had to say back in 1991.