Server Related Questions (44 Articles)

Leverage Browser Caching for Images, CSS and JS

To leverage your browser's caching generally means that you can specify how long browsers should keep images, CSS and JS stored locally. Of course, if you change any of those, the server will tell the visitor's browser to clear that cache. To enable it, add those lines to your .htaccess…

Enable gZIP via .htaccess

To enable gZIP compression for your text, html, JavaScript, CSS and XML add these files to your .htaccess: [crayon-58d6203670f5e495968136/] Note that for Staging instances on SiteGround GoGeek hosting plans, the compression is disabled by default and the .htaccess rules above will have no effect. The compression will function as expected when the website is pushed…

Last-modified Header Explained

The last-modified header is an HTTP header that tells your browser when was the last time the page you're loading has been modified. This helps your browser load cached pages that haven't been changed since your last visit faster. The last-modified header is used mostly by CMS applications that generate dynamic pages. Usually, if you're not making your own dynamic website, you shouldn't do anything about this…

How to change my document root folder using an .htaccess file?

By default your website is loaded from the public_html folder of your account. The public_html directory is also called web root folder or document root folder. If you've created a test website under a sub-folder and you want it to be displayed when you type your domain name, add the following lines to the .htaccess file in the public_html folder: RewriteEngine on RewriteCond %{HTTP_HOST} ^domain-name.com$ [NC,OR] RewriteCond %{HTTP_HOST} ^www.domain-name.com$ RewriteCond %{REQUEST_URI} !folder/ RewriteRule (.*) /folder/$1 [L] In the above lines you should replace the following 2 strings: domain-name.com - Type your own domain name folder - Type the name of the sub-folder which has the test/development website If there is no .htaccess file in the public_html folder you can easily create one using cPanel-> File Manager . Then, type your domain name in a browser and you should see the website which is in your test…

How to enable Mod_Gzip

Mod_Gzip is an external extension module for Apache 1.3 web servers implemented to help with size reduction of web pages served over HTTP. The alternative of mod_gzip for Apache 2 is called mod_deflate and it is enabled on all SiteGround shared servers. You can enable mod_deflate for your website directly from your cPanel > Optimize Website, or by adding the following lines to your .htaccess file: [crayon-58d6203671165493850602/] If you are still running an Apache 1.3 web server and you have mod_gzip installed and loaded in Apache's configuration, you can enable it by adding the following options in an .htaccess file for your hosting…

How to change the default umask for Apache/Php

Apache/Php umask determines the permissions for the newly created files. On a VPS / Dedicated server you can change the umask to suit your specific needs by editing: /usr/local/apache/bin/envvars There you should add: umask 022 Right after that restart Apache and Apache/Php's default umask will become 22. If you need a fully managed Dedicated server or VPS please check our dedicated hosting …

Which ports are open on SiteGround shared servers?

The following TCP ports are open on all SiteGround shared servers for outgoing connections: 21 – This is the default FTP port. 80 – This is the default HTTP port. 110 – This is the default POP3 port. 143 – This is the default IMAP port. 443 – This the default SSL port. 465 – This is the SMTP port over TLS/SSL. 993 – This is the IMAP port over TLS/SSL. 995 – This is the POP3 port over TLS/SSL 3306 – This is the default MySQL port. 5432 – This is the default PostgreSQL port. 30000 – This port is used by the Canada post shipping module, which is available for scripts like osCommerce and CreLoaded. The module establishes connection to the IP 66.110.6.131. There is no problem certain port to be opened per your request, for example required by game servers or shoutbox module. You can request this by posting a ticket through your SiteGround User's Area -> Support tab -> Request Assistance from our team -> Report Other Technical Issues. Include the destination IP for which you wish the port to be opened and the corresponding port number. Due to the SiteGround security policy, custom incoming ports can NOT be opened per customer request on our shared servers. If you need custom incoming ports opened, please consider an upgrade of your account to one of our Dedicated servers or Cloud solutions . There all the system resources will be solely reserved for your account and the server firewall will be altered per your…

Is SQLite supported?

SQLite is a software library which implements an SQL database engine. SQLite and PDO_SQLite are supported on all of our servers. SQLite can be used with PHP scripts through the SQLite PHP functions . You can check the SQLite and PDO_SQLite library versions using the phpinfo function. To do this, you should create a simple php file (for example phpinfo.php) with the following line in it: <?php phpinfo(); ?> Then you should open this file in a browser to see the full Apache/PHP information. The path to the file should be: yourdomainname.com/phpinfo.php The SQLite version is shown next to SQLite Library in the SQLite section of the file. Accordingly, the PDO_SQLite version is shown next to SQLite Library in the pdo_sqlite section of the…

