Tuesday, February 10, 2015

How to install MySQL Server 5.6 on CentOS 7 / RHEL 7

 
Remove mariadb
 
yum remove mariadb-server
yum remove mariadb-libs
 
step to install
 
yum install wget
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

rpm -ivh mysql-community-release-el7-5.noarch.rpm

[root@localhost ~]# ls -1 /etc/yum.repos.d/mysql-community* /etc/yum.repos.d/mysql-community.repo /etc/yum.repos.d/mysql-community-source.repo [root@localhost ~]#

Installing MySQL Server

 
yum install mysql-server


To start MySQL Service, run command

systemctl start mysqld

To stop MySQL Service, run command
systemctl stop mysqld

To restart MySQL Service, run command
systemctl restart mysqld


To get status of MySQL Service, run command
systemctl status mysqld
 

Reset MySQL root password

mysql -u root You will see mysql prompt like this mysql> . Use the below given commands to reset root’s password.
mysql> use mysql; 
mysql> update user set password=PASSWORD("GIVE-NEW-ROOT-PASSWORD") where User='root'; 
 mysql> flush privileges; 
 mysql> quit
     

Monday, October 13, 2014

hiphop with nginx and php 5.5 with opcache

hiphop with nginx is 2 time faster than php with appche
and
php-opcache is better than php-apc

I install hiphop with nginx in fedora 20 and centos 6.5

sh file run when system boot

add sh file in /etc/init.d/ directory

Tuesday, July 29, 2014

How to disable Selinux

The contents of my /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX=permissive
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
 
 
$ selinuxenabled && echo enabled || echo disabled enabled 

$ sestatus 
 

 

how to enable samba service

https://ask.fedoraproject.org/en/question/40353/how-to-enable-samba-share-for-a-specific-directory-fedora-20/

# useradd joe
# passwd joe

 or
adduser joe
 
smbpasswd -a joe


[accounts]
comment = Accounts data directory
path = /data/accounts
valid users = vivek raj joe
public = no
writable = yes
 
 # service smb restart
 

A note about adding users on Samba version 4.x

 
# /usr/local/samba/bin/samba-tool user add USERNAME-HERE
  

 # samba-tool user add USERNAME-HERE

Thursday, October 17, 2013

installed Xdebug on a Fedora 17 OS

I installed Xdebug on a Fedora 17 OS in order to use it with netbeans 7.3.1 It took me some time so I share with you how did I managed to have it working:
Install Xdebug:
sudo yum install php-pecl-xdebug
Add this lines to php.ini at the end of the file:
sudo vi /etc/php.ini
zend_extension=/usr/lib64/php/modules/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000

Add the same lines to xdebug.ini file:
sudo vi /etc/php-zts.d/xdebug.ini
xdebug.remote_enable=1 xdebug.remote_handler=dbgp xdebug.remote_mode=req xdebug.remote_host=127.0.0.1 xdebug.remote_port=9000
Allow port for Xdebug
sudo semanage port -a -t http_port_t -p tcp 9000
Now find your netbeans.conf file in your system:
sudo find / -name netbeans.conf
Now, open up the file and add the text "-J-Dorg.netbeans.modules.php.dbgp.level=400" in netbeans_default_options so that the line looks somewhat like this:
netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dnetbeans.logger.console=true -J-ea -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.zip.disableMemoryMapping=true -J-Dsun.awt.disableMixing=true -J-Dnetbeans.extbrowser.manual_chrome_plugin_install=yes -J-Dorg.netbeans.modules.php.dbgp.level=400"
Restart both NetBeans IDE and apache:
sudo service httpd restart
if not working then use

SQLSTATE[HY000]: General error: 1 Can't create/write to file '/tmp

You messed up with /tmp permissions. To fix:
chown root:root /tmp (root:root is mysql username and password which you used)
chmod 1777 /tmp 
/etc/init.d/mysqld restart (mysqld service restart)

how to see xml preview in browser php

xml preview view in browser $xml = new DOMDocument('1.0', 'UTF-8');                 $xml->preserveWhiteSpace = false; ...