Using this Options directive controls we can set server features for a particular directory.
Options can be set to None, in which case none of the extra features are enabled.
All :
All options except for MultiViews. (Default Settings).
ExecCGI :
Execution of CGI scripts using mod_cgi is permitted.
FollowSymLinks :
The server will follow symbolic links in this directory.
Includes :
Server-side includes [...]
SSI (Server Side Includes) are directives that are placed in HTML pages, and evaluated on the server while the pages are being served. Its use to add dynamically generated content to an existing HTML page.
SSI configurations
We must have mod_include module installed and enabled on apache. Also need to have the following directive either in [...]
SSL Certificates:
Normally data is sent unencrypted over Internet, which means anybody with certain tools can hack all your data. To pervent this from happening SSL (Secure Socket Layer) is used to encrypt the data stream between the Web Server and the Web Client.
Types:
* Self Signed Certificate
* Certificate issued by a trusted Certificate Authority(CA)
Why [...]
If you receive the following error,
Invalid command ‘BytesLog’, perhaps mis-spelled or defined by a module not included in the server configuration
while restarting apache in cPanel servers , do the following steps.
# cd /usr/local/cpanel/apache
# /usr/local/apache/bin/apxs -iac mod_log_bytes.c
# /etc/rc.d/init.d/httpd restart
It will install the missing module and restart apache
Sometimes apache will fail to start. It will show the following error message in apache error logs:
Unable to open logs
This is because of the low number of file descriptors. Check the current limit of file descriptors in the file /proc/sys/fs/file-max:
# cat /proc/sys/fs/file-max
1024
If fs.file-max is quite small (several thousands or so), it should be changed to [...]
To hide the information, add the following two apache directives in Apache configuration file /etc/httpd/conf/httpd.conf
ServerTokens ProductOnly
ServerSignature Off
Now you need to restart your web server using the following command
#/etc/init.d/httpd restart
The ServerSignature appears on the bottom of pages generated by apache such as 404 pages, directory listings, etc.
The ServerTokens directive is used to determine what Apache [...]
grep average /var/log/dcpumon/toplog.*
- This command will display the load that has been in the server.
root@server]# grep average /var/log/dcpumon/toplog.*
/var/log/dcpumon/toplog.1232442601:top - 04:10:01 up 1 day, 10:31, 2 users, load average: 3.69, 3.21, 2.34
/var/log/dcpumon/toplog.1232442601:top - 04:10:04 up 1 day, 10:31, 2 users, load average: 4.27, 3.34, 2.39
/var/log/dcpumon/toplog.1232442901:top - 04:15:03 up 1 day, 10:36, [...]
Prerequisites
* mod_rewrite must be loaded
* AllowOverride must be enabled
* FollowSymLinks must be enabled
For the sake of this example, we will assume that your website url is www.yourdomain.com, the file that is being hotlinked is widget.png, and the web page where the hotlinking is coming from is ebay.com (very common).
The Solution: using mod_rewrite and .htaccess to [...]
To redirect a single page
Redirect 301 /oldpage.html http://www.example.com/newpage.html
To redirect the entire site to another domain.
Redirect 301 / http://www.example.com/
Redirect www.example.com to example.com
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^example\.com
RewriteRule (.*) http://example.com/$1 [R=301,L]
Redirect example.com to www.example.com
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite.com [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]
Redirect example.com/index.php to example.com/
Options +FollowSymLinks
RewriteEngine on
# index.php to /
RewriteCond %{THE_REQUEST} ^[A-Z]{3, 9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ [...]
Apache PHP Request Handling
To make the things simple PHP configuration for Apache has been broken out into a separate file that is included into the main httpd.conf. The file is located at
/usr/local/apache/conf/php.conf
WHM that assists with configuration of how PHP is served by Apache. It is located under “Service Configuration” and called “Configure PHP and SuExec”. [...]