<?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>apache &#8211; VeriTeknik</title>
	<atom:link href="https://www.veriteknik.net.tr/en/tag/apache/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>Wed, 07 Nov 2018 20:43:02 +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>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>Add New Hosting to a System Installed With Plugged.sh</title>
		<link>https://www.veriteknik.net.tr/en/add-new-hosting-to-a-system-installed-with-plugged-sh/</link>
					<comments>https://www.veriteknik.net.tr/en/add-new-hosting-to-a-system-installed-with-plugged-sh/#respond</comments>
		
		<dc:creator><![CDATA[Mustafa Emre Aydın]]></dc:creator>
		<pubDate>Wed, 03 Jul 2013 11:45:30 +0000</pubDate>
				<category><![CDATA[Data Bases]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[LINUX]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[mysql]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=779</guid>

					<description><![CDATA[<p>If you use our LAMP installer script and want to add a new domain afterwards, we&#8217;ve created a simple script to ease up the process. This script creates a new user, adds the domain settings for Apache, adds a new MySQL Database and user, restarts necessary services. Simply get our script from here or on [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/add-new-hosting-to-a-system-installed-with-plugged-sh/">Add New Hosting to a System Installed With Plugged.sh</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you use our <a title="Download Plugged.in LAMP installer for CentOS 6.x" href="https://github.com/VeriTeknik/plugged.sh">LAMP installer script</a> and want to add a new domain afterwards, we&#8217;ve created a simple script to ease up the process. This script creates a new user, adds the domain settings for Apache, adds a new MySQL Database and user, restarts necessary services.</p>
<p>Simply get our script from <a href="https://github.com/VeriTeknik/plugged.sh">here</a> or on your server via wget.</p>
<pre class="brush: bash; gutter: true; first-line: 1">git clone https://github.com/VeriTeknik/plugged.sh.git</pre>
<p>Run the script (as root) to learn about the usage.</p>
<pre class="brush: bash; gutter: true; first-line: 1">sh hostingadd.sh

Usage: hostingadd.sh -u username -p password -d domain -ip IP -dbu dbuser -dbn dbname -dbp dbpass

 -u username : Set the LOGIN name (FTP user)
 -p password : Set the Password
 -d domain : Set the Domain
 -ip ip : Set the IP address for the domain
 -dbu dbuser : Set the MySQL User
 -dbn dbname : Set the MySQL Database Name
 -dbp dbpass : Set the MySQL User Password</pre>
<p>The parameters are explained above. The script will try to create the MySQL databases as root, so it will need access to MySQL. In order to manage it, you&#8217;ll have to create a <strong>.my.cnf</strong> file under your <strong>/root</strong>  path. The <strong>/root/.my.cnf file</strong> should be like this :</p>
<pre class="brush: text; gutter: true; first-line: 1">[client]
user=root
pass=yourMySQLrootPassword</pre>
<p>Don&#8217;t worry about writing your password in clear text. This file is restricted by root access anyway, so if someone can read this file, your server is already compromised.</p>
<p>You can access via FTP by using the username and password provided while running the script. You can also check if the database is successfully added via phpmyadmin (which is installed by plugged.sh)</p>
<p>There isn&#8217;t an uninstall script yet, but I&#8217;ll write one asap.</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/add-new-hosting-to-a-system-installed-with-plugged-sh/">Add New Hosting to a System Installed With Plugged.sh</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/add-new-hosting-to-a-system-installed-with-plugged-sh/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">779</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>
		<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>
[wpdm_file id=1]
<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>Building PHP 5.4.3 on CentOS</title>
		<link>https://www.veriteknik.net.tr/en/building-php-5-4-3-on-centos/</link>
					<comments>https://www.veriteknik.net.tr/en/building-php-5-4-3-on-centos/#respond</comments>
		
		<dc:creator><![CDATA[Mustafa Emre Aydın]]></dc:creator>
		<pubDate>Fri, 01 Jun 2012 10:31:42 +0000</pubDate>
				<category><![CDATA[httpd]]></category>
		<category><![CDATA[LINUX]]></category>
		<category><![CDATA[Linux Optimization]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[php]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=525</guid>

					<description><![CDATA[<p>Even though it&#8217;s easier to use yum, sometimes we need to compile PHP from source code. Below I&#8217;ll describe a method for compiling PHP 5.4.3 on CentOS, this works both on 5.x and 6.x and all the dependencies (except for PHP itself, of course ) will be retrieved via yum. After a fresh install of [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/building-php-5-4-3-on-centos/">Building PHP 5.4.3 on CentOS</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Even though it&#8217;s easier to use yum, sometimes we need to compile PHP from source code. Below I&#8217;ll describe a method for compiling PHP 5.4.3 on CentOS, this works both on 5.x and 6.x and all the dependencies (except for PHP itself, of course ) will be retrieved via yum.</p>
<p>After a fresh install of CentOS, we will need the wget binary, if you don&#8217;t already have it, get it with yum.</p>
<pre class="brush: bash; gutter: true; first-line: 1">yum install wget -y</pre>
<p>For some of the dependencies to get installed, we&#8217;ll need the rpmforge repository, so let&#8217;s add it.</p>
<pre class="brush: bash; gutter: true; first-line: 1">wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -K rpmforge-release-0.5.2-2.el5.rf.*.rpm
rpm -i rpmforge-release-0.5.2-2.el5.rf.*.rpm</pre>
<p>Now let&#8217;s install the dependencies for our PHP compilation. Keep in mind that these are only for the configuration I&#8217;ll describe below, if you use a different compilation, you&#8217;ll need to get different packages. Also keep in mind that here I&#8217;ll only download the x86_64 packages, if you&#8217;re using a different architecture, just delete the x86_64 on every package name that contains it. The reason I specifically used that notation is to avoid downloading i386 packages, which is unnecessary but yum insists on downloading anyway.</p>
<pre class="brush: bash; gutter: true; first-line: 1">yum install gcc make automake autoconf perl.x86_64 httpd-devel.x86_64 libxml2-devel.x86_64 openssl-devel.x86_64 pcre-devel.x86_64 bzip2-devel.x86_64 curl-devel.x86_64 enchant-devel.x86_64 libjpeg-devel.x86_64 libpng-devel.x86_64 libXpm-devel.x86_64 freetype-devel.x86_64 gmp-devel.x86_64 libicu-devel.x86_64 gcc-c++ libmcrypt-devel.x86_64 postgresql-devel.x86_64 aspell-devel.x86_64 libedit-devel.x86_64 recode-devel.x86_64 net-snmp-devel.x86_64 libtidy-devel.x86_64 libxslt-devel.x86_64 libcurl-devel.x86_64 libtool-ltdl-devel.x86_64 -y</pre>
<p>Now let&#8217;s download the php 5.4.3 source code.</p>
<pre class="brush: bash; gutter: true; first-line: 1">wget http://tr.php.net/get/php-5.4.3.tar.gz/from/this/mirror
tar xvzf php-5.4.3.tar.gz
cd php-5.4.3</pre>
<p>We can start the configure-make-make install trio now.</p>
<pre class="brush: bash; gutter: true; first-line: 1">./configure  --with-apxs2=/usr/sbin/apxs --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --target=x86_64-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-libdir=lib64 --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --disable-debug --with-pic --disable-rpath --with-bz2 --with-freetype-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr --enable-gd-native-ttf --without-gdbm --with-gettext --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-pcre-regex=/usr --with-zlib --with-layout=GNU --enable-exif --enable-ftp --enable-sockets --enable-sysvsem --enable-sysvshm --enable-sysvmsg --with-kerberos --enable-shmop --enable-calendar --with-libxml-dir=/usr --enable-xml --enable-pcntl --with-imap-ssl --enable-mbregex --enable-bcmath=shared --enable-dba=shared --with-db4=/usr --with-xmlrpc=shared --with-mysql --with-mysqli --enable-dom=shared --with-pgsql --enable-wddx=shared --with-snmp=shared,/usr --enable-soap=shared --with-xsl=shared,/usr --enable-xmlreader=shared --enable-xmlwriter=shared --with-curl --enable-json --enable-zip=shared --without-readline --with-libedit --with-pspell=shared --enable-phar=shared --with-tidy=shared,/usr --enable-sysvmsg=shared --enable-sysvshm=shared --enable-sysvsem=shared --enable-posix=shared --enable-fileinfo=shared --enable-intl=shared --with-icu-dir=/usr --with-enchant=shared,/usr --with-recode=shared,/usr --enable-mbstring --with-mcrypt --with-gd
make
make install</pre>
<p>Now we have php installed.</p>
<p>Further we can configure the basic steps of Apache.<br />
Edit your httpd.conf file : /etc/httpd/conf/httpd.conf<br />
Find the line that says <em>AddType application/x-tar .tgz </em>Append these two lines below it.</p>
<p><strong>AddType application/x-httpd-php .php</strong><br />
<strong>AddType application/x-httpd-php-source .phps </strong></p>
<p>Also we should tell apache that index.php is an index file (or whatever index you want), so update your <em>DirectoryIndex</em> as following :</p>
<p><strong>DirectoryIndex index.html index.html.var index.php index.htm</strong></p>
<p>copy php.ini-production to /etc/php.ini and edit the file based on your performance requirements, please have a look at our security pages to secure your php configuration from the <a title="Web Hosting Security premier" href="http://www.plugged.in/linux/web-hosting-security/web-hosting-security-premier.html" target="_blank">link</a>.</p>
<p>Some suggestions: Increase upload limit, raise memory_limit to 256M and set date.timezone to your location, in our case it is:</p>
<p>date.timezone = Europe/Istanbul</p>
<p>After saving and exiting the httpd.conf file, restart your Apache services. ( <strong>service httpd restart</strong> )</p>
<p>Now you have <strong>/var/www/html</strong> as your default web home root, and PHP 5.4.3 running on it.</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/building-php-5-4-3-on-centos/">Building PHP 5.4.3 on CentOS</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/building-php-5-4-3-on-centos/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">525</post-id>	</item>
		<item>
		<title>Apache mod_rewrite &#124; URL redirection with .htaccess</title>
		<link>https://www.veriteknik.net.tr/en/apache-mod_rewrite-url-redirection-with-htaccess/</link>
					<comments>https://www.veriteknik.net.tr/en/apache-mod_rewrite-url-redirection-with-htaccess/#respond</comments>
		
		<dc:creator><![CDATA[ckaraca]]></dc:creator>
		<pubDate>Thu, 24 May 2012 14:38:44 +0000</pubDate>
				<category><![CDATA[httpd]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[redirection]]></category>
		<category><![CDATA[url]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=476</guid>

					<description><![CDATA[<p>Apache rewrite is an apache web server module which gives opportunity to change URL folders during opening of pages. At first it is hard to understand mod_rewrite but if you know what you are doing then it will become a usefull tool. You can reach the documents supplied by developer site located here: Apache Docs [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/apache-mod_rewrite-url-redirection-with-htaccess/">Apache mod_rewrite | URL redirection with .htaccess</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p style="text-align: justify;">Apache rewrite is an apache web server module which gives opportunity to change URL folders during opening of pages. At first it is hard to understand mod_rewrite but if you know what you are doing then it will become a usefull tool. You can reach the documents supplied by developer site located here: <a title="Apache Documentation" href="http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html" target="_blank">Apache Docs</a></p>
<p style="text-align: justify;">Usage areas of Apache mod_rewrite are:</p>
<ul>
<li>URL Redirect Ex: Redirection of plugged.in to www.plugged.in</li>
<li>Browser Redirect Ex: If Internet explorer is below version 7 then redirection to basic folder instead of high technology site</li>
<li>Bot Redirect, Ex: Redirection of Google bot for SEO optimization to a page which contains static links</li>
<li>Redirection to a different sun folder regarding to the browser language</li>
<li>To block out creating hotlinks of picture files Ex: You can prevent consuming bandwidth which is done by pictures used by other sites</li>
<li>SEO SEO Optimizationu, Ex: To show dynamic pages like php, aspx as static like .html</li>
</ul>
<p>used for purposes like above.</p>
<p>In order to use Apache Mod_rewrite, you must have the below instructions in the httpd.conf or in VirtualHost settings:</p>
<pre class="brush: bash; gutter: false; first-line: 1">OPTIONS  FollowSymLinks
# or
OPTIONS All
#and
AllowOverride All
#or
AllowOverride FileInfo</pre>
<p>You must create &#8220;.htaccess&#8221; file in the root folder of your web site in order to use mod_rewrite. There is always a point character in the begining of the secret files in the Unix systems, this is why htaccess can&#8217;t be seen through FTP applications. Because of this you should backup htaccess file locally if you only use ftp to store your files.<br />
.htaccess must begin with this description:</p>
<pre class="brush: bash; gutter: false; first-line: 1"># Apache must know the URLs which we change.
RewriteEngine On
# After that line, we will write the URLs to change</pre>
<p>Rewrite works like an algoritm, fist of all we should tell rewrite to change which requests. For this, we use RewriteCond command.</p>
<h4>RewriteCond command</h4>
<p><strong>Usage:</strong><br />
RewriteCond [Statement]+[NC]+[OR]
RewriteCond process the information like IP Address, site name, etc came from the browsers like Internet Explorer, Mozilla Firefox and Google Chrome.</p>
<p>These are the mostly used statements;<br />
<strong>REQUEST_FILENAME:</strong> Name of the requested page (ex. index.php)<br />
<strong>HTTP_USER_AGENT:</strong> Name of the used brwoser or bot(ex. For Firefox Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1 )<br />
<strong>QUERY_STRING:</strong> Statement after question mark (ex. index.php?page=anasayfa )<br />
<strong>SERVER_PROTOCOL:</strong> http or https<br />
<strong>HTTP_HOST:</strong> domain name<br />
<strong>THE_REQUEST:</strong> Requested page (ex. search.php )<br />
<strong>HTTP_REFERER:</strong> Site which requested page<br />
<strong>[NC]</strong> (No Case)<br />
This suffix provides non upper/lowercase sensitive statements.</p>
<p><strong>[OR]</strong> (or)<br />
To combine Multi RewriteCond statements.</p>
<h4>RewriteRule Statement</h4>
<p>You can specify how to write URL after existing condition, with this statement:<br />
<strong>[R]</strong> (push redirection)<br />
Redirected to external adress.</p>
<p><strong>[F]</strong> (forbiddenn)<br />
Redirected to page which indicates no permissions available to this page.</p>
<p><strong>[L]</strong> (last rule)<br />
Indicates that this statement is the last statement and no rule run after this point.</p>
<p>Let&#8217;s have a look at the examples to sort things up:</p>
<p><strong>Prevent hotlinking</strong></p>
<pre class="brush: bash; gutter: false; first-line: 1">RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$ [NC] # if no referrer
RewriteCond %{HTTP_REFERER} !^http://yoursitename.com [NC] # if the referrer is not your site
RewriteCond %{HTTP_REFERER} !^http://www.yoursitename.com [NC] # if the referrer is not your site
RewriteCond %{HTTP_REFERER} !^http://site_ip_address [NC] # if the referrer is not your sites ip
RewriteRule ^.*$ http://www.yoursitename.com/hotlink.jpg [R,L] # redirect to hotlink image</pre>
<p>or you can deny the request instead of redirecting to hotlink image:</p>
<pre class="brush: bash; gutter: false; first-line: 1">RewriteRule .*\.(jpe?g|gif|bmp|png)$ - [F]</pre>
<p><strong>www redirection</strong></p>
<p><strong></strong>You can use the example below if one or more domain names like domain.com, seconddomain.com redirects to the same site:</p>
<pre class="brush: bash; gutter: false; first-line: 1">RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.sitename.com$ [NC]
RewriteRule ^(.*)$ http://www.sitename.com/$1 [R,L]</pre>
<h4 class="brush: bash; gutter: false; first-line: 1">Browser Redirection</h4>
<pre class="brush: bash; gutter: false; first-line: 1">It is used when there is differences between browsers while interpreting javascripts and css. Also you can redirect search engine bots such as googlebot to a page which is more plain but no javascript and css at all.By this way you may have a better ranking.</pre>
<pre class="brush: bash; gutter: false; first-line: 1">RewriteEngine On

# MS Internet Explorer - Mozilla v4
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/4(.*)MSIE
RewriteRule ^index\.html$ /explorer.html [L]

# Chrome - Mozilla v5 - must be before Firefox rule
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/5(.*)Chrome
RewriteRule ^index\.html$ /chrome.html [L]

# Firefox - Mozilla v5
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/5(.*)Gecko
RewriteRule ^index\.html$ /firefox.html [L]

# Googlebot
RewriteCond %{HTTP_USER_AGENT} ^Googlebot/2(.*)googlebot
RewriteRule ^index\.html$ /google.html [L]

# Lynx or Mozilla v1/2
RewriteCond %{HTTP_USER_AGENT} ^Lynx/ [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/[12]
RewriteRule ^index\.html$ /resimsiz.html [L]

# others
RewriteRule ^index\.html$ /index.html [L]</pre>
<h4 class="brush: bash; gutter: false; first-line: 1">Several Home Pages based on Day time</h4>
<pre class="brush: bash; gutter: false; first-line: 1">RewriteEngine On
RewriteBase /

# 5:00 &gt; &lt; 8:00 funny code
RewriteCond %{TIME_HOUR} &gt;02
RewriteCond %{TIME_HOUR} &lt;05
RewriteRule ^index\\.html$ /morning.html

# 8:00 &gt; &lt; 16:00
RewriteCond %{TIME_HOUR} &gt;05
RewriteCond %{TIME_HOUR} &lt;13
RewriteRule ^index\\.html$ /day.html

# 16:00 &gt; &lt; 22:00
RewriteCond %{TIME_HOUR} &gt;13
RewriteCond %{TIME_HOUR} &lt;19
RewriteRule ^index\\.html$ /afternoon.html

# 22:00 &gt; &lt; 05:00
RewriteCond %{TIME_HOUR} &gt;19
RewriteCond %{TIME_HOUR} &lt;02
RewriteRule ^index\\.html$ /night.html</pre>
<h4 class="brush: bash; gutter: false; first-line: 1">HTTP to HTTPS Redirection</h4>
<p>In cases where you only want the checkout page to be SSL enabled.</p>
<pre class="brush: bash; gutter: false; first-line: 1">RewriteEngine on
rewritecond %{https} !^on$
rewritecond %{QUERY_STRING} checkout$ [NC]
RewriteRule .* https://sitename.com/checkout.php [R=301,L]</pre>
<h4 class="brush: bash; gutter: false; first-line: 1">Redirection based on Browser Language</h4>
<pre class="brush: bash; gutter: false; first-line: 1">RewriteEngine on

# English
RewriteCond %{HTTP:Accept-Language} ^en [NC]
RewriteRule ^$ /en/ [L,R=301]

# German
RewriteCond %{HTTP:Accept-Language} ^de [NC]
RewriteRule ^$ /de/ [L,R=301]

# Spain
RewriteCond %{HTTP:Accept-Language} ^es [NC]
RewriteRule ^$ /es/ [L,R=301]

#All other languages
RewriteRule ^$ /default/ [L,R=301]</pre>
<h4 class="brush: bash; gutter: false; first-line: 1">Third level domain redirection to one site</h4>
<pre class="brush: bash; gutter: false; first-line: 1">You might have several domain names pointing the same site like yoursite.com and yoursite.com.au etc and you want to redirect all domain names to yoursite.com, here is the solution:</pre>
<pre class="brush: bash; gutter: false; first-line: 1">RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?yoursite.org [NC,OR]
RewriteCond %{HTTP_HOST} ^(www\.)?yoursite.info [NC,OR]
RewriteCond %{HTTP_HOST} ^(www\.)?yoursite.net [NC,OR]
RewriteCond %{HTTP_HOST} ^(www\.)?yoursite.com.au [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,NC, L]</pre>
<pre class="brush: bash; gutter: false; first-line: 1">.</pre>
<pre class="brush: bash; gutter: false; first-line: 1"></pre>
<pre class="brush: bash; gutter: false; first-line: 1"></pre>
<pre class="brush: bash; gutter: false; first-line: 1"></pre>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/apache-mod_rewrite-url-redirection-with-htaccess/">Apache mod_rewrite | URL redirection with .htaccess</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/apache-mod_rewrite-url-redirection-with-htaccess/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">476</post-id>	</item>
	</channel>
</rss>
