<?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>Security &#8211; lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</title>
	<atom:link href="https://lifelinux.com/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>https://lifelinux.com</link>
	<description>All About Linux !</description>
	<lastBuildDate>Fri, 26 Aug 2011 05:36:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.5.3</generator>
	<item>
		<title>How To Setup A LAMP Server On Centos 6.0</title>
		<link>https://lifelinux.com/how-to-setup-a-lamp-server-on-centos-6-0/</link>
					<comments>https://lifelinux.com/how-to-setup-a-lamp-server-on-centos-6-0/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Fri, 26 Aug 2011 00:50:25 +0000</pubDate>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[WebServer]]></category>
		<category><![CDATA[Apache Hardening]]></category>
		<category><![CDATA[enterprise linux]]></category>
		<category><![CDATA[install httpd]]></category>
		<category><![CDATA[install LAMP]]></category>
		<category><![CDATA[install php]]></category>
		<category><![CDATA[install php 5]]></category>
		<category><![CDATA[install php5]]></category>
		<category><![CDATA[LAMP Hardening]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux security]]></category>
		<category><![CDATA[linux security modules]]></category>
		<category><![CDATA[optimize apache]]></category>
		<category><![CDATA[optmizing apache]]></category>
		<category><![CDATA[php 5]]></category>
		<category><![CDATA[php version]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[red hat enterprise]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[rhel 5]]></category>
		<category><![CDATA[rpm command]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[setup LAMP]]></category>
		<category><![CDATA[yum command]]></category>
		<category><![CDATA[yum install httpd]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=1081</guid>

					<description><![CDATA[<p>LAMP is essentially a server that runs Linux, Apache, MySQL and Php/Perl and is more commonly known as a LAMP server. This guide provides step-by-step instructions for installing a full-featured LAMP server on a CentOS 6 .0 1. Update system Before proceeding to install, update the system with the following command # yum update 2. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-setup-a-lamp-server-on-centos-6-0/">How To Setup A LAMP Server On Centos 6.0</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p><strong>LAMP</strong> is essentially a server that runs <strong>L</strong>inux, <strong>A</strong>pache, <strong>My</strong>SQL and <strong>P</strong>hp/<strong>P</strong>erl and is more commonly known as a LAMP server. This guide provides step-by-step instructions for installing a full-featured LAMP server on a CentOS 6 .0<br />
<span id="more-1081"></span></p>
<h2>1. Update system</h2>
<p>Before proceeding to install, update the system with the following command</p>
<pre># yum update</pre>
<h2>2. Install and Configure the Apache Web Server</h2>
<p>The Apache web server is the most popular server online, used on more than 70% of all servers connected to the World Wide Web. And there are good reasons for it: it’s free, it’s very stable, it delivers a great performance, it’s very customizable. To install the current version of the Apache web server use the following command</p>
<pre># yum install httpd</pre>
<p>If you want to run Apache by default when the system boots, type the following command</p>
<pre># chkconfig httpd --level 2345 on</pre>
<p>To start Apache for the first time, type the following command</p>
<pre># /etc/init.d/httpd start</pre>
<h3>3. Apache Web Server Security and Optimization</h3>
<p><strong>1. Disable any unnecessary apache modules, type the following command</strong></p>
<pre># vi /etc/httpd/conf/httpd.conf</pre>
<p>My example configuration is here</p>
<pre>LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule env_module modules/mod_env.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule expires_module modules/mod_expires.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule mime_module modules/mod_mime.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule info_module modules/mod_info.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so</pre>
<p><strong>2. Optimize Timeout &amp; KeepAlive</strong><br />
You need to control Timeouts &amp; KeepAlive to improve server performance. Type the following command</p>
<pre># vi /etc/httpd/conf/httpd.conf</pre>
<p>Find &amp; Edit it as follows</p>
<pre>Timeout 10
KeepAlive On
MaxKeepAliveRequests 200
KeepAliveTimeout 5</pre>
<p><strong>3. Optimize MPM (Multi-Processing Module)</strong><br />
Apache&#8217;s default installation of MPM Prefork. To optimize MPM Prefork, type the following command</p>
<pre># vi /etc/httpd/conf/httpd.conf</pre>
<p>Find</p>
<pre>&lt;IfModule prefork.c&gt;</pre>
<p>Edit it as follows</p>
<pre>&lt;IfModule prefork.c&gt;
    StartServers          5
    MinSpareServers      10
    MaxSpareServers      15
    ServerLimit         450
    MaxClients          450
    MaxRequestsPerChild   0
&lt;/IfModule&gt;</pre>
<p>Which,</p>
<p># StartServers: number of server processes to start<br />
# MinSpareServers: minimum number of server processes which are kept spare<br />
# MaxSpareServers: maximum number of server processes which are kept spare<br />
# ServerLimit: maximum value for MaxClients for the lifetime of the server<br />
# MaxClients: maximum number of server processes allowed to start<br />
# MaxRequestsPerChild: maximum number of requests a server process serves</p>
<p><strong>4. Enable Mod_rewite</strong><br />
To enable mod_rewirte, type the following command</p>
<pre># vi /etc/httpd/conf/httpd.conf</pre>
<p>Find</p>
<pre>&lt;Directory "/var/www/html"&gt;</pre>
<p>Edit it as follows</p>
<pre>&lt;Directory "/var/www/html"&gt;
    AllowOverride All
    Options -MultiViews -Indexes FollowSymlinks IncludesNoExec +Includes
&lt;Limit GET POST OPTIONS PROPFIND&gt;
    Order allow,deny
    Allow from all
&lt;/Limit&gt;
&lt;LimitExcept GET POST OPTIONS PROPFIND&gt;
    Order deny,allow
    Deny from all
&lt;/LimitExcept&gt;
&lt;/Directory&gt;</pre>
<p><strong>5. Enable File Caching</strong><br />
Enabling file caching can greatly improve your site’s performance and speed. If you want to enable file caching, type the following command</p>
<pre># vi /etc/httpd/conf/httpd.conf</pre>
<p>Find</p>
<pre>&lt;Directory "/var/www/html"&gt;</pre>
<p>Edit it as follows</p>
<pre>&lt;Directory "/var/www/html"&gt;
    AllowOverride All
    Options -MultiViews -Indexes FollowSymlinks IncludesNoExec +Includes
&lt;Limit GET POST OPTIONS PROPFIND&gt;
    Order allow,deny
    Allow from all
&lt;/Limit&gt;
&lt;LimitExcept GET POST OPTIONS PROPFIND&gt;
    Order deny,allow
    Deny from all
&lt;/LimitExcept&gt;
&lt;FilesMatch "\.(flv|swf|ico|gif|jpg|jpeg|png|html|css)$"&gt;  
	Header set Cache-Control "max-age=604800, public"  
&lt;/FilesMatch&gt;
&lt;/Directory&gt;</pre>
<h2>4. Install and Configure MySQL Database Server</h2>
<p>MySQL Server is one of the most popular database servers in the world, especially for use with dynamic, content rich websites. To install MySQL database server use the following command</p>
<pre># yum install mysql mysql-server</pre>
<p>After installing MySQL, I highly recommend to run mysql_secure_installation, a program that helps secure MySQL. Important points to note are:<br />
1. Be sure that the root account has a secure password set.<br />
2. Do not create an anonymous account, and if it exists, say &#8220;yes&#8221; to remove it.<br />
3. If your web server and MySQL server are on the same machine, you should disable the network access.</p>
<p>If you want to run MySQL by default when the system boots, type the following command</p>
<pre># chkconfig mysqld--level 2345 on</pre>
<p>To start MySQL for the first time, type the following command</p>
<pre># /etc/init.d/mysqld start</pre>
<h2>5. Installing and Configuring PHP</h2>
<p>PHP is a general-purpose scripting language originally designed for web development to produce dynamic web pages. Many popular web applications like WordPress, Joomla, Drupal, OScommerce, Magento are written in PHP. To install PHP on CentOS use the following command</p>
<pre># yum install php53 php53-mysql</pre>
<p>To create secure PHP configuration settings, type the following command</p>
<pre>
# vi /etc/php.ini
</pre>
<p>Find &#038; Edit it as follows</p>
<pre>
allow_url_fopen = Off 
display_errors = Off 
display_startup_errors = Off 
log_errors = On 
error_reporting = E_ALL 
expose_php = Off 
magic_quotes_gpc = On 
magic_quotes_sybase = Off 
register_globals = Off
max_execution_time = 60
memory_limit = 64M
</pre>
<p>To prevent run PHP scripts with a different file extension, type the following command</p>
<pre># vi /etc/httpd/conf.d/php.conf</pre>
<p>Find</p>
<pre>
AddHandler php5-script .php
AddType text/html .php
</pre>
<p>Replace it as follows</p>
<pre>&lt;FilesMatch \.php$&gt;
	AddHandler php5-script .php
	AddType text/html .php
&lt;/FilesMatch&gt;</pre>
<p>Restart Apache to reload new configurations. Type the following command</p>
<pre># /etc/init.d/httpd restart</pre>
<g:plusone href="https://lifelinux.com/how-to-setup-a-lamp-server-on-centos-6-0/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-setup-a-lamp-server-on-centos-6-0/">How To Setup A LAMP Server On Centos 6.0</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/how-to-setup-a-lamp-server-on-centos-6-0/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
