<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>centos &#8211; VeriTeknik</title>
	<atom:link href="https://www.veriteknik.net.tr/en/tag/centos/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.veriteknik.net.tr/en/</link>
	<description>VeriTeknik Bilişim &#124; VeriTeknik Bilişim</description>
	<lastBuildDate>Sat, 03 Jul 2021 16:20:36 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>PHP 7 on CentOS 7 with PHP-FPM</title>
		<link>https://www.veriteknik.net.tr/en/php-7-on-centos-7-with-php-fpm-2/</link>
					<comments>https://www.veriteknik.net.tr/en/php-7-on-centos-7-with-php-fpm-2/#respond</comments>
		
		<dc:creator><![CDATA[ckaraca]]></dc:creator>
		<pubDate>Sun, 07 Jun 2020 20:46:37 +0000</pubDate>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[freetds]]></category>
		<category><![CDATA[mssql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[PHP 5.6]]></category>
		<category><![CDATA[PHP 5.6.3]]></category>
		<category><![CDATA[php-fpm]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[systemctl]]></category>
		<category><![CDATA[systemd]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=1053</guid>

					<description><![CDATA[<p>Most of the yum repositories don&#8217;t include PHP7.0.X on current releases for the time being. So if you need PHP7.0.X, you need to compile and build it for your self. I decided to put all required packages to the compilation, so most probably you wouldn&#8217;t need additional packages, just a quick tip, if you need [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/php-7-on-centos-7-with-php-fpm-2/">PHP 7 on CentOS 7 with PHP-FPM</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Most of the yum repositories don&#8217;t include PHP7.0.X on current releases for the time being. So if you need PHP7.0.X, you need to compile and build it for your self. I decided to put all required packages to the compilation, so most probably you wouldn&#8217;t need additional packages, just a quick tip, if you need additional packages you can install via pecl or pear tools.</p>
<h3>Which PHP configure options should I use before compiling?</h3>
<p>If you ever need to get the list of modules installed in your current PHP, type the following command via console:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="shell">php -m</pre>
<p>So, take a list of your current configuration and check the configure list below in order to have a compatible compilation to your existing older version of PHP.</p>
<p>Advice: First of all, you should consider removing PHP packages from your server before compiling PHP, but be aware your codes will be visible till you install the compiled version to your server, consider shutting down your apache server for a while.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">yum erase php*</pre>
<p>Before downloading the code, install &#8220;Development Tools&#8221; by typing:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">yum groupinstall "Development Tools"</pre>
<p>and install other related header files:</p>
<pre class="brush: shell; gutter: true; first-line: 1">yum install wget httpd-devel libtool-ltdl-devel libxml2-devel \
bzip2-devel net-snmp-devel openssl-devel pcre-devel \
curl-devel gd-devel mysql-devel libxslt-devel \
postgresql-devel gmp-devel systemd-devel</pre>
<p>Download &amp; install libmcrypt</p>
<pre class="brush: shell; gutter: true; first-line: 1">cd /usr/src
wget http://downloads.sourceforge.net/project\
/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
tar zxvf libmcrypt-2.5.8.tar.gz 
cd libmcrypt-2.5.8
./configure -libdir=/usr/lib64
make
make install</pre>
<p> </p>
<p>Download &amp; extract PHP 7.0.4 release:</p>
<pre class="brush: shell; gutter: true; first-line: 1">wget http://php.net/get/php-7.0.4.tar.gz/from/this/mirror
mv mirror /usr/src/php-7.0.4.tar.gz
cd /usr/src/
tar zxvf /usr/src/php-7.0.4.tar.gz 
cd php-7.0.4
./configure \
 --with-apxs2 \
 --with-curl=/usr/local/lib \
 --with-config-file-path=/etc \
 --with-config-file-scan-dir=/etc/php.d \
 --with-pic \
 --with-gd \
 --with-gettext \
 --with-jpeg-dir=/usr/local/lib \
 --with-freetype-dir=/usr/local/lib \
 --enable-sockets \
 --with-kerberos \
 --with-openssl \
 --with-mhash \
 --with-mcrypt=/usr/local/lib \
 --with-mysqli=/usr/bin/mysql_config \
 --with-pdo-mysql=/usr \
 --with-pdo-pgsql=/usr \
 --with-pcre-regex=/usr \
 --with-pear \
 --with-gmp \
 --with-pgsql \
 --with-png-dir=/usr/local/lib \
 --with-xsl \
 --with-zlib \
 --with-zlib-dir=/usr/local/lib \
 --with-iconv \
 --with-libxml-dir=/usr \
 --enable-bcmath \
 --enable-calendar \
 --enable-exif \
 --enable-ftp \
 --enable-gd-native-ttf \
 --enable-soap \
 --enable-sockets \
 --enable-mbstring \
 --enable-zip \
 --enable-wddx \
 --enable-shmop \
 --with-libdir=lib64 \
 --disable-debug \
 --with-bz2 \
 --enable-gd-native-ttf \
 --enable-xml \
 --with-snmp=/usr \
 --enable-json \
 --with-fpm-user=apache\
 --with-fpm-group=apache\
 --enable-fpm \
 --with-fpm-systemd
</pre>
<p>Make &amp; Install by typing:</p>
<pre class="brush: shell; gutter: true; first-line: 1">make
make install
cp php.ini-production /etc/php.ini
</pre>
<p>Run the following to enable systemd service for PHP:</p>
<pre class="brush: bash; gutter: true; first-line: 1">cat &lt;&lt;&lt; '
[Unit]
Description=The PHP FastCGI Process Manager - VeriTeknik
After=syslog.target network.target

[Service]
Type=notify
PIDFile=/var/run/php-fpm.pid
ExecStart=/usr/local/sbin/php-fpm --nodaemonize \
--fpm-config /etc/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID

[Install]
WantedBy=multi-user.target
' &gt; /usr/lib/systemd/system/php-fpm.service
systemctl enable php-fpm
</pre>
<p>Get rid of obsolete settings:</p>
<pre class="brush: shell; gutter: true; first-line: 1">sed -i 's#;date.timezone =.*#  date.timezone = "Europe/Istanbul"#' /etc/php.ini
sed -i 's#upload_max_filesize =.*#upload_max_filesize = 200M#' /etc/php.ini
sed -i 's#post_max_size =.*#post_max_size = 200M#' /etc/php.ini
cat &lt;&lt;&lt; ' include=/etc/php-fpm.d/*.conf [global] pid = \ 
/run/php-fpm/php-fpm.pid error_log = /var/log/php-fpm/error.log \
daemonize = no ' &gt; /etc/php-fpm.conf
mkdir /etc/php-fpm.d
</pre>
<p> </p>
<p>You need to create the appropriate user account the fpm process will run on, as a sample, we use <strong>plugged</strong> as a user:</p>
<pre class="brush: shell; gutter: true; first-line: 1">useradd plugged
chmod 755 /home/plugged</pre>
<p>create the php-fpm process config for the specific site:</p>
<pre class="brush: shell; gutter: true; first-line: 1">cat &lt;&lt;&lt; '
[www]
listen = 127.0.0.1:9001
 
listen.allowed_clients = 127.0.0.1
listen.owner = plugged
listen.group = plugged
user = plugged
group = plugged
pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35

slowlog = /var/log/php-fpm/www-slow.log
 
catch_workers_output = yes
 
php_admin_value[error_log] = /home/plugged/logs/mphp_error.log
php_admin_flag[log_errors] = on
php_value[session.save_handler] = files
php_value[session.save_path] = /home/plugged/session
' &gt; /etc/php-fpm.d/plugged.conf

mkdir /run/php-fpm/
mkdir /var/log/php-fpm/
touch /var/log/php-fpm/error.log
mkdir {/home/plugged/logs/,/home/plugged/session}
chown -R plugged:plugged /home/plugged
systemctl start php-fpm
sed -i 's/DirectoryIndex index.html.*/  DirectoryIndex index.html index.html.var index.php/' /etc/httpd/conf/httpd.conf</pre>
<p>please let us know if you find any mistake</p>


<p></p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/php-7-on-centos-7-with-php-fpm-2/">PHP 7 on CentOS 7 with PHP-FPM</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.veriteknik.net.tr/en/php-7-on-centos-7-with-php-fpm-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1053</post-id>	</item>
		<item>
		<title>PHP 7 on CentOS 7 with PHP-FPM</title>
		<link>https://www.veriteknik.net.tr/en/php-7-on-centos-7-with-php-fpm/</link>
					<comments>https://www.veriteknik.net.tr/en/php-7-on-centos-7-with-php-fpm/#respond</comments>
		
		<dc:creator><![CDATA[ckaraca]]></dc:creator>
		<pubDate>Wed, 18 Sep 2019 20:57:42 +0000</pubDate>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[freetds]]></category>
		<category><![CDATA[mssql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[PHP 5.6]]></category>
		<category><![CDATA[PHP 5.6.3]]></category>
		<category><![CDATA[php-fpm]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[systemctl]]></category>
		<category><![CDATA[systemd]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=1076</guid>

					<description><![CDATA[<p>Most of the yum repos doesn&#8217;t include PHP7.0.X on current releases for the time being. So if you need PHP7.0.X, you need to compile and build it for your self or you need to add additional repos to yum, which will be much more easier and much more flexible to update later. So, on a [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/php-7-on-centos-7-with-php-fpm/">PHP 7 on CentOS 7 with PHP-FPM</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Most of the yum repos doesn&#8217;t include PHP7.0.X on current releases for the time being. So if you need PHP7.0.X, you need to compile and build it for your self or you need to add additional repos to yum, which will be much more easier and much more flexible to update later. So, on a clean installed server proceed with the installation of Epel and Remi repos, in case you don&#8217;t have wget, also install it:</p>
<pre class="brush: bash; gutter: true; first-line: 1">yum install epel-release
yum install net-tools, bind-utils # optional life savers 
rpm -Uvh http://mirror.veriteknik.net.tr/remi/enterprise/remi-release-7.rpm
yum install php70-php-fpm php70-php-cli php70-php-gd php70-php-json \
php70-php-mbstring php70-php-mcrypt php70-php-mysqlnd php70-php-xml
yum install nginx</pre>
<p>&nbsp;<br />
Please note that if you need additional PHP packages, you can search them with the following command:</p>
<pre class="brush: bash; gutter: true; first-line: 1">yum list php70-*
#Available Packages
#php70-php-opcache.x86_64
#.
#.
#php70-php-pecl-crypto.x86_64
#php70-php-pecl-geoip.x86_64 
#php70-php-pecl-imagick.x86_64
#php70-php-pecl-memcache.x86_64
#php70-php-pecl-xdebug.x86_64
#php70-php-pgsql.x86_64
#php70-php-soap.x86_64
#php70-php-xmlrpc.x86_64
#..
# and to install a package you desire, type the name:
yum install php70-php-pgsql
</pre>
<p>Run the following to enable systemd service for PHP-FPM:</p>
<pre class="brush: bash; gutter: true; first-line: 1">systemctl enable php70-php-fpm
systemctl enable nginx</pre>
<p>Disable SELINUX, set to disabled:</p>
<pre class="brush: bash; gutter: true; first-line: 1">vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
<strong>SELINUX=disabled</strong>
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted</pre>
<p>type SHIFT+ZZ to save and exit, and for the time beign type setenforce 0 to disable SELINUX temproray.<br />
Next step is to get rid of obsolete settings:</p>
<pre class="brush: shell; gutter: true; first-line: 1">sed -i 's#;date.timezone =.*# &nbsp;date.timezone = \ 
"Europe/Istanbul"#' /etc/opt/remi/php70/php.ini
sed -i 's#upload_max_filesize =.*#upload_max_filesize = \
200M#' /etc/opt/remi/php70/php.ini
sed -i 's#post_max_size =.*#post_max_size = \
200M#' /etc/opt/remi/php70/php.ini

</pre>
<p>You need to create the appropriate user account the fpm process will run on, as a sample we use <strong>plugged</strong> as a user:</p>
<pre class="brush: shell; gutter: true; first-line: 1">useradd plugged
chmod 755 /home/plugged
mkdir /home/plugged/{logs,public_html,session}
touch /home/plugged/logs/{mphp_error.log,php-fpm-slow.log}
chown -R vtt:vtt /home/plugged/public_html/</pre>
<p>create the php-fpm process config for the specific site:</p>
<pre class="brush: shell; gutter: true; first-line: 1">cat &lt;&lt;&lt; '[plugged] 
listen = 127.0.0.1:9001
listen.allowed_clients = 127.0.0.1 
listen.owner = plugged 
listen.group = plugged 
user = plugged 
group = plugged 
pm = dynamic 
pm.max_children = 50 
pm.start_servers = 5 
pm.min_spare_servers = 5 
pm.max_spare_servers = 35 
slowlog = /home/plugged/logs/php-fpm-slow.log 
catch_workers_output = yes 
php_admin_value[error_log] = /home/plugged/logs/mphp_error.log 
php_admin_flag[log_errors] = on 
php_value[session.save_handler] = files 
php_value[session.save_path] = /home/plugged/session ' \
&gt; /etc/opt/remi/php70/php-fpm.d/plugged.conf
</pre>
<p>Turn on PHP-FPM by typing:</p>
<pre class="brush: shell; gutter: true; first-line: 1">systemctl start php70-php-fpm.service
</pre>
<p>If it fails to start, you can check the logs by typing<br />
systemctl status php70-php-fpm.service</p>
<p>Also please check the service is running by typing netstat so if the port is open, you should see that:</p>
<pre class="brush: shell; gutter: true; first-line: 1">netstat -tulpn | grep php-fpm
#tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN      908/php-fpm: master 
#tcp        0      0 127.0.0.1:9001          0.0.0.0:*               LISTEN      908/php-fpm: master 
</pre>
<p>please let us know if you find any mistake</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/php-7-on-centos-7-with-php-fpm/">PHP 7 on CentOS 7 with PHP-FPM</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.veriteknik.net.tr/en/php-7-on-centos-7-with-php-fpm/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1076</post-id>	</item>
		<item>
		<title>PHP 5.4.44 on CentOS 6.7</title>
		<link>https://www.veriteknik.net.tr/en/php-5-4-44-on-centos-6-7/</link>
					<comments>https://www.veriteknik.net.tr/en/php-5-4-44-on-centos-6-7/#respond</comments>
		
		<dc:creator><![CDATA[ckaraca]]></dc:creator>
		<pubDate>Mon, 31 Aug 2015 23:53:03 +0000</pubDate>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[freetds]]></category>
		<category><![CDATA[mssql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[PHP 5.6]]></category>
		<category><![CDATA[PHP 5.6.3]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=1011</guid>

					<description><![CDATA[<p>Most of the yum repos doesn&#8217;t include PHP5.4.X on current releases for the time being. So if you need PHP5.4.X, you need to compile and build it for your self. I decided to put all required packages to the compilation, so most probably you wouldn&#8217;t need additional packages, just a quick tip, if you need [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/php-5-4-44-on-centos-6-7/">PHP 5.4.44 on CentOS 6.7</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Most of the yum repos doesn&#8217;t include PHP5.4.X on current releases for the time being. So if you need PHP5.4.X, you need to compile and build it for your self. I decided to put all required packages to the compilation, so most probably you wouldn&#8217;t need additional packages, just a quick tip, if you need additional packages you can install via pecl or pear tools.</p>
<h3>Which PHP configure options should I use before compiling?</h3>
<p>If you ever need to get the list of modules installed in your current PHP, type the following command via console:</p>
<pre class="brush: bash; gutter: true; first-line: 1">php -m</pre>
<p>So, take a list of your current configuration and check the configure list below in order to have a compatible compilation to your existing older version of PHP.</p>
<p>Advise: First of all, you should consider removing php packages from your server before compiling php, but beaware your codes will be visible till you install the compiled version to your server, consider shutting down your apache server for a while.</p>
<pre class="brush: shell; gutter: true; first-line: 1">yum erase php*</pre>
<p>Before downloading the code, install &#8220;Development Tools&#8221; by tiping:</p>
<pre class="brush: shell; gutter: true; first-line: 1">yum groupinstall "Development Tools"</pre>
<p>and install other related header files:</p>
<pre class="brush: shell; gutter: true; first-line: 1">yum install httpd-devel libtool-ltdl-devel libxml2-devel bzip2-devel net-snmp-devel openssl-devel pcre-devel curl-devel gd-devel mysql-devel libxslt-devel postgresql-devel gmp-devel</pre>
<p>Download &amp; install libmcrypt</p>
<pre class="brush: shell; gutter: true; first-line: 1">cd /usr/src
wget http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
   tar zxvf libmcrypt-2.5.8.tar.gz 
   cd libmcrypt-2.5.8
   ./configure -libdir=/usr/lib64
   make
   make install</pre>
<p>&nbsp;</p>
<p>Download &amp; extract php 5.4.44 release:</p>
<pre class="brush: shell; gutter: true; first-line: 1">wget http://php.net/get/php-5.4.44.tar.gz/from/this/mirror
mv mirror php-5.4.44.tar.gz
tar zxvf php-5.4.44.tar.gz
./configure \
 --with-apxs2 \
 --with-curl=/usr/local/lib \
 --with-config-file-path=/etc \
 --with-config-file-scan-dir=/etc/php.d \
 --with-pic \
 --with-gd \
 --with-gettext \
 --with-jpeg-dir=/usr/local/lib \
 --with-freetype-dir=/usr/local/lib \
 --enable-sockets \
 --with-kerberos \
 --with-openssl \
 --with-mhash \
 --with-mcrypt=/usr/local/lib \
 --with-mysql=/usr \
 --with-mysqli=/usr/bin/mysql_config \
 --with-pdo-mysql=/usr \
 --with-pdo-pgsql=/usr \
 --with-pcre-regex=/usr \
 --with-pear \
 --with-gmp \
 --with-pgsql \
 --with-png-dir=/usr/local/lib \
 --with-xsl \
 --with-zlib \
 --with-zlib-dir=/usr/local/lib \
 --with-iconv \
 --with-libxml-dir=/usr \
 --enable-bcmath \
 --enable-calendar \
 --enable-exif \
 --enable-ftp \
 --enable-gd-native-ttf \
 --enable-soap \
 --enable-sockets \
 --enable-mbstring \
 --enable-zip \
 --enable-wddx \
 --enable-shmop \
 --with-libdir=lib64 \
 --disable-debug \
 --with-bz2 \
 --enable-gd-native-ttf \
 --enable-xml \
 --with-snmp=/usr \
 --enable-json 
</pre>
<p>Make &amp; Install by typing:</p>
<pre class="brush: shell; gutter: true; first-line: 1">make
make install
cp php.ini-production /etc/php.ini
</pre>
<p>Get rid of obsolete settings:</p>
<pre class="brush: shell; gutter: true; first-line: 1">sed -i 's#;date.timezone =.*#  date.timezone = "Europe/Istanbul"#' /etc/php.ini
sed -i 's#upload_max_filesize =.*#upload_max_filesize = 200M#' /etc/php.ini
sed -i 's#post_max_size =.*#post_max_size = 200M#' /etc/php.ini
</pre>
<p>Don&#8217;t forget to add respective extension to httpd.conf:</p>
<pre class="brush: shell; gutter: true; first-line: 1">echo "AddType application/x-httpd-php .php" &gt;&gt; /etc/httpd/conf.d/php.conf
echo "AddType application/x-httpd-php-source .phps" &gt;&gt; /etc/httpd/conf.d/php.conf</pre>
<p>and a final configuration:</p>
<pre class="brush: shell; gutter: true; first-line: 1">sed -i 's/DirectoryIndex index.html.*/  DirectoryIndex index.html index.html.var index.php/' /etc/httpd/conf/httpd.conf</pre>
<p>please let us know if you find any mistake</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/php-5-4-44-on-centos-6-7/">PHP 5.4.44 on CentOS 6.7</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.veriteknik.net.tr/en/php-5-4-44-on-centos-6-7/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1011</post-id>	</item>
		<item>
		<title>PHP5.6.3 on CentOS 6.6 with MSSQL Support</title>
		<link>https://www.veriteknik.net.tr/en/build-php5-6-on-centos-6-6-with-mssql-support/</link>
					<comments>https://www.veriteknik.net.tr/en/build-php5-6-on-centos-6-6-with-mssql-support/#respond</comments>
		
		<dc:creator><![CDATA[ckaraca]]></dc:creator>
		<pubDate>Wed, 03 Dec 2014 22:49:22 +0000</pubDate>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[freetds]]></category>
		<category><![CDATA[mssql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[PHP 5.6]]></category>
		<category><![CDATA[PHP 5.6.3]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=972</guid>

					<description><![CDATA[<p>Most of the yum repos doesn&#8217;t include PHP5.6.X on current releases for the time being. So if you need PHP5.6.X, you need to compile and build it for your self. Advise: First of all, you should consider removing php packages from your server before compiling php, but beaware your codes will be visible till you [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/build-php5-6-on-centos-6-6-with-mssql-support/">PHP5.6.3 on CentOS 6.6 with MSSQL Support</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Most of the yum repos doesn&#8217;t include PHP5.6.X on current releases for the time being. So if you need PHP5.6.X, you need to compile and build it for your self.</p>
<p>Advise: First of all, you should consider removing php packages from your server before compiling php, but beaware your codes will be visible till you install the compiled version to your server, consider shutting down your apache server for a while.</p>
<pre class="brush: shell; gutter: true; first-line: 1">yum erase php*</pre>
<p>Before downloading the code, install &#8220;Development Tools&#8221; by tiping:</p>
<pre class="brush: shell; gutter: true; first-line: 1">yum groupinstall "Development Tools"</pre>
<p>and install other related header files:</p>
<pre class="brush: shell; gutter: true; first-line: 1">yum install httpd-devel libtool-ltdl-devel libxml2-devel openssl-devel pcre-devel curl-devel gd-devel mysql-devel libxslt-devel</pre>
<p>Download &amp; install libmcrypt</p>
<pre class="brush: shell; gutter: true; first-line: 1">wget http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
   10  tar zxvf libmcrypt-2.5.8.tar.gz 
   11  cd libmcrypt-2.5.8
   12  ./configure 
   13  make
   14  make install</pre>
<p>Download FreeTDS source, don&#8217;t use yum to install freetds-devel!</p>
<pre class="brush: shell; gutter: true; first-line: 1">wget ftp://ftp.freetds.org/pub/freetds/current/freetds-current.tar.gz
tar zxvf freetds-stable.tgz
cd freetds-0.91/ #in my case
./configure --prefix=/usr/local/freetds --enable-msdblib
make
make install
cp include/tds.h /usr/local/freetds/include
cp src/tds/.libs/libtds.a /usr/local/freetds/lib
echo "/usr/local/freetds/lib" &gt;&gt; /etc/ld.so.conf
echo "export FREETDSCONF=/usr/local/freetds/etc/freetds.conf" &gt;&gt; /etc/profile
ln -s /usr/local/freetds/lib /usr/local/freetds/lib64</pre>
<p>Download &amp; extract php 5.6.3 release:</p>
<pre class="brush: shell; gutter: true; first-line: 1">wget http://php.net/get/php-5.6.3.tar.gz/from/this/mirror
mv mirror php-5.6.3.tar.gz
tar zxvf php-5.6.3.tar.gz
cd php-5.6.3
./configure \
        --with-apxs2 \
        --with-curl=/usr/local/lib \
        --with-gd \
        --with-gettext \
        --with-jpeg-dir=/usr/local/lib \
        --with-freetype-dir=/usr/local/lib \
        --with-kerberos \
        --with-openssl \
        --with-mhash \
        --with-mcrypt \
        --with-mysql=/usr \
        --with-mysqli=/usr/bin/mysql_config \
        --with-pdo-mysql=/usr \
        --with-pcre-regex=/usr \
        --with-pear \
        --with-png-dir=/usr/local/lib \
        --with-xsl \
        --with-zlib \
        --with-zlib-dir=/usr/local/lib \
        --with-iconv \
        --enable-bcmath \
        --enable-calendar \
        --enable-exif \
        --enable-ftp \
        --enable-gd-native-ttf \
        --enable-soap \
        --enable-sockets \
        --enable-mbstring \
        --enable-zip \
        --enable-wddx \
        --with-libdir=lib64 \
        --with-mssql=/usr/local/freetds</pre>
<p>Make &amp; Install by typing:</p>
<pre class="brush: shell; gutter: true; first-line: 1">make
make install
cp php.ini-production /etc/php.ini
sed -i 's/;date.timezone =.*/  date.timezone = "Europe/Istanbul"/' /etc/php.ini</pre>
<p>Don&#8217;t forget to add respective extension to httpd.conf:</p>
<pre>echo "AddType application/x-httpd-php .php" &gt;&gt; /etc/httpd/conf.d/php.conf
echo "AddType application/x-httpd-php-source .phps" &gt;&gt; /etc/httpd/conf.d/php.conf</pre>
<p>and a final configuration:</p>
<pre>sed -i 's/DirectoryIndex index.html.*/  DirectoryIndex index.html index.html.var index.php/' /etc/httpd/conf/httpd.conf</pre>
<p>please let us know if you find any mistake</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/build-php5-6-on-centos-6-6-with-mssql-support/">PHP5.6.3 on CentOS 6.6 with MSSQL Support</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.veriteknik.net.tr/en/build-php5-6-on-centos-6-6-with-mssql-support/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">972</post-id>	</item>
		<item>
		<title>Compile and build Apache + MySQL + PHP from the source</title>
		<link>https://www.veriteknik.net.tr/en/compiling-apache-mysql-php-source/</link>
					<comments>https://www.veriteknik.net.tr/en/compiling-apache-mysql-php-source/#respond</comments>
		
		<dc:creator><![CDATA[ckaraca]]></dc:creator>
		<pubDate>Thu, 31 Oct 2013 19:56:47 +0000</pubDate>
				<category><![CDATA[httpd]]></category>
		<category><![CDATA[LINUX]]></category>
		<category><![CDATA[Linux Optimization]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[Centos6]]></category>
		<category><![CDATA[CentOS6.4]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[httpd-2.2.25]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql-5.6.14]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[PHP 5.5.5]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[stratch]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=896</guid>

					<description><![CDATA[<p>This is a complete working solution to build Apache (httpd-2.2.25), MySQL (MySQL-5.6.14) and PHP (PHP-5.5.5) from the sources. Article tested many times on CentOS 6.4 and you can directly copy &#38; paste the commands below to build the lastest releases. We advise you to use a freshly installed OS as compiling may corrupt or delete [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/compiling-apache-mysql-php-source/">Compile and build Apache + MySQL + PHP from the source</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This is a complete working solution to build Apache (httpd-2.2.25), MySQL (MySQL-5.6.14) and PHP (PHP-5.5.5) from the sources. Article tested many times on CentOS 6.4 and you can directly copy &amp; paste the commands below to build the lastest releases. We advise you to use a freshly installed OS as compiling may corrupt or delete your existing structure or data. The solution both tested on a clean dedicated server and a KVM virtualized VPS.</p>
<p>Before you begin your compilation you should need additional header files and libraries required, please use the following code to install pre-requisities, don&#8217;t delete them as you would definitely need them when you upgrade to new releases also:</p>
<pre class="brush: shell; gutter: true; first-line: 1">yum install make gcc automake zlib-devel bison cmake libtool wget gcc-c++ unzip ncurses-devel openssl-devel pcre-devel libxml2-devel curl-devel gd-devel libxslt-devel</pre>
<h2>Building &amp; Installing Apache prefork</h2>
<p>download the latest release of Apache Web Server and unpack:</p>
<pre class="brush: shell; gutter: true; first-line: 1">wget http://ftp.itu.edu.tr/Mirror/Apache//httpd/httpd-2.2.25.tar.gz
tar zxvf httpd-2.2.25.tar.gz 
cd httpd-2.2.25</pre>
<p>We advise you to configure with the options below as this form is widely used:</p>
<pre class="brush: shell; gutter: true; first-line: 1">./configure \
        "--prefix=/etc/httpd" \
        "--exec-prefix=/etc/httpd" \
        "--bindir=/usr/bin" \
        "--sbindir=/usr/sbin" \
        "--sysconfdir=/etc/httpd/conf" \
        "--enable-so" \
        "--enable-dav" \
        "--enable-dav-fs" \
        "--enable-dav-lock" \
        "--enable-suexec" \
        "--enable-deflate" \
        "--enable-unique-id" \
        "--enable-mods-static=most" \
        "--enable-reqtimeout" \
        "--with-mpm=prefork" \
        "--with-suexec-caller=apache" \
        "--with-suexec-docroot=/" \
        "--with-suexec-gidmin=100" \
        "--with-suexec-logfile=/var/log/httpd/suexec_log" \
        "--with-suexec-uidmin=100" \
        "--with-suexec-userdir=public_html" \
        "--with-suexec-bin=/usr/sbin/suexec" \
        "--with-included-apr" \
        "--with-pcre=/usr" \
        "--includedir=/usr/include/apache" \
        "--libexecdir=/usr/lib/apache" \
        "--datadir=/var/www" \
        "--localstatedir=/var" \
        "--enable-logio" \
        "--enable-ssl" \
        "--enable-rewrite" \
        "--enable-proxy" \
        "--enable-expires" \
        "--with-ssl=/usr" \
        "--enable-headers"</pre>
<p>to build and install source distro, type:</p>
<pre class="brush: shell; gutter: true; first-line: 1">make
make install</pre>
<h2>Build &amp; Install MySQL</h2>
<p>Since we need headers and libraries of mysql for compiling PHP, we will first install MySQL server before PHP compilation.</p>
<pre class="brush: shell; gutter: true; first-line: 1">wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.14.tar.gz/from/http://cdn.mysql.com/
tar zxvf mysql-5.6.14.tar.gz 
cd mysql-5.6.14
groupadd mysql
useradd -g mysql mysql
cmake .  -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock
make
make install</pre>
<p>If you encounter problems while running cmake, you have to delete <strong>CmakeCache.txt</strong> before re-compiling with cmake</p>
<pre class="brush: shell; gutter: true; first-line: 1">#log in to newly created mysql dir
cd /usr/local/mysql/
#change owner and group
chown -R mysql:mysql .
scripts/mysql_install_db --user=mysql --datadir=/var/lib/mysql
#add service command
cp support-files/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld on
#start mysql server
service mysqld start</pre>
<p>change your mysql password by typing:</p>
<pre class="brush: shell; gutter: true; first-line: 1">./bin/mysqladmin -u root password 'new-password' 
./bin/mysqladmin -u root -h change.this.hostname password 'new-password'</pre>
<h2>Build libmcrypt from the source</h2>
<p>libmcypt repo is not included in the main yum repo, so better install it from the source:</p>
<pre class="brush: shell; gutter: true; first-line: 1">wget http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download?use_mirror=garr
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure
make
make install</pre>
<h2>Building PHP-5.5.5 from the source</h2>
<p>PHP configuration is also given with the mostly used modules &amp; functionality, download unpack &amp; configure as stated below:</p>
<pre class="brush: shell; gutter: true; first-line: 1">wget http://us2.php.net/get/php-5.5.5.tar.gz/from/this/mirror
tar zxvf php-5.5.5.tar.gz
cd php-5.5.5
./configure \
        --with-apxs2 \
        --with-curl=/usr \
        --with-gd \
        --with-gettext \
        --with-jpeg-dir=/usr \
        --with-freetype-dir=/usr \
        --with-kerberos \
        --with-openssl \
        --with-mcrypt=/usr/local/lib \
        --with-mhash \
        --with-mysql=mysqlnd \
        --with-mysqli=mysqlnd \
        --with-pcre-regex \
        --with-pear \
        --with-png-dir=/usr \
        --with-xsl \
        --with-zlib \
        --with-zlib-dir=/usr \
        --with-iconv \
        --enable-bcmath \
        --enable-calendar \
        --enable-exif \
        --enable-ftp \
        --enable-gd-native-ttf \
        --enable-soap \
        --enable-sockets \
        --enable-mbstring \
        --enable-zip \
        --enable-wddx
make
make install
libtool --finish /root/php-5.5.5/libs
cp php.ini-production /usr/local/lib/php.ini
sed -i 's/;date.timezone =.*/  date.timezone \= "Europe\/Istanbul"/' /usr/local/lib/php.ini</pre>
<h3>Download phpMyAdmin and install it to webroot:</h3>
<pre class="brush: shell; gutter: true; first-line: 1">wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/4.0.8/phpMyAdmin-4.0.8-all-languages.tar.gz
tar zxvf phpMyAdmin-4.0.8-all-languages.tar.gz 
mv phpMyAdmin-4.0.8-all-languages /var/www/
mv /var/www/phpMyAdmin-4.0.8-all-languages/ /var/www/phpMyAdmin</pre>
<p>create a test page to see if everything went well:</p>
<pre class="brush: shell; gutter: true; first-line: 1">echo "&lt;?PHP phpInfo();?&gt;" &gt; /var/www/index.php</pre>
<p>If you cannot see a PHP info page, you need to add httpd directives to your httpd.conf:</p>
<pre class="brush: shell; gutter: true; first-line: 1">echo "AddType application/x-httpd-php .php" &gt;&gt; /etc/httpd/conf/extra/httpd-php.conf
echo "AddType application/x-httpd-php-source .phps" &gt;&gt; /etc/httpd/conf/extra/httpd-php.conf

echo "Include conf/extra/httpd-php.conf" &gt;&gt; /etc/httpd/conf/httpd.conf</pre>
<p>restart apache by typing: <strong>apachectl restart</strong></p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/compiling-apache-mysql-php-source/">Compile and build Apache + MySQL + PHP from the source</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.veriteknik.net.tr/en/compiling-apache-mysql-php-source/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">896</post-id>	</item>
		<item>
		<title>Build PHP5.5 on CentOS 6.4 with MSSQL Support</title>
		<link>https://www.veriteknik.net.tr/en/build-php5-5-centos-6-4-mssql-support/</link>
					<comments>https://www.veriteknik.net.tr/en/build-php5-5-centos-6-4-mssql-support/#respond</comments>
		
		<dc:creator><![CDATA[ckaraca]]></dc:creator>
		<pubDate>Fri, 25 Oct 2013 01:24:27 +0000</pubDate>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[freetds]]></category>
		<category><![CDATA[mssql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[PHP 5.5.5]]></category>
		<category><![CDATA[PHP5.5]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=883</guid>

					<description><![CDATA[<p>Most of the yum repos doesn&#8217;t include PHP5.5.X on current releases for the time being. So if you need PHP5.5.X, you need to compile and build it for your self. Advise: First of all, you should consider removing php packages from your server before compiling php, but beaware your codes will be visible till you [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/build-php5-5-centos-6-4-mssql-support/">Build PHP5.5 on CentOS 6.4 with MSSQL Support</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Most of the yum repos doesn&#8217;t include PHP5.5.X on current releases for the time being. So if you need PHP5.5.X, you need to compile and build it for your self.</p>
<p>Advise: First of all, you should consider removing php packages from your server before compiling php, but beaware your codes will be visible till you install the compiled version to your server, consider shutting down your apache server for a while.</p>
<pre class="brush: shell; gutter: true; first-line: 1">yum erase php*</pre>
<p>Before downloading the code, install &#8220;Development Tools&#8221; by tiping:</p>
<pre class="brush: shell; gutter: true; first-line: 1">yum groupinstall "Development Tools"</pre>
<p>and install other related header files:</p>
<pre class="brush: shell; gutter: true; first-line: 1">yum install httpd-devel libxml2-devel openssl-devel pcre-devel curl-devel gd-devel mysql-devel libxslt-devel</pre>
<p>Download &amp; install libmcrypt</p>
<pre class="brush: shell; gutter: true; first-line: 1">wget http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
   tar zxvf libmcrypt-2.5.8.tar.gz 
   cd libmcrypt-2.5.8
   ./configure 
   make
   make install</pre>
<p>Download FreeTDS source, don&#8217;t use yum to install freetds-devel!</p>
<pre class="brush: shell; gutter: true; first-line: 1">wget ftp://ftp.astron.com/pub/freetds/stable/freetds-stable.tgz
tar zxvf freetds-stable.tgz
cd freetds-0.91/ #in my case
./configure --prefix=/usr/local/freetds --enable-msdblib
make
make install
cp include/tds.h /usr/local/freetds/include
cp src/tds/.libs/libtds.a /usr/local/freetds/lib
echo "/usr/local/freetds/lib" &gt;&gt; /etc/ld.so.conf
echo "export FREETDSCONF=/usr/local/freetds/etc/freetds.conf" &gt;&gt; /etc/profile
ln -s /usr/local/freetds/lib /usr/local/freetds/lib64</pre>
<p>Download &amp; extract php 5.5.5 release:</p>
<pre class="brush: shell; gutter: true; first-line: 1">wget http://us2.php.net/get/php-5.5.5.tar.gz/from/this/mirror
mv mirror php-5.5.5.tar.gz
tar zxvf php-5.5.5.tar.gz
cd php-5.5.5
./configure \
        --with-apxs2 \
        --with-curl=/usr/local/lib \
        --with-gd \
        --with-gettext \
        --with-jpeg-dir=/usr/local/lib \
        --with-freetype-dir=/usr/local/lib \
        --with-kerberos \
        --with-openssl \
        --with-mcrypt \
        --with-mhash \
        --with-mysql=/usr \
        --with-mysqli=/usr/bin/mysql_config \
        --with-pdo-mysql=/usr \
        --with-pcre-regex=/usr \
        --with-pear \
        --with-png-dir=/usr/local/lib \
        --with-xsl \
        --with-zlib \
        --with-zlib-dir=/usr/local/lib \
        --with-iconv \
        --enable-bcmath \
        --enable-calendar \
        --enable-exif \
        --enable-ftp \
        --enable-gd-native-ttf \
        --enable-soap \
        --enable-sockets \
        --enable-mbstring \
        --enable-zip \
        --enable-wddx \
        --with-libdir=lib64 \
        --with-mssql=/usr/local/freetds</pre>
<p>Make &amp; Install by typing:</p>
<pre class="brush: shell; gutter: true; first-line: 1">make
make install
cp php.ini-production /etc/php.ini
sed -i 's/;date.timezone =.*/  date.timezone \= "Europe\/Istanbul"/' /etc/php.ini</pre>
<p>Don&#8217;t forget to add respective extension to httpd.conf:</p>
<pre>echo "AddType application/x-httpd-php .php" &gt;&gt; /etc/httpd/conf.d/php.conf
echo "AddType application/x-httpd-php-source .phps" &gt;&gt; /etc/httpd/conf.d/php.conf</pre>
<p>and a final configuration:</p>
<pre>sed -i 's/DirectoryIndex index.html.*/  DirectoryIndex index.html index.html.var index.php/' /etc/httpd/conf/httpd.conf</pre>
<p>please let us know if you find any mistake</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/build-php5-5-centos-6-4-mssql-support/">Build PHP5.5 on CentOS 6.4 with MSSQL Support</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.veriteknik.net.tr/en/build-php5-5-centos-6-4-mssql-support/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">883</post-id>	</item>
		<item>
		<title>Download Plugged.in LAMP installer for CentOS 6.x</title>
		<link>https://www.veriteknik.net.tr/en/plugged-install-lamp-for-centosredhat-6-x-download/</link>
					<comments>https://www.veriteknik.net.tr/en/plugged-install-lamp-for-centosredhat-6-x-download/#respond</comments>
		
		<dc:creator><![CDATA[ckaraca]]></dc:creator>
		<pubDate>Wed, 20 Jun 2012 22:15:06 +0000</pubDate>
				<category><![CDATA[Data Bases]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[LINUX]]></category>
		<category><![CDATA[LINUX Help]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[installer]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[ntpdate]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[rpmforge]]></category>
		<category><![CDATA[selinux]]></category>
		<category><![CDATA[server]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=568</guid>

					<description><![CDATA[<p>Version Info: V0.2 21/06/2012 DO you ever wanted to set-up a testing server with &#8211; Apache virtual config, logs, paths setted, &#8211; MySQL server with password set, &#8211; FTP Server (Vsftpd), &#8211; PHP and PhpMyAdmin installed &#38; configured on your server or VPS in seconds? If you answer &#8220;yes&#8221; to the question, you are in [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/plugged-install-lamp-for-centosredhat-6-x-download/">Download Plugged.in LAMP installer for CentOS 6.x</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Version Info: V0.2 21/06/2012</p>
<p>DO you ever wanted to set-up a testing server with<br />
&#8211; Apache virtual config, logs, paths setted,<br />
&#8211; MySQL server with password set,<br />
&#8211; FTP Server (Vsftpd),<br />
&#8211; PHP and PhpMyAdmin installed &amp; configured on your server or VPS in seconds?</p>
<p>If you answer &#8220;yes&#8221; to the question, you are in the right place, what does this script do in basic:</p>
<p>&#8211; Installs http, PHP, MySQL, phpMyAdmin, rpmforge repo and other related packages<br />
&#8211; Sets apache configs, mod_deflate, virtual hosts, create user, cgi-bin directory<br />
&#8211; Sets time with ntpdate, disables iptables &amp; selinux, mysql password and<br />
&#8211; Updates the system</p>
<p>What is needed?<br />
&#8211; A clean minimal install of CentOS/Redhat 6.X</p>
<p>How can I download the script?</p>
<pre class="brush: bash; gutter: true; first-line: 1">wget http://www.plugged.in/downloads/plugged.sh</pre>
<p>or just download it.</p>
<p>[wpdm_file id=1]</p>
<p>How to use the script?</p>
<pre class="brush: bash; gutter: true; first-line: 1">chmod 755 plugged.sh
./plugged.sh -u username -p password -d domain.com</pre>
<p>You can reach phpMyAdmin by typing domain.com/phpMyAdmin/</p>
<p>If you have suggestions or requests please write down!</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/plugged-install-lamp-for-centosredhat-6-x-download/">Download Plugged.in LAMP installer for CentOS 6.x</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.veriteknik.net.tr/en/plugged-install-lamp-for-centosredhat-6-x-download/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">568</post-id>	</item>
		<item>
		<title>Find the Largest Files</title>
		<link>https://www.veriteknik.net.tr/en/find-the-largest-files/</link>
					<comments>https://www.veriteknik.net.tr/en/find-the-largest-files/#respond</comments>
		
		<dc:creator><![CDATA[Mustafa Emre Aydın]]></dc:creator>
		<pubDate>Mon, 16 Apr 2012 07:29:01 +0000</pubDate>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[LINUX Help]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[large]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[unix]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=315</guid>

					<description><![CDATA[<p>The other day I was working on a server and needed the LARGEST files on some directory &#8211; including its subdirectories. As it turns out, it&#8217;s a very simple task limiting the file size you want with the output of the find tool. The -size argument will define the borders of your output. Let&#8217;s say [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/find-the-largest-files/">Find the Largest Files</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The other day I was working on a server and needed the LARGEST files on some directory &#8211; including its subdirectories.</p>
<p>As it turns out, it&#8217;s a very simple task limiting the file size you want with the output of the <strong>find</strong> tool.</p>
<p>The <strong>-size</strong> argument will define the borders of your output. Let&#8217;s say you want to find the files smaller than 50 MB on your server,</p>
<pre class="brush: bash; gutter: true; first-line: 1">find / -type f -size -50M</pre>
<p>Well, this will print out the full path and the file names, you won&#8217;t know which file is at what size. So to improve this, we can execute an <strong>ls</strong> command on each output,</p>
<pre class="brush: bash; gutter: true; first-line: 1">find / -type f -size -50M -exec ls -lh {} \;</pre>
<p>On this command, the <strong>{}</strong> refers to the output of each find command, and the <strong>\;</strong> is mandatory since we need to tell <strong>find</strong> where our <strong>-exec</strong> line ends, hence the escape character. (<strong>\</strong>)</p>
<p>Even though this looks good, we can keep improving by printing out the file size all in the same units. (Let&#8217;s say, megabytes) The problem with that is, the <strong>ls</strong> command can printout with the specified block size limit but it will take that block size <em><a href="http://www.thefreedictionary.com/Quantised" target="_blank">quantised</a></em>, meaning the output will only be the exact multiplicands of that block size. So if our block size is set to 1 MB and a file is 900 KB, <strong>ls</strong> will output it as 1 MB.</p>
<p>Although this is not so accurate, we can always work it around using <strong>awk</strong> to calculate the numeric values for us. Since <strong>ls</strong> normally prints out the file size in <em>bytes</em>, we can divide them to become actual <em>megabytes</em>. The line below will printout <strong>ls</strong> with actual megabytes.</p>
<pre class="brush: bash; gutter: true; first-line: 1">ls -l | awk '{print $1 " " $2 " " $3 " " $4 " " $5/1048576 " " $6 " " $7 " " $8 " " $9}'</pre>
<p>Well, we only need the <em>5th</em> column and the <em>9th</em> column which are the <em>size</em> and the <em>path</em> respectively, so the command below will suffice :</p>
<pre class="brush: bash; gutter: true; first-line: 1">ls -l | awk '{ print $5/1048576 " " $9 }'</pre>
<p>As you can see, we had to use a <em>pipe</em> to get things done here. So we need to use this pipe in our <em>exec</em> part of our <strong>find</strong> command, which is another problem. Well, the work around for this is to <strong>-exec</strong> a <em>shell instance</em> and pass the whole <strong>ls</strong> and <strong>awk</strong> line including the pipes so that new shell instance will handle things for us.</p>
<pre class="brush: bash; gutter: true; first-line: 1">find / -type f -size -50M -size +20M -exec sh -c "ls -l '{}'|awk '{print \$5/1048576 " MB: " \$9}'" \;</pre>
<p>Ok, let&#8217;s have a look at the command above. As you can see we narrowed our limits further, by getting only the files smaller than 50 MB and larger than 20 MB. We also passed our whole command with a shell instance. On this instance, the argument for <strong>ls</strong> was passed with the <strong>{}</strong> method. We apostrophized it (<strong>&#8221;</strong>) due to the possibility of having spaces in the filename, which would have caused a problem. After that, we&#8217;ve piped our output to <strong>awk</strong>, divided the <em>bytes</em>, and added a string &#8221; MB: &#8221; right before printing the <em>9th</em> column which is the file path. Don&#8217;t forget that we should escape the <em>$5</em> and <em>$9</em> using the escape character <strong>\</strong> since we don&#8217;t want the whole <strong>find</strong> line to process it before our <strong>awk</strong> does.</p>
<p>Well, the good thing is we have necessary output, the bad thing is that, it isn&#8217;t in order! So let&#8217;s make things even prettier and <em>sort</em> them, while making the output of each &#8220;<strong>MB:</strong>&#8221; bold to get some eye candy.</p>
<pre class="brush: bash; gutter: true; first-line: 1">find / -type f -size -50M -size +20M -exec sh -c "ls -l '{}'|awk '{print \$5/1048576 \" \033[1mMB:\033[0;0m \" \$9}'" \; | sort -nr -k1</pre>
<p>As you can see here, we&#8217;ve piped the <strong>find</strong> command to the <strong>sort</strong>, not the <strong>shell</strong> instance that we invoked in the <strong>find</strong> command, that&#8217;s why the pipe is right after our <strong>\;</strong> character.</p>
<p>On this command, find will also search inside <strong>/proc</strong> directory, which is a living directory, so during the search some files will be created and destroyed rapidly, which will cause some annoying outputs saying &#8220;file not found&#8221;. To avoid that, let&#8217;s tell find <strong>NOT</strong> to search the <strong>/proc</strong> directory using the <strong>-prune</strong> argument.</p>
<pre class="brush: bash; gutter: true; first-line: 1">find / -path '/proc' -prune -o -type f -size -50M -size +20M -exec sh -c "ls -l '{}'|awk '{print \$5/1048576 \" \033[1mMB:\033[0;0m \" \$9}'" \; | sort -nr -k1</pre>
<p>You can add new directories to prune with the <strong>-path &#8216;/new/directory/to/prune&#8217; -prune -o</strong> method.</p>
<p>Hope this helps.</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/find-the-largest-files/">Find the Largest Files</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.veriteknik.net.tr/en/find-the-largest-files/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">315</post-id>	</item>
	</channel>
</rss>
