<?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>Protect &#8211; Hostry Help Center</title>
	<atom:link href="https://help.hostry.com/article-tags/protect/feed/" rel="self" type="application/rss+xml" />
	<link>https://help.hostry.com</link>
	<description>Full information on how to use HOSTRY, provided by 24/7 community based support</description>
	<lastBuildDate>Thu, 29 Aug 2019 12:41:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9.12</generator>

<image>
	<url>https://help.hostry.com/wp-content/uploads/cache/2021/01/cropped-apple-icon-180x180-1/836712163.png</url>
	<title>Protect &#8211; Hostry Help Center</title>
	<link>https://help.hostry.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How To Protect Apache Web Server on CentOS 7</title>
		<link>https://help.hostry.com/knowledge-base/how-to-protect-apache-web-server-on-centos-7/</link>
					<comments>https://help.hostry.com/knowledge-base/how-to-protect-apache-web-server-on-centos-7/#respond</comments>
		
		<dc:creator><![CDATA[Alex]]></dc:creator>
		<pubDate>Thu, 29 Aug 2019 12:41:21 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=603</guid>

					<description><![CDATA[In case, when an attacker gets access to your server, you may lose all data. If at the initial stage you use simple installations, you still need to secure your server. Install Web Server The first thing we offer you is installing a web server yum install httpd php Personal [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>In case, when an attacker gets access to your server, you may lose all data. If at the initial stage you use simple installations, you still need to secure your server.</p>



<h2 id="install-web-server" >Install Web Server</h2>



<p>The first thing we offer you is installing a web server</p>



<p><code>yum install httpd php</code></p>



<h2 id="personal-home-directory-protection" >Personal Home Directory Protection</h2>



<p>The following is protection for your home directories. The first thing to understand is that the directories of other users are classified and not visible to anyone, except for the owners, respectively. </p>



<p>We suggest you change all directories to 700; this is to ensure that only the appropriate home directory owners can view their own files</p>



<pre class="wp-block-code"><code>chmod 700 /home
chmod 700 /home/*
chmod 700 /home/*/*</code></pre>



<h2 id="apply-security-patch-for-the-apache-to-split-user-privileges" >Apply security patch for the Apache to split user privileges</h2>



<p>The first thing to learn we need to first install the repository containing the package with the patch. Run the following commands as root or sudo</p>



<pre class="wp-block-code"><code>yum install epel-release
yum install httpd-itk</code></pre>



<p>Through “<strong>apache2-mpm-itk</strong>” we can see which PHP user should run depending on the virtual host. It adds a new extension in the configuration of <strong><em>AssignUserId virtualhost-user virtualhost-user-group</em></strong>, which allows Apache / PHP to execute user code under a specific user account.</p>



<h2 id="%d1%81reate-a-virtual-host" >Сreate a virtual host </h2>



<p></p>



<p>To<strong> create a virtual host </strong>in Apache, you can follow this example, which is presented below (for example, taken example.com)</p>



<p></p>



<pre class="wp-block-code"><code>NameVirtualHost example.com

&lt;VirtualHost example.com>

DocumentRoot /home/vhost-user/public_html
ServerName example.com
&lt;/VirtualHost></code></pre>



<p>Next, open the text editor <strong>/etc/httpd/conf.d/example-virtualhost.conf</strong> and add the contents above. Here is the command to use nano:</p>



<p><code>nano /etc/httpd/conf.d/example-virtualhost.conf </code></p>



<h2 id="configure-apache-web-server-to-run-as-another-user" >Configure Apache Web Server to run as another user</h2>



<p>After  launched the protection of the Apache / PHP server, the following should be added:</p>



<pre class="wp-block-code"><code>AssignUserId vhost-user vhost-user-group</code></pre>



<p>This will look like an example of a virtual host, after the option is added:</p>



<pre class="wp-block-code"><code>NameVirtualHost example.com

&lt;VirtualHost example.com>

DocumentRoot /home/vhost-user/public_html
ServerName example.com
AssignUserId vhost-user vhost-user-group

&lt;/VirtualHost></code></pre>



<p>Next, you need to Hide the version of Apache. To do this, enter the command:</p>



<pre class="wp-block-code"><code>nano /etc/httpd/conf/httpd.conf</code></pre>



<p>Then in the line “<strong>ServerTokens</strong>” change the parameter after it to “<strong>ProductOnly</strong>”. This tell to Apache only to show that it is “<strong>Apache</strong>” and not “<strong>Apache / 2.2</strong>” or something like that</p>



<p></p>



<p>At the end, restart the Apache server</p>



<pre class="wp-block-code"><code>service httpd restart</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-to-protect-apache-web-server-on-centos-7/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