Is it possible to have folders with 777 permissions?

Sometimes it is required that certain folders have 777 / 666 permissions in order for PHP scripts to be able to write inside them. This is especially true for cache / uploaded content folders. There is no problem to set the permissions of such folders to 777. However, if a PHP script has Write permissions for Group / Others , it will give an error because of our special PHP suEXEC setup.…

PCI Compliance

PCI is an abbreviation for Payment Card Industry . The  PCI DSS ( Payment Card Industry Data Security Standard ) is a security initiative created to offer service providers and merchants a unified approach towards safeguarding credit card holder information for all types of credit cards, preventing credit card fraud, cracking and various other security threats and vulnerabilities. PCI Compliance Requirements The PCI DSS has 12 general requirements, organized in 6 groups, also known as control objectives . The goal of these objectives is to: Build and Maintain a Secure Network; Protect Cardholder Data; Maintain a Vulnerability Management Program; Implement Strong Access Control Measures; Regularly Monitor and Test Networks; Maintain an Information Security Policy; You can download the complete PCI DSS documentation, which includes a thorough description of the PCI compliance requirements, from this URL . SiteGround's GoGeek hosting plans are by default PCI compliant and offer a safe and stable environment for online merchants and their businesses. Higher-end dedicated hosting solutions provided by SiteGround can also be made PCI compliant on…

How to change the timezone for my account?

You can change the timezone for your account or for a specific folder by adding this rule to your .htaccess file: SetEnv TZ Timezone For example, if you wish to change the timezone to America/New_York, you should add this line to your .htaccess file: SetEnv TZ America/New_York This way your scripts will use your local time instead of the server time. A full list of the available timezones can be found at this URL . Alternatively, you can use the PHP Variables Manager tool to set the  date.timezone  PHP variable to the one you…

What is the Apache timeout on the shared servers?

The Apache timeout on our shared servers is set to 30 seconds. Our experience shows that this is the best setting which ensures top overall server performance and at the same time offers enough resources for the hosted websites to run flawlessly. If, however, your website requires custom Apache settings and increased timeout, the best option is to use a dedicated solution. Our Dedicated Servers are the perfect solution for heavier websites demanding more resources.…

Is it possible to change the Apache timeout?

Unfortunately, it is not possible to change the Apache timeout on a shared server. By default it has been set for best performance. Changing the Apache timeout is possible only on our Cloud Hosting and on our Dedicated Servers…

What is the path to ImageMagick?

All ImageMagick (alternative spellings ImageMagic , ImageMagik ) binaries are located in: /usr/bin/ The path to ImageMagick's most popular binary ' convert ' is: /usr/bin/convert The above is valid for most modern Linux distributions.…

How to find out which perl modules are installed?

If you are a SiteGround customer, you can easily find all the Perl modules installed on your server. For this purpose you have to go to: https://mydomain.com/cpanel/frontend/Crystal/perlmodules.html The above will log you in your cPanel and all the Perl modules with their versions will be listed. Note that you should substitute mydomain.com with your domain. Anyone else can find the available Perl modules by typing "instmodsh" in a Linux shell. This is an interactive Perl script which has the option "l" to show the available Perl modules. …

How to change the default webserver charset

You can change the default webserver character set by adding a custom rule in your .htaccess file. The rule should contain the actual rule - AddDefaultCharset , followed by the charset you wish to use. For example, if you are having problems with pages which have text in Cyrillic, you can add this rule to your .htaccess file: AddDefaultCharset windows-1251 Please note that this will change the default charset recursively for all folders. This means that if you put this rule in a .htaccess file in your main public_html folder, the default charset for all your files and subfolders will be set to the one defined in the rule. This will not resolve charset issues if the text is in a database. More information on how to change the charset collation in a database can be found in this article . …

Is it possible to set Apache’s AllowOverride directive to All

The AllowOverride directive in the Apache's configuration has been set to ‘All’ on all Siteground servers. Thus you are able to use a local .htaccess file and define options such as: #Enable mod_rewrite and insert some sample rules: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d #RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR]         ##optional - see notes## RewriteCond %{REQUEST_URI} (/|.htm|.php|.html|/[^.]*)$  [NC] RewriteRule ^(content/|component/) index.php #Enable security mod: SecFilterEngine On SecFilterScanPOST On # SecAuditLog logs/audit_log # Not sure what my host would think of that... SecFilterDefaultAction "deny,status:412" # WEB-ATTACKS wget command attempt SecFilterSelective THE_REQUEST "wget " #Set different handlers for scripts: AddHandler nonworkig .cgi .pl .py Note: Please do not use an .htaccess file to specify PHP settings. PHP settings can be changed only with a local php.ini file. …