<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Donmcg</id>
	<title>Joomla! Documentation - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Donmcg"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Donmcg"/>
	<updated>2026-08-09T05:17:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Applying_custom_module_chrome&amp;diff=635113</id>
		<title>Applying custom module chrome</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Applying_custom_module_chrome&amp;diff=635113"/>
		<updated>2019-10-19T05:44:50Z</updated>

		<summary type="html">&lt;p&gt;Donmcg: removed exclamation mark, falsely indicating end of a sentence.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;==Applying custom Module chrome==&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
To define custom Module chrome in your template you need to create a file called modules.php in your template html directory.  For example, this might be PATH_TO_JOOMLA/templates/TEMPLATE_NAME/html/modules.php.&lt;br /&gt;
&lt;br /&gt;
In this file you should define a function called &amp;lt;code&amp;gt;modChrome_STYLE&amp;lt;/code&amp;gt; where &#039;&amp;lt;code&amp;gt;STYLE&amp;lt;/code&amp;gt;&#039; is the name of your custom Module chrome.  This function will take three arguments, &amp;lt;code&amp;gt;$module&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;$params&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;&amp;amp;$attribs&amp;lt;/code&amp;gt;, as shown:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php &lt;br /&gt;
  function modChrome_STYLE( $module, &amp;amp;$params, &amp;amp;$attribs ) &lt;br /&gt;
  {&lt;br /&gt;
    /* chromed Module output goes here */&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within this function you can make use of any of the available Module properties (i.e. the fields in the &amp;lt;code&amp;gt;jos_modules&amp;lt;/code&amp;gt; table in the Joomla database on your server) for that Module, but the main ones you are likely to need are &amp;lt;code&amp;gt;$module-&amp;gt;content&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;$module-&amp;gt;showtitle&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$module-&amp;gt;title&amp;lt;/code&amp;gt;.  &amp;lt;code&amp;gt;$module-&amp;gt;showtitle&amp;lt;/code&amp;gt; is a Boolean variable, so is either &#039;&#039;true&#039;&#039; (when the Module title &#039;&#039;&#039;should&#039;&#039;&#039; be shown) or &#039;&#039;false&#039;&#039; (when it &#039;&#039;&#039;shouldn&#039;t&#039;&#039;&#039; be shown). &amp;lt;code&amp;gt;$module-&amp;gt;content&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$module-&amp;gt;title&amp;lt;/code&amp;gt; will return the main Module content and the Module title respectively.&lt;br /&gt;
&lt;br /&gt;
The function is a normal PHP function and so can use any regular PHP code.  One common example is to use an &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt; statement to check the value of &amp;lt;code&amp;gt;$module-&amp;gt;showtitle&amp;lt;/code&amp;gt;, and then include the title or not accordingly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  if ($module-&amp;gt;showtitle) &lt;br /&gt;
  {&lt;br /&gt;
    echo &#039;&amp;lt;h2&amp;gt;&#039; .$module-&amp;gt;title .&#039;&amp;lt;/h2&amp;gt;&#039;;&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Module parameters are accessed using the &amp;lt;code&amp;gt;$params&amp;lt;/code&amp;gt; object.  For example, it is possible to assign a &#039;&#039;Module class suffix&#039;&#039; to a Module in the backend of your Joomla! site; this is then stored in the parameters for that Module as &amp;lt;code&amp;gt;moduleclass_sfx&amp;lt;/code&amp;gt;.  To create a &amp;lt;code&amp;gt;&amp;amp;lt;div&amp;amp;gt;&amp;lt;/code&amp;gt; with  a &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; determined by the Module class suffix, you would use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;&amp;lt;?php echo $params-&amp;gt;get( &#039;moduleclass_sfx&#039; ); ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- div contents --&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Custom chrome attributes ===&lt;br /&gt;
It is also possible to pass further attributes into the Module chrome function using the same &amp;lt;code&amp;gt;&amp;lt;jdoc:include /&amp;gt;&amp;lt;/code&amp;gt; statement that sets the Module chrome. These additional attributes can be anything you like, and are stored in the &amp;lt;code&amp;gt;$attribs&amp;lt;/code&amp;gt; array.  Take the following example Module chrome function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  function modChrome_custom( $module, &amp;amp;$params, &amp;amp;$attribs ) {&lt;br /&gt;
    if (isset( $attribs[&#039;headerLevel&#039;] )) &lt;br /&gt;
    {&lt;br /&gt;
      $headerLevel = $attribs[&#039;headerLevel&#039;];&lt;br /&gt;
    } else {&lt;br /&gt;
      $headerLevel = 3;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (isset( $attribs[&#039;background&#039;] )) &lt;br /&gt;
    {&lt;br /&gt;
      $background = $attribs[&#039;background&#039;];&lt;br /&gt;
    } else {&lt;br /&gt;
      $background = &#039;blue&#039;;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    echo &#039;&amp;lt;div class=&amp;quot;&#039; .$params-&amp;gt;get( &#039;moduleclass_sfx&#039; ) .&#039;&amp;quot; &amp;gt;&#039;;&lt;br /&gt;
&lt;br /&gt;
    if ($module-&amp;gt;showtitle) &lt;br /&gt;
    {&lt;br /&gt;
      echo &#039;&amp;lt;h&#039; .$headerLevel .&#039;&amp;gt;&#039; .$module-&amp;gt;title .&#039;&amp;lt;/h&#039; .$headerLevel .&#039;&amp;gt;&#039;;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    echo &#039;&amp;lt;div class=&amp;quot;&#039; .$background .&#039;&amp;quot;&amp;gt;&#039;;&lt;br /&gt;
    echo $module-&amp;gt;content;&lt;br /&gt;
    echo &#039;&amp;lt;/div&amp;gt;&#039;;&lt;br /&gt;
&lt;br /&gt;
    echo &#039;&amp;lt;/div&amp;gt;&#039;;&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You would then set the values for &amp;lt;code&amp;gt;background&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;headerLevel&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;&amp;lt;jdoc:include /&amp;gt;&amp;lt;/code&amp;gt; statement as shown below.  If no values are set, the attributes default to &#039;blue&#039; and &#039;3&#039; respectively.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Passing attributes to Module chrome from &amp;lt;code&amp;gt;&amp;lt;jdoc:include /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
! &amp;lt;code&amp;gt;&amp;lt;jdoc:include /&amp;gt;&amp;lt;/code&amp;gt; statement&lt;br /&gt;
! Output&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;custom&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;&amp;lt;!-- Module title --&amp;gt;&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;div class=&amp;quot;blue&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Module content --&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;custom&amp;quot; background=&amp;quot;green&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;h3&amp;gt;&amp;lt;!-- Module title --&amp;gt;&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;div class=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Module content --&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;user1&amp;quot; style=&amp;quot;custom&amp;quot; headerLevel=&amp;quot;1&amp;quot; background=&amp;quot;yellow&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;h1&amp;gt;&amp;lt;!-- Module title --&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;div class=&amp;quot;yellow&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Module content --&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Further information about passing attributes to Module chrome can be found in [[jtopic:115953]].&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Advanced]]&lt;br /&gt;
[[Category:Modules]]&lt;br /&gt;
[[Category:Template Development]]&lt;br /&gt;
[[Category:Template Reference]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Donmcg</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Security_Checklist/Hosting_and_Server_Setup&amp;diff=635065</id>
		<title>Security Checklist/Hosting and Server Setup</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Security_Checklist/Hosting_and_Server_Setup&amp;diff=635065"/>
		<updated>2019-10-19T03:19:26Z</updated>

		<summary type="html">&lt;p&gt;Donmcg: Grammar improvement on first sentence.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{:Security Checklist/TOC}}&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Choose a Qualified Hosting Provider == &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===The most important decision=== &amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt; Probably no decision is more critical to site security than the choice of hosts and servers. However, due to the wide variety of hosting options and configurations, it&#039;s not possible to provide a complete list for all situations. Check this [https://resources.joomla.org/en/category/hosting-providers list of hosts] who meet the security requirements of a typical Joomla site. ([[S:MyLanguage/Security_and_Performance_FAQs#How_do_I_choose_a_quality_hosting_provider.3F|FAQ]])&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===Shared server risks=== &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt; If you are on a tight budget and your site does not process highly confidential data, you can probably get by with a shared server, but you must understand the unavoidable risks. Most of the tips listed below are appropriate for securing sites on shared server environments.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==Configuring Apache== &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===Use Apache .htaccess=== &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&#039;&#039;&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt; See also [[S:MyLanguage/htaccess examples (security)|.htaccess examples]]&amp;lt;/translate&amp;gt;&#039;&#039;&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt; Block typical exploit attempts with local Apache &#039;&#039;.htaccess&#039;&#039; files. This option is not enabled on all servers. Check with your host if you run into problems. Using &#039;&#039;.htaccess&#039;&#039;, you can password protect sensitive directories, such as administrator, restrict access to sensitive directories by IP Address, and depending on your server&#039;s configuration, you may be able to increase security by switching  to PHP7.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt; Joomla ships with a [[S:MyLanguage/Preconfigured htaccess|preconfigured .htaccess]] file, but *you* need to choose to use it. The file is called htaccess.txt. To use it, rename it to .htaccess and place it in the root of your site using FTP. One important point to note is that as the distributed file is called htaccess.txt and the live file on your site is called .htaccess, the file your site actually uses is NOT updated when you update your site to use to a new version of Joomla. You must manually make the changes to use the new file version.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt; Consider following the &amp;quot;Least Privilege&amp;quot; principle for running PHP using tools such as PHPsuExec, php_suexec or suPHP. (Note: These are advanced methods that require agreement and coordination with your hosting provider. Such options are enabled or disabled on a server-wide basis and are not individually adjustable on shared servers.)&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt; Consider using a serverside filtering solution like Apache mod_security - a great starting point is the OWASP ModSecurity&amp;lt;/translate&amp;gt; [https://coreruleset.org/ CoreRuleSet]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===PHP Being Run as an Apache Module=== &amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt; This causes ownership issues and thus permission problems which will lead to security issues. It is better to select a server setup/host that runs php as a cgi process (such as cgi-fcgi) along with using phpSuExec or a similar configuration.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt; The two best tutorials and explanations on permissions, ownerships and their relations are from this official Joomla doc page:&amp;lt;/translate&amp;gt;&lt;br /&gt;
*[[S:MyLanguage/Where can you learn more about file permissions?|&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt; File Permissions&amp;lt;/translate&amp;gt;]] &lt;br /&gt;
*&amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt; [[S:MyLanguage/Why_can&#039;t_you_install_any_extensions%3F#File_ownership_advice_from_ianmac|File ownership advice]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt; Specific topics to read would be the following two:&amp;lt;/translate&amp;gt;&lt;br /&gt;
*[[S:MyLanguage/How do UNIX file permissions work?|&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt; Unix Permissions Primer&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt; And for information on phpSuExec and similar implementations:&amp;lt;/translate&amp;gt;&lt;br /&gt;
*[[S:MyLanguage/Using phpSuExec|&amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt; Using phpSuExec&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===Use Apache mod_security=== &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt; Configure Apache mod_security and mod_rewrite filters to block PHP attacks. See [https://www.google.com/search?q=apache%20mod_security Google search for mod_security] and [https://www.google.com/search?q=apache%20mod_rewrite Google search for mod_rewrite]. (Note: These are advanced methods that usually require agreement and coordination with your hosting provider. Such options are enabled or disabled on a server-wide basis and are not individually adjustable on shared servers.)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==Configuring MySQL== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===Secure the database=== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt; Be sure MySQL accounts are set with limited access. The initial install of MySQL is insecure and careful configuration is required. (See the [http://dev.mysql.com/doc/ MySQL Manuals]) Note: This item applies only to those administering their own servers, such as dedicated servers. Users of shared servers are dependent on their hosting provider to set proper database security.)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Configuring PHP== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===Understand how PHP works=== &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt; Understand how to work with the php.ini file, and how PHP configurations are controlled. Study the [http://us3.php.net/manual/en/ini.php#ini.list Official List of php.ini Directives] at http://www.php.net, and the well-documented default php.ini file included with every PHP install.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===Use PHP7=== &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:31--&amp;gt; PHP versions become deprecated and some have become obsolete. Some hosting providers still have several available on servers to support outdated scripts. Joomla should be using PHP7.x. (See [https://downloads.joomla.org/technical-requirements Joomla Requirements])&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Use local php.ini files=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:33--&amp;gt; On shared servers you can&#039;t edit the main php.ini file, but you may be able to add custom, local php.ini files. If so, you&#039;ll need to copy the php.ini files to every sub-directory that requires custom settings.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;&amp;lt;translate&amp;gt;&amp;lt;!--T:34--&amp;gt; There are a few important things to keep in mind.&amp;lt;/translate&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;translate&amp;gt;&amp;lt;!--T:35--&amp;gt; Local &#039;&#039;php.ini&#039;&#039; files &#039;&#039;&#039;&#039;&#039;only&#039;&#039;&#039;&#039;&#039; have an effect if your server is configured to use them. This includes a &#039;&#039;php.ini&#039;&#039; file in your &#039;&#039;http_root&#039;&#039; directory. You can test whether or not these file affect your site by setting an obvious directive in the local &#039;&#039;php.ini&#039;&#039; file to see if it affects your site.&amp;lt;/translate&amp;gt;&lt;br /&gt;
# &amp;lt;translate&amp;gt;&amp;lt;!--T:36--&amp;gt; Local &#039;&#039;php.ini&#039;&#039; files only affect &#039;&#039;.php&#039;&#039; files that are located within the same directory (or included() or required() from those files). This means that there are normally only two Joomla! directories in which you would want to place a &#039;&#039;php.ini&#039;&#039; file. They are your &#039;&#039;http_root&#039;&#039;(your actual directory name may vary), which is where Joomla&#039;s Front-end &#039;&#039;index.php&#039;&#039; file is located, and the Joomla! &#039;&#039;administrator&#039;&#039; directory, which is where the backend administrator &#039;&#039;index.php&#039;&#039; file is located. Other directories that don&#039;t have files called via the Web do not need local &#039;&#039;php.ini&#039;&#039; files.&amp;lt;/translate&amp;gt;&lt;br /&gt;
# &amp;lt;translate&amp;gt;&amp;lt;!--T:37--&amp;gt; If you have a &#039;&#039;php.ini&#039;&#039; file in every directory, some script probably did this for you. If you didn&#039;t intend it to happen, you probably should root them out, but given #2 above, you probably only have to panic about the &#039;&#039;php.ini&#039;&#039; files in &#039;&#039;http_root&#039;&#039; and the &#039;&#039;administrator&#039;&#039; directories.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===Use PHP disable_functions=== &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:39--&amp;gt; Use &#039;&#039;disable_functions&#039;&#039; to disable dangerous PHP functions that are not needed by your site. Here is a typical setup for a Joomla! site:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      disable_functions = show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===Consider Using PHP open_basedir=== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:41--&amp;gt; You &#039;&#039;might&#039;&#039; consider enabling &#039;&#039;open_basedir&#039;&#039;.  This directive limits the files that can be opened by PHP to the specified directory-tree. This directive is NOT affected by whether Safe Mode is ON or OFF.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:42--&amp;gt; The restriction specified with open_basedir is a prefix, not a directory name. This means that &#039;&#039;open_basedir = /dir/incl&#039;&#039; allows access to &#039;&#039;/dir/include&#039;&#039; and &#039;&#039;/dir/incls&#039;&#039; if they exist. To restrict access to only the specified directory, end with a slash. For more information, see [http://us3.php.net/manual/en/features.safe-mode.php#ini.safe-mode PHP Security and Safe Mode Configuration Directives].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     open_basedir = /home/users/you/public_html&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:43--&amp;gt; Additionally, if &#039;&#039;open_basedir&#039;&#039; is set it may be necessary to set PHP &#039;&#039;upload_tmp_dir&#039;&#039; configuration directive to a path that falls within the scope of &#039;&#039;open_basedir&#039;&#039; or, alternatively, add the &#039;&#039;upload_tmp_dir&#039;&#039; path to &#039;&#039;open_basedir&#039;&#039; using the appropriate path separator for the host system.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     open_basedir = /home/users/you/public_html:/tmp&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:44--&amp;gt; PHP will use the system&#039;s temporary directory when &#039;&#039;upload_tmp_dir&#039;&#039; is not set or when it is set but the directory does not exist, therefore it may be necessary to add it to &#039;&#039;open_basedir&#039;&#039; as above to avoid uploading errors within Joomla.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===Adjust magic_quotes_gpc=== &amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
: &#039;&#039;&#039; &amp;lt;small&amp;gt;&#039;&#039;&amp;lt;translate&amp;gt;&amp;lt;!--T:46--&amp;gt; This PHP feature has been depreciated as of PHP 5.3.0 (30-06-2009) and has been removed from php as of PHP 5.4.0.&amp;lt;/translate&amp;gt;&#039;&#039;&amp;lt;/small&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:47--&amp;gt; Adjust the &#039;&#039;magic_quotes_gpc&#039;&#039; directive as needed for your site.&amp;lt;/translate&amp;gt;&lt;br /&gt;
*&amp;lt;translate&amp;gt;&amp;lt;!--T:48--&amp;gt; Joomla! 3.0 and above &#039;&#039;&#039;requires&#039;&#039;&#039; &#039;&#039;magic_quotes_gpc&#039;&#039; to be set to off and will not install if &#039;&#039;magic_quotes_gpc&#039;&#039; is on.&amp;lt;/translate&amp;gt; &lt;br /&gt;
*&amp;lt;translate&amp;gt;&amp;lt;!--T:49--&amp;gt; Joomla! advises &#039;&#039;magic_quotes_gpc&#039;&#039; to be set to off when using Joomla 2.5.xx.&amp;lt;/translate&amp;gt;&lt;br /&gt;
*&amp;lt;translate&amp;gt;&amp;lt;!--T:50--&amp;gt; Joomla! 1.5 ignores the magic_quotes setting and works fine either way. The safest method is to turn magic_quotes_gpc off and avoid all poorly-written extensions.&amp;lt;/translate&amp;gt;&lt;br /&gt;
*&amp;lt;translate&amp;gt;&amp;lt;!--T:51--&amp;gt; The recommended settings for Joomla! 1.0.x is ON to protect against poorly-written third-party extensions.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:52--&amp;gt; For more information, see either [[S:MyLanguage/Magic quotes and security|Magic quotes and security]] or [http://php.net/magic_quotes PHP Manual, Chapter 31. Magic Quotes].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 to turn off    magic_quotes_gpc = 0&lt;br /&gt;
 to turn on     magic_quotes_gpc = 1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===Don&#039;t use PHP safe_mode=== &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
: &#039;&#039;&#039; &amp;lt;small&amp;gt;&#039;&#039;&amp;lt;translate&amp;gt;&amp;lt;!--T:54--&amp;gt; This PHP feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0&amp;lt;/translate&amp;gt;&#039;&#039;&amp;lt;/small&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:55--&amp;gt; Relying on this feature is highly discouraged. Avoid the use of PHP safe_mode. This was an attempt to solve shared security problems and provides a false sense of security.  Safe mode can also cause ownership problems with applications and any files created by the applications. See the official PHP site for more information. [http://php.net/manual/en/features.safe-mode.php PHP Manual: Safe Mode]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      safe_mode = 0&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===Don&#039;t use PHP register_globals=== &amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
: &#039;&#039;&#039; &amp;lt;small&amp;gt;&#039;&#039;&amp;lt;translate&amp;gt;&amp;lt;!--T:57--&amp;gt; This PHP feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0&amp;lt;/translate&amp;gt;&#039;&#039;&amp;lt;/small&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:58--&amp;gt; Automatically registering global variables was probably one of the dumbest decisions the developers of PHP made. This directive determines whether or not to register the EGPCS (Environment, GET, POST, Cookie, Server) variables as global variables where they become immediately available to all PHP scripts, and where they can easily overwrite your own variable if you&#039;re not careful. Luckily, the PHP developers long since realized the mistake and have deprecated this &#039;feature&#039;.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:59--&amp;gt; If your site is on a shared server with a hosting provider that insists &#039;&#039;register_globals&#039;&#039; must be on, you should be very worried. Although you can often turn register_globals off for your own site with a local php.ini file, this adds little security as other sites on the same server remain vulnerable to attacks which can then launch attacks against your site from within the server.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:60--&amp;gt; For more information, see [http://php.net/manual/en/security.globals.php PHP Manual: Using Register Globals].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      register_globals = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===Don&#039;t use PHP allow_url_include=== &amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:62--&amp;gt; Do not use PHP &#039;&#039;allow_url_include&#039;&#039;. This PHP option allows a programmer to include a remote file using an URL rather than a local file path. This is insecure. If an application (or extension) can be tricked into including content from a URL outside itself, an attacker could force the application (or extension) to start running code from their own web site. If an application or extension claims to require this feature to function, you should look into alternatives, as a requirement to use of this feature indicates serious design flaws within the application or extension.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Use allow_url_fopen === &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:64--&amp;gt; This option enables the URL-aware fopen wrappers that enable accessing URL object like files. Default wrappers are provided for the access of remote files using the ftp or http protocol, some extensions like zlib may register additional wrappers. Note: This can only be set in php.ini due to security reasons. &#039;&#039;&#039;Enable and use allow_url_fopen to allow Joomla&#039;s One-Click-Update to work properly.&#039;&#039;&#039;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:65--&amp;gt; For more information see: [http://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen PHP Manual: allow_url_fopen and allow_url_include]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Proper setup will have this:&lt;br /&gt;
                 allow_url_fopen = 1&lt;br /&gt;
               allow_url_include = 0&lt;br /&gt;
   &lt;br /&gt;
    PHP default: allow_url_fopen is enabled&lt;br /&gt;
    PHP default: allow_url_include is disabled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== File permissions == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:67--&amp;gt; If a Joomla installation is hosted on Apache with mod_php, then all virtual hosts on that server run in the same context as your joomla code.  If the files are owned by some other user than &#039;nobody&#039; or &#039;wwwrun&#039;, the safest permissions are those which &#039;&#039;&#039;prevent&#039;&#039;&#039; changes to the joomla code, unless via an authorised channel (e.g. FTP:&amp;lt;/translate&amp;gt;&lt;br /&gt;
*&amp;lt;translate&amp;gt;&amp;lt;!--T:68--&amp;gt; DocumentRoot directory: 750 (e.g. public_html)&amp;lt;/translate&amp;gt;&lt;br /&gt;
*&amp;lt;translate&amp;gt;&amp;lt;!--T:69--&amp;gt; Files: 644&amp;lt;/translate&amp;gt;&lt;br /&gt;
*&amp;lt;translate&amp;gt;&amp;lt;!--T:70--&amp;gt; Directories: 755 (711 if you are paranoid, but not for directories which need to be listed) (owner: some user)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:71--&amp;gt; With these permissions set, you will need to use FTP to update your Joomla installation.  Not all modules support this.  Remove modules which do not support FTP upgrades&amp;lt;/translate&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:72--&amp;gt; Other processes running under mod_php can read &#039;&#039;&#039;your&#039;&#039;&#039; configuration.php.  You can frustrate automated hacks by renaming this file.  You should not store your FTP password in your configuration file on such hosts, as your account &#039;&#039;will&#039;&#039; be compromised.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:73--&amp;gt; If a Joomla installation is hosted on Apache with fast-cgi, suphp or cgi that runs as a different user, then you should set your permissions as follows:&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &amp;lt;translate&amp;gt;&amp;lt;!--T:74--&amp;gt; DocumentRoot directory: 750 (e.g. public_html)&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &amp;lt;translate&amp;gt;&amp;lt;!--T:75--&amp;gt; PHP files: 600 (400 if you are truly paranoid)&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &amp;lt;translate&amp;gt;&amp;lt;!--T:76--&amp;gt; HTML and image files: 644 (444 if you are truly paranoid)&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &amp;lt;translate&amp;gt;&amp;lt;!--T:77--&amp;gt; Directories: 755 (711 if you are paranoid, but not for directories which need to be listed)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:78--&amp;gt; &#039;&#039;&#039;If&#039;&#039;&#039; the server your are on requires 777 permissions for Joomla to work correctly, then &#039;&#039;&#039;request to be put on another server&#039;&#039;&#039; with php as cgi and suphp and up-to-date serverside software (apache, php etc) on your existing host or find another server host if necessary.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:79--&amp;gt; Do check with your hosting provider to see if they have purposely secured the server your site is on; and that they or you perform regular (weekly) security updates to keep the server up to date. Check you have jail shell. A rule of thumb is the less you pay, the less they care.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:80--&amp;gt; More information on file permissions can be found here: [[S:MyLanguage/Security Checklist/Where can you learn more about file permissions?|File permissions]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==Setup a backup and recovery process== &amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===The most important rule=== &amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:83--&amp;gt; You should at all time be able to return your site to a previous working state through regular use of a strong, off-site backup and recovery process. Be sure your backup and recovery process is in place and tested BEFORE you go live. This is the single best way (and often the only way) to recover from such inevitable catastrophes as:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#&amp;lt;translate&amp;gt;&amp;lt;!--T:84--&amp;gt; Broken site due to a faulty upgrade.&amp;lt;/translate&amp;gt;&lt;br /&gt;
#&amp;lt;translate&amp;gt;&amp;lt;!--T:85--&amp;gt; Hardware failure, such as dead hard drives, power failures, server theft, etc.&amp;lt;/translate&amp;gt;&lt;br /&gt;
#&amp;lt;translate&amp;gt;&amp;lt;!--T:86--&amp;gt; Authoritarian government intervention. (More common than some think.)&amp;lt;/translate&amp;gt;&lt;br /&gt;
#Ne&amp;lt;translate&amp;gt;&amp;lt;!--T:87--&amp;gt; eding to quickly relocate to a new server or hosting provider.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;translate&amp;gt;&amp;lt;!--T:88--&amp;gt; Backups are not recommended for restoring a compromised/hacked site as it is possible the backups will contain the altered and hack files. Using the backups to restore a hacked site would just restore the hack to the site.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Security Checklist{{#translation:}}]]&lt;br /&gt;
[[Category:Server configurations{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Donmcg</name></author>
	</entry>
</feed>