<?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>Programmin &#8211; VeriTeknik</title>
	<atom:link href="https://www.veriteknik.net.tr/en/category/knowledge_base/programm-in/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>Syslog Client for lwIP for 32 bit Atmel UC3A microcontrollers</title>
		<link>https://www.veriteknik.net.tr/en/syslog-client-for-lwip-for-32-bit-atmel-uc3a-microcontrollers/</link>
					<comments>https://www.veriteknik.net.tr/en/syslog-client-for-lwip-for-32-bit-atmel-uc3a-microcontrollers/#respond</comments>
		
		<dc:creator><![CDATA[ckaraca]]></dc:creator>
		<pubDate>Mon, 31 Dec 2012 13:31:39 +0000</pubDate>
				<category><![CDATA[embedded]]></category>
		<category><![CDATA[32 bit]]></category>
		<category><![CDATA[atmel]]></category>
		<category><![CDATA[avr32]]></category>
		<category><![CDATA[avrstudio]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[evk1100]]></category>
		<category><![CDATA[freertos]]></category>
		<category><![CDATA[linked list]]></category>
		<category><![CDATA[uc3a]]></category>
		<category><![CDATA[uc3a0512]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=735</guid>

					<description><![CDATA[<p>Last time I get into an embedded project I realised that I am getting tired of USART interface errors and I should definetely switch to a better organized tracing system. While sending debug data or any relevant data through network interface you can use an open source  syslog server available through google. I used Syslog [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/syslog-client-for-lwip-for-32-bit-atmel-uc3a-microcontrollers/">Syslog Client for lwIP for 32 bit Atmel UC3A microcontrollers</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Last time I get into an embedded project I realised that I am getting tired of USART interface errors and I should definetely switch to a better organized tracing system. While sending debug data or any relevant data through network interface you can use an open source  syslog server available through google. I used Syslog Server located in this <a title="Syslog Server" href="http://www.google.com.tr/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;ved=0CDYQFjAA&amp;url=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fsyslog-server%2F&amp;ei=DNHaUPCtCtG0hAf054H4BQ&amp;usg=AFQjCNGX_TArweXeJE_kSmYdPlBN91732Q&amp;bvm=bv.1355534169,d.ZG4" target="_blank">link</a>. So when you finish your tests you can direct your results to a real syslog server such as native unix syslog available in all linux distros.</p>
<p>So, the deal is, since you will work on an embeded environment, you don&#8217;t have too much memory to store syslog entries until the syslog service push the logs to the remote server, so I decided to use <strong>linked list</strong> in order to minimize overhead and store every log in its variable length storage unit. The main structure of the variable is:</p>
<pre class="brush: c; gutter: true; first-line: 1">typedef struct _SYSLOGMESSAGE {
	char * text;
	unsigned int size;
	struct _SYSLOGMESSAGE *_next;
	} SYSLOGMESSAGE;</pre>
<p>What this structure telling us is every log message coming to the queue is stored in an arbitrary memory allocation and linked to the next message within itself. The advantage to use linked list is, you don&#8217;t have to create a static length array even every row is created dynamically, every message in syslog may vary from 10 characters to say 255 characters and obviously you need to delete all stored messages from the queue with their coming order. When the logger start pushing the messages qeued on RAM, a temproray pointer will point to the first message, process the messsage and before dispatching the message the pointer will set itself to the next message by using _next field inside the structure. With this method there is no need to allocate a large array block in memory.</p>
<h2>Global SysLog Function to be used by all processes:</h2>
<p>In the header file (syslog.h) you might want to declare the function as:</p>
<pre class="brush: cpp; gutter: true; first-line: 1">void SysLog(const char *msg, int severity);</pre>
<p>and other necessary declerations as well:</p>
<pre class="brush: cpp; gutter: true; first-line: 1">#define LOG_LOCAL0      (16&lt;&lt;3) /* your atmel will send messages with this ID */
#define LOG_LOCAL1      (17&lt;&lt;3) /* reserved for local use */
#define LOG_LOCAL2      (18&lt;&lt;3) /* reserved for local use */</pre>
<p>Please refer to <a title="Syslog RFC 5424" href="https://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;ved=0CDMQFjAA&amp;url=http%3A%2F%2Ftools.ietf.org%2Fhtml%2Frfc5424&amp;ei=bXfhULeAOdS5hAfktYCgBQ&amp;usg=AFQjCNEKSTtKyXV0S9ImSl4W_hsoGz5cyQ&amp;sig2=NJ8MO1Ms3rfW44XO0VUyPg&amp;bvm=bv.1355534169,d.ZG4" target="_blank">syslog RFC</a> for further information about the lines above, since we need LOCAL0 only, the definitions are enough. You may want to seperate LOCAL0 messages in the syslogd server and you can find examples in the net. syslog subsystem uses UDP to send and receive data so we don&#8217;t need to get into deep TCP/IP programming routines.</p>
<p>There will be two routines to complete syslog for Atmel, we can call them as sink &amp; the source (syslog). Source will be called by other processes to send syslog messages to the syslog queue, and sink will push them to syslogd server in a period of time.</p>
<h3>The source:</h3>
<pre class="brush: cpp; gutter: true; first-line: 1">void SysLog(const char *msg, int severity)
{
	semaphore = true; // tell all processes to wait until I finish
	vTaskDelay( 10 ); // add some delay
	char *tmptext = ( char * )malloc( sizeof( char )*MESSAGESIZE ); // Allocate space with the size of msg text
	if(tmptext!=NULL) // If allocated
	{
		time_t now;unsigned int n=0;
		message = (SYSLOGMESSAGE*)malloc(sizeof(SYSLOGMESSAGE)); // Allocate space with the size of syslog
		if(message!=NULL) // If allocated
		{
			n=sprintf(tmptext, "&lt;%d&gt;%.15s %s", LOG_LOCAL0 | severity, ctime(&amp;now) + 4, msg); // format message
			tmptext[n] = '\0'; // add trailing EOF descriptor
			message-&gt;_next = NULL; // this is the last message (we know it)
			message-&gt;text = (char*)malloc(n); // allocate message
			memcpy(message-&gt;text,tmptext,n); // set pointer of the allocated message
			free(tmptext); // free temprorary message space
			message-&gt;size = n; // send message size
			if(curwp!=NULL) // If this is not the first message in the queue
			{
				curwp-&gt;_next = message; // set previos messages _next to this message
				curwp = message; // set current message pointer to this message
				curwp-&gt;_next = NULL; // set next to NULL to be sure
			}
			else // else
			{
				first = message; // else this is the first message ever
				curwp = first; // set curwp pointer to this message also
			}

		} else NAKED_TRACE_COM2("cannot allocate memory for message");			

	} else NAKED_TRACE_COM2("cannot allocate memory for tmp");		
	semaphore = false; // free semaphore
}</pre>
<p>As described, the source (syslog() function) will be responsible for adding syslog messages to the syslog queue.</p>
<h3>The Sink:</h3>
<p>The sink is operated by FreeRTOS, for simplicity we set empty BasicTFTP.c &amp; BasicTFTP.h in Evk1100 Control Panel demo example, be use to set TFTP_USED=1 symbol in project properties.</p>
<p>Here is the code:</p>
<pre class="brush: cpp; gutter: true; first-line: 1">portTASK_FUNCTION( vBasicTFTPServer, pvParameters ){
	SYSLOGMESSAGE *tmp; // temprorary syslog message
	first = NULL;
	curwp= NULL;

	struct netconn *conn; 
	struct ip_addr addr;
	int port;
	struct netbuf *buf;
	char * data;

	while (1) {
		while(semaphore); // wait until new syslog message drops to queue
		if(first!=NULL) // If any messages in the queue
		{
			do
			{
				tmp = first; // set temproray pointer to the first message
				if(first-&gt;text!=NULL)
				{
					conn=netconn_new(NETCONN_UDP); // create new connection
					if(conn!=NULL)
					{
						IP4_ADDR(&amp;addr,192,168,2,5); port=514; // set your IP address of the syslogd server &amp; port here
						if(netconn_connect(conn, &amp;addr, port)==ERR_OK)
						{
							buf=netbuf_new();
							data =netbuf_alloc(buf, first-&gt;size);
							memcpy (data, first-&gt;text, first-&gt;size);
							netconn_send(conn, buf);
							netbuf_delete(buf);
						} else NAKED_TRACE_COM2("netconn connect error");
						netconn_delete(conn);
					} else NAKED_TRACE_COM2("netconn error");

					if(tmp-&gt;text!=NULL) free(tmp-&gt;text); // empty message allocation
				}
				first=first-&gt;_next; // set next message as first
				free(tmp); // delete vanished message structure

				if(first==NULL) curwp=NULL; // if no messages set curwp to NULL
			} while(tmp-&gt;_next!=NULL);
		} 

		vTaskDelay( 100 );  //some delay!
	}
}</pre>
<p>For a complete source code please follow this link:</p>
<p>[wpdm_file id=2]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/syslog-client-for-lwip-for-32-bit-atmel-uc3a-microcontrollers/">Syslog Client for lwIP for 32 bit Atmel UC3A microcontrollers</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/syslog-client-for-lwip-for-32-bit-atmel-uc3a-microcontrollers/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">735</post-id>	</item>
		<item>
		<title>How to send requests with SessionID in Unity Standalone</title>
		<link>https://www.veriteknik.net.tr/en/how-to-send-requests-unity/</link>
					<comments>https://www.veriteknik.net.tr/en/how-to-send-requests-unity/#respond</comments>
		
		<dc:creator><![CDATA[Canberk Polat]]></dc:creator>
		<pubDate>Fri, 21 Dec 2012 14:26:41 +0000</pubDate>
				<category><![CDATA[Unity3D]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=722</guid>

					<description><![CDATA[<p>Opening an sql connection from your game isn&#8217;t really safe. So you should write, use a server software or find another solution like the one I wrote this article. Why you should use http protocol instead of server software doing this ? These software might have bugs and if you don&#8217;t know any low level [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/how-to-send-requests-unity/">How to send requests with SessionID in Unity Standalone</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Opening an sql connection from your game isn&#8217;t really safe. So you should write, use a server software or find another solution like the one I wrote this article.</p>
<p>Why you should use http protocol instead of server software doing this ?</p>
<ul>
<li>These software might have bugs and if you don&#8217;t know any low level programming language, you can&#8217;t fix it.</li>
<li>Hard integration process. If you don&#8217;t have any experience, in this way will take lot of time.</li>
<li>If you are not developing a mmo game, generally http protocol will be enough to do what you want.</li>
</ul>
<p>Of course server software will be faster but if few hundred milisecond latency won&#8217;t be a problem for your game this is the way to follow.</p>
<p>First send a request without header parameter or if you want to send request with specific header you can also set in begining but it is less safe.</p>
<pre class="brush: javascript; gutter: true; first-line: 1">var form = new WWWForm();
form.AddField("hash",hash);
form.AddField("userName",username);
form.AddField("password",password);
form.AddField("query","login");
var w = WWW(URL,form);
yield w;
if (w.error != null){
        print(w.error);
}else{
	result = w.text;
	w.Dispose();
}</pre>
<p>Now, we send our request but each time we try to send another request unity will recreate header so we should save the session id to send with same id on other requests.</p>
<pre class="brush: javascript; gutter: true; first-line: 1">var v : String[] = Regex.Split(w.responseHeaders["SET-COOKIE"],";");
header.Add("Cookie",v[0]);</pre>
<p>Do not forget to clear or recreate header on your login function cause &#8220;Add&#8221; function doesn&#8217;t overwrite the same key.</p>
<p>After login you can send requests without username&amp;password because you already sent this information to server and server cached this with your session id. From now on you can send requests like this:</p>
<pre class="brush: javascript; gutter: true; first-line: 1">var w = WWW(URL,form.data,header);
yield w;
if (w.error != null){
	print(w.error);
}else{
	result = w.text;
	w.Dispose();
}</pre>
<p>And get the results of requests.</p>
<p>By the way Unity WebPlayer doesn&#8217;t provide a function to read session,cookie etc. But you don&#8217;t need to read because Unity is not recreating header. Browser sending and saving header and not changing it so you can authenticate without saving&amp;sending header information.</p>
<p>Have a nice day.</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/how-to-send-requests-unity/">How to send requests with SessionID in Unity Standalone</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/how-to-send-requests-unity/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">722</post-id>	</item>
		<item>
		<title>Simple LDAP Class for PHP</title>
		<link>https://www.veriteknik.net.tr/en/simple-ldap-class-for-php/</link>
					<comments>https://www.veriteknik.net.tr/en/simple-ldap-class-for-php/#respond</comments>
		
		<dc:creator><![CDATA[ckaraca]]></dc:creator>
		<pubDate>Sun, 25 Nov 2012 00:12:55 +0000</pubDate>
				<category><![CDATA[LDAP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Developer]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=652</guid>

					<description><![CDATA[<p>In this post, i&#8217;m gonna explain how to connect to a LDAP server via using PHP. First i wanna talk about some definitions; LDAP means Lightweight Directory Access Protocol. As you can understand from it&#8217;s name, it is a database which uses directory-tree based structure. It&#8217;s used by OpenLDAP, Sun Directory Server, Microsoft Active Directory [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/simple-ldap-class-for-php/">Simple LDAP Class for PHP</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In this post, i&#8217;m gonna explain how to connect to a LDAP server via using PHP.</p>
<p>First i wanna talk about some definitions;</p>
<p><strong>LDAP</strong> means Lightweight Directory Access Protocol.</p>
<p>As you can understand from it&#8217;s name, it is a database which uses directory-tree based structure.</p>
<p>It&#8217;s used by OpenLDAP, Sun Directory Server, Microsoft Active Directory and such directory services.</p>
<p><strong>LDIF</strong> means LDAP Data Interchange Format.</p>
<p>You can easily execute LDAP queries using ldif files. For example;</p>
<pre class="brush: powershell; gutter: true; first-line: 1">dn: cn=John Doe,dc=example,dc=com
cn: John Doe
givenName: John
sn: Doe
telephoneNumber: +1 888 555 6789
telephoneNumber: +1 888 555 1232
mail: john@example.com
Manager: cn=Jane Doe,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top</pre>
<p>You can see some other terms(actually attributes) in the LDAP query above. Such as dn: Distinguished Name, cn: Common Name, sn: Surname.</p>
<p>I&#8217;ll give more information about LDAP later in another post.</p>
<p><strong>PHP LDAP Functions</strong></p>
<p>PHP has it&#8217;s own LDAP functions by it&#8217;s own. But i&#8217;ve decided to write a class for easier access to these functions.</p>
<p>First, you have to include our class below.</p>
<pre class="brush: php; gutter: true; first-line: 1">&lt;?php 

class LDAP{

    public  $ldapserver = "99.245.56.89";
    public  $ldapport = "389";
    public  $basedn = "cn=admin,dc=web-sistem,dc=com";
    public  $basepass = "yourldap_password"; 

	function connect($server,$port){

		echo "Connecting to LDAP Server..."; 
		$connection = ldap_connect($server,$port);  // must be a valid LDAP server!	
		ldap_set_option($connection, LDAP_OPT_PROTOCOL_VERSION, 3);

		// PHP Reference says there is no control of connection status in OpenLDAP 2.x.x
		// So we'll use binding function to check connection status.

		return $connection;

	}

	function bind($connection,$basedn,$basepass){

		echo "&lt;br&gt;&lt;br&gt;Binding...&lt;br&gt;";  
		$ldaprdn  = $basedn;    // ldap rdn or dn 
		$ldappass = $basepass;  // associated password
		$bind = ldap_bind($connection, $ldaprdn, $ldappass);

		if ($bind) { 
			echo "LDAP bind successful...";

		} else { 
			echo "LDAP bind failed..."; 
		}
	}

	function search($connection, $searchdn, $filter, $attributes = array()){

		$sr = ldap_search($connection, $searchdn, $filter, $attributes);

		if ($sr) {
			echo 'Search Succeeded. Getting Entries...&lt;br&gt;';

	        echo "Number of entires returned:  " . ldap_count_entries($connection, $sr) . "&lt;br /&gt;";

	        $info = ldap_get_entries($connection, $sr);

	        echo "Data for " . $info["count"] . " items returned:&lt;p&gt;\n";

			print_r($info);
			echo '&lt;hr&gt;&lt;br&gt;';

		} else {
			echo 'Search Failed.&lt;br&gt;';
		}
	}

	function addRecord($connection, $adddn, $record){

	    $addProcess = ldap_add($connection, $adddn, $record);

	    if($addProcess){
	        echo "Entry added&lt;br&gt;";
			echo '&lt;hr&gt;&lt;br&gt;';
	    } else {
	    	echo "Please check your data&lt;br&gt;";
			echo '&lt;hr&gt;&lt;br&gt;';
	    }
	}

	function modifyRecord($connection, $modifydn, $record){
		$modifyProcess = ldap_modify($connection, $modifydn, $record);
	    if($modifyProcess){
	        echo "Entry modified&lt;br&gt;";
			echo '&lt;hr&gt;&lt;br&gt;';
	    } else {
	    	echo "Please check your data&lt;br&gt;";
			echo '&lt;hr&gt;&lt;br&gt;';
	    }
	}

	function deleteRecord($connection, $dn, $recursive = false){
	    echo "Deleting Record...&lt;br&gt;";

	    if($recursive == false){
	    	echo 'Entry: ' . $dn . ' deleted.';
	        return(ldap_delete($connection, $dn));
	    } else {

	        // Search for child entries	        
	        $sr = ldap_list($connection, $dn, "ObjectClass=*", array(""));
	        $info = ldap_get_entries($connection, $sr);

	        for($i=0;$i&lt;$info['count'];$i++){
	            // Recursive delete child entries - using myldap_delete to recursive deletion
	            $result = myldap_delete($connection, $info[$i]['dn'], $recursive);
	            if(!$result){
	                // return status code if deletion fails.
	                return($result);
	            }
	        }
			// Delete top dn
			echo 'Entry: ' . $dn . ' deleted.';
	        return(ldap_delete($connection, $dn));
	    }
	}

	function close($connection){
		echo '&lt;hr&gt;&lt;br&gt;';
	    echo "Closing connection";
	    ldap_close($connection);
	}

}

?&gt;</pre>
<p>And then you may want to initialize and use our class. Usage is so simple.</p>
<pre class="brush: php; gutter: true; first-line: 1">&lt;?php

	require_once('class.ldap.php');

	$ldap = new LDAP();

	// Connect to LDAP Server  - connect(ldap_server, port)
	$connection = $ldap-&gt;connect($ldap-&gt;ldapserver,$ldap-&gt;ldapport);

	// Bind with LDAP instance
	$ldap-&gt;bind($connection,'cn=admin,dc=web-sistem,dc=com','yourldap_password');

	echo '&lt;hr&gt;&lt;br&gt;';

	// Search LDAP directory

	// Search with a wildcard
	$ldap-&gt;search($connection,'o=hosting,dc=web-sistem,dc=com','vd=*');

	// Search with no attributes specified	
	$ldap-&gt;search($connection,'o=hosting,dc=web-sistem,dc=com','vd=plugged.in');

	// Search with attributes (attributes must be an array)

	$ldap-&gt;search($connection,'o=hosting,dc=web-sistem,dc=com','vd=web-sistem.com', array('custID'));

	// Prepare data to insert

	// Please change the record entry as required by your company directory structure

	$insert_data['objectclass'][0] = "top";
	$insert_data['objectclass'][1] = "VirtualDomain";

	$insert_data["accountActive"] = "TRUE";
	$insert_data["delete"] = "FALSE";
	$insert_data["lastChange"] = "103";
	$insert_data["vd"] = "plugged.in";
	$insert_data["adminID"] = "3";
	$insert_data["custID"] = "2";
	$insert_data["editAV"] = "FALSE";
	$insert_data["maxAlias"] = "20";
	$insert_data["maxMail"] = "22";
	$insert_data["maxQuota"] = "300";
	$insert_data["postfixTransport"] = "maildrop:";

	// LDAP Insert DN		
	$addDN = "vd=plugged.in,o=hosting,dc=web-sistem,dc=com";
	$ldap-&gt;addRecord($connection,$addDN,$insert_data);

	// Prepare data to modify

	// Please change the record entry as required by your company directory structure

	$modify_data["adminID"] = "3213";
	$modify_data["custID"] = "2441";

	// LDAP Modify DN		
	$modifyDN = "vd=plugged.in,o=hosting,dc=web-sistem,dc=com";
	$ldap-&gt;modifyRecord($connection,$modifyDN,$modify_data);

	// Delete LDAP record	(third parameter is "Recursive")
	$deleteDN = "vd=plugged.in,o=hosting,dc=web-sistem,dc=com";
	$ldap-&gt;deleteRecord($connection,$deleteDN,true);

	//Close LDAP Connection
	$ldap-&gt;close($connection);
?&gt;</pre>
<p><strong>That&#8217;s all for now.</strong></p>
<p><strong>If you have questions or advices about this class please leave a message in comments section.</strong></p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/simple-ldap-class-for-php/">Simple LDAP Class for PHP</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/simple-ldap-class-for-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">652</post-id>	</item>
		<item>
		<title>Install mod_python on Centos 6</title>
		<link>https://www.veriteknik.net.tr/en/install-mod_python-on-centos-6/</link>
					<comments>https://www.veriteknik.net.tr/en/install-mod_python-on-centos-6/#respond</comments>
		
		<dc:creator><![CDATA[Mustafa Emre Aydın]]></dc:creator>
		<pubDate>Fri, 24 Aug 2012 08:15:58 +0000</pubDate>
				<category><![CDATA[httpd]]></category>
		<category><![CDATA[LINUX]]></category>
		<category><![CDATA[Programmin]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mod_python]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=631</guid>

					<description><![CDATA[<p>mod_python is one of the easiest ways to use your Python Scripts as web pages. To install mod_python on your Centos 6 server, simply follow the steps below. We also recommend using our LAMP installer, this method can easily be implemented with our installer. To install mod_python, we need the EPEL repositories: rpm --import https://fedoraproject.org/static/0608B895.txt [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/install-mod_python-on-centos-6/">Install mod_python on Centos 6</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>mod_python is one of the easiest ways to use your Python Scripts as web pages. To install mod_python on your Centos 6 server, simply follow the steps below. We also recommend using our <a title="Download Plugged.in LAMP installer for CentOS 6.x" href="http://www.plugged.in/linux/plugged-install-lamp-for-centosredhat-6-x-download.html">LAMP installer</a>, this method can easily be implemented with our installer.</p>
<p>To install mod_python, we need the EPEL repositories:</p>
<pre class="brush: bash; gutter: true; first-line: 1">rpm --import https://fedoraproject.org/static/0608B895.txt
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
rpm -ivh epel-release-6-7.noarch.rpm
yum install yum-priorities</pre>
<p>Now edit the <strong>/etc/yum.repos.d/eped.rep</strong>o file and add <strong>priority=10</strong> to the <strong>[epel]</strong> section.</p>
<p>After that follow the steps below and you&#8217;ll have mod_python installed and active.</p>
<pre class="brush: bash; gutter: true; first-line: 1">yum install mod_python
service httpd restart</pre>
<p>Now you should configure your httpd.conf files so that apache nows where and when to interpret your Python scripts. If you have installed you system with our LAMP installer, then go to <strong>/etc/httpd/conf.d</strong> and edit you websites <strong>.conf</strong> file (starting with a<strong> z_</strong>)</p>
<pre class="brush: bash; gutter: true; first-line: 1">vi /etc/httpd/conf.d/z_castmator.com</pre>
<p>Make sure you add the following lines in the<strong> &lt;Directory &#8230;&gt; &lt;/Directory&gt;</strong> statements.</p>
<pre class="brush: text; gutter: true; first-line: 1">AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On</pre>
<p>Don&#8217;t forget that PythonDebug is for debug mode. When you&#8217;re done developing it may be a good idea to turn it off.</p>
<p>Also don&#8217;t forget to add your DirectoryIndex handlers so that Apache knows you can also have Python Index files. You can add this right after the <strong>&lt;/Directory&gt;</strong> statement.</p>
<pre class="brush: text; gutter: true; first-line: 1">DirectoryIndex index.html index.php index.py</pre>
<p>Since we&#8217;ve altered with the configuration files of Apache, we should restart it again, then you are ready to go.</p>
<pre class="brush: bash; gutter: true; first-line: 1">service httpd restart</pre>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/install-mod_python-on-centos-6/">Install mod_python on Centos 6</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/install-mod_python-on-centos-6/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">631</post-id>	</item>
	</channel>
</rss>
