Showing posts with label Centos. Show all posts
Showing posts with label Centos. Show all posts

Saturday, August 17, 2024

Errors during downloading metadata for repository 'appstream': - Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8-stream&arch=x86_64&repo=AppStream&infra=stock [Could not resolve host: mirrorlist.centos.org]

 Error while installing a package in CentOS 8

Errors during downloading metadata for repository 'appstream':   - Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8-stream&arch=x86_64&repo=AppStream&infra=stock [Could not resolve host: mirrorlist.centos.org]

How to fix?

1. Login to the server

2. cd /etc/yum.repos.d/

3. sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*

4. sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

5. yum install <package>

It works!

Tuesday, August 15, 2017

Mongodb integration with PHP

In my CentOs box, i installed php5.5 and mongodb. Now i am getting the error
Mongodb is not enabled with PHP.

Solution to fix the issue.

Install gcc php-pear php-devel
yum install gcc php-pear php-devel php5-dev openssl-devel -y 

pecl install mongo
Cyrus SASL as "no"

vim /etc/php.ini
extension=mongo.so

Restart apache
service httpd restart

Verify
php -m | grep -i mongo

 
 

323 packages excluded due to repository priority protections

When I run "yum update php*" operation, in CentOs i am getting the following error:

"323 packages excluded due to repository priority protections"

Solution to fix the issue:

This is because of the plugin "priorities" helps to solve this issue. Open the file
/etc/yum/pluginconf.d/priorities.conf  and change the value of enabled =1 to 0.

Execute  yum update php*

It works.

Wednesday, January 7, 2015

http_client.h:26:25: error: openssl/ssl.h: No such file or directory

I got this error while installing Skipfish on Centos

http_client.h:26:25: error: openssl/ssl.h:No such file or directory

Solution is to install the following packages
 yum install pcre-devel openssl-devel libidn-devel libidn2-devel

How to install skipfish on centos

Skipfish is a good tool for website vulnerability checking

Login to server
cd /opt
wget http://skipfish.googlecode.com/files/skipfish-1.01b.tgz
tar zxvf skipfish-1.01b.tgz

yum install pcre-devel openssl-devel libidn-devel libidn2-devel
cd skipfish
make
cp dictionaries/default.wl skipfish.wl
./skipfish -o output_folder http://www.example.com

you’ll want to less README to understand all the options.

Wednesday, December 18, 2013

While restarting network service my name servers in /etc/resolv.conf got vanished

While restarting network service my name servers in /etc/resolv.conf got vanished in CentOS

[root@Hostname ~]# /etc/init.d/network restart
Shutting down interface eth0:  Device state: 3 (disconnected)
                                                           [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:  Active connection state: activated
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/3
                                                           [  OK  ]


Solution:
While troubleshooting i noticed the box have "NetworkManager" installed. I removed it

[root@Hostname ~]# yum remove NetworkManager
It helped me to solve that issue.

Thursday, February 21, 2013

FFMPEG installation on Centos

I installed FFMPEG via. yum.

[root@ip-10-190-51-120 ~]# uname -a
Linux ip-10-190-51-120 2.6.32-279.2.1.el6.centos.plus.x86_64 #1 SMP Thu Jul 19 16:20:44 CDT 2012 x86_64 x86_64 x86_64 GNU/Linux
[root@ip-10-190-51-120 ~]#

[root@ip-10-190-51-120 ~]# cat /etc/redhat-release
CentOS release 6.3 (Final)
[root@ip-10-190-51-120 ~]#

rpm -Uvh http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

Installing FFMPEG.

yum install ffmpeg ffmpeg-devel

Install FFMPEG-PHP Extension

FFmpeg-php is a very good extension and wrapper for PHP which can pull useful information about video through API interface. Inorder to install it you will need to download the source file and then compile and install extension in your server.

cd /usr/local/src

wget http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2?use_mirror=nchc

tar -xjf ffmpeg-php-0.6.0.tbz2
cd ffmpeg-php-0.6.0.tbz2
phpize
./configure
make
make install

Once you have done that without any problems then you will see the php extension file /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so and you will need mention that extension in php.ini file.

nano /usr/local/lib/php.ini

Put the below two lines at the end of the php.ini file

[ffmpeg]
extension=ffmpeg.so

Then restart apache using — service httpd restart

If you get an error like this 
/usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function âzim_ffmpeg_frame_toGDImageâ:
/usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: âPIX_FMT_RGBA32â undeclared (first use in this function)
/usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: (Each undeclared identifier is reported only once
/usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: for each function it appears in.)
/usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function âzim_ffmpeg_frame_ffmpeg_frameâ:
/usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:421: error: âPIX_FMT_RGBA32â undeclared (first use in this function)
make: *** [ffmpeg_frame.lo] Error 1

Under the ffmpeg-php-0.6.0 directory modify the file: ffmpeg_frame.c with nano or vi editor and replace every instance of PIX_FMT_RGBA32 with PIX_FMT_RGB32

# nano ffmpeg_frame.c
# Search for PIX_FMT_RGBA32 and replace it with PIX_FMT_RGB32
# Exit from the editor

Then run the following commands:

# cd /usr/local/src/ffmpeg-php-0.6.0
# cp -aP ffmpeg_frame.loT ffmpeg_frame.lo
# make clean
# ./configure
#   make
#   make install

This should fix the errors given above. Finally add the ffmpeg.so extension in php.ini and check phpinfo for the server you should see ffmpeg listed.


Installing Jira in Centos

Login as root
cd /opt
Download Jira for linux from http://www.atlassian.com/software/jira/download
chmod a+x atlassian-jira.bin
./atlassian-jira
I choose express install

Access URL http://ip:8080
/etc/init.d/jira start
/etc/init.d/jira stop

Then we have to run the wizard

I then created a mysql DB,user and password.
Give necessary permissions.

CREATE DATABASE jiradb CHARACTER SET utf8 COLLATE utf8_bin;
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX on <JIRADB>.* TO '<USERNAME>'@'<JIRA_SERVER_HOSTNAME>' IDENTIFIED BY '<PASSWORD>';
flush privileges;

Then we need to copy the mysql JDBC driver to jira
Download the driver from http://dev.mysql.com/downloads/connector/j
Untar the package
cd to that folder
Copy mysql-connector-java-5.x.x-bin.jar to /opt/jira/lib

Stop Jira
Start Jira

Give it as a public site
Give name of the site
Admin user details
Email notification etc.


Installing PhpMyAdmin in centos

yum install phpmyadmin

vi /etc/httpd/conf.d/phpMyAdmin.conf

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

<Directory /usr/share/phpMyAdmin/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Allow,Deny
Allow from all
Allow from 127.0.0.1
Allow from 50.16.104.91
</Directory>



Access url : http://ip/phpmyadmin , it will prompt for username/password. Enter your mysql root password.

While accessing the above url, you are getting this error in your apache error log

AH01630: client denied by server configuration: /usr/share/phpMyAdmin

Take a backup of your httpd.conf
Edit as follows

<Directory "/usr/share/phpMyAdmin">
    AllowOverride None
    Options None
    Require all granted
</Directory>
Restart httpd