Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

How To Use .Htaccess


Htaccess is a configuration file provided by the Apache web server, which is usually used to change the default settings of Apache. We know that the majority of web hosting on the internet using Apache as the server so that the web administrators / webmasters have to learn a little more about. Htaccess so that we can change the default settings of the server. Files. Htaccess is a simple ASCII text file which is usually located in the root directory. Is required to file in ASCII format instead of binary and to file permissions (file attributes) on the hosting server should be set to 644 (rw-rr). It is intended that the server can access the file. Htaccess, but prevents the user to access the file. Htaccess from their browser. Files. Htaccess is placed in the root directory can be used to change the configuration of the subdirectories in it, so in one website we usually sufficient to have 1 file. Htaccess are placed in the root directory.

Command code in the .Htaccess should be placed in a row, so when we create .Htaccess by using a text editor like notepad then we have to disable word wrap function (line cut) first.


.Htaccess can be used to :

1. Custom Http Error 
Error message on a website is very important because it can help the visitors to find out what was going on. With htaccess we can turn the page on a server error, by defining our own liking. An example is the transfer of messages according to their function as follows:

ErrorDocument 400 /errors/400.html 
ErrorDocument 401 /errors/401.html 
ErrorDocument 403 /errors/403.html 
ErrorDocument 404 /errors/404.html 
ErrorDocument 500 /errors/500.html


2. Override Ssl Setting


By default, only the web pages that have the extension. Shtml that can run server-side includes SSI on the server. By using the. Htaccess we can change the default setting so that SSI can work with HTML format.
To change these settings, we can add the following code in the file. Htaccess

AddType text/html .html 
AddHandler server-parsed .html

If we want a page with extension. Html and. Htm to be able to run SSI, then the file. Htaccess you can add the following code

AddType text/html .html 
AddHandler server-parsed .html
AddHandler server-parsed .htm

3. Change Default HomePage

It means that . htaccess can be used to change the default name of the web page. So that users can access our website only with domain name only (http://www.Your-web.com) without having to write clearly filename (http:Your-web.com/file.html), we must have index file in the root directories. Acceptable file names such as index.html, index.htm, index.cgi, index.php etc.. Make sure that the file named index. *

There are levels in the naming. If we had index.cgi index.html in the root directory and the server will display index.cgi since. Cgi has a higher level than. Html
With. Htaccess, we can define an additional index file or can also change the order of precedence. To define mainpage.html as index pages, we can add the following code to the file. Htaccess

DirectoryIndex mainpage.html


4. Block User From IP Address

order deny,allow
deny from 123.456.789.000 
deny from 456.78.90.
deny from .facebook.com
allow from all 


5. Rewriting Urls

RewriteEngine On 
RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 

6. Cache Control

# 480 weeks Header set Cache-Control "max-age=290304000, public" 
# 2 DAYS Header set Cache-Control "max-age=172800, public, must-revalidate"
# 2 HOURS Header set Cache-Control "max-age=7200, must-revalidate"



How To Check Your Website Value


if you have a blog, then you can calculate the price of your blog by using a web that provides services to calculate the price of your blog / website. To see prices blog, simply visit the website and enter your blog URL will then be calculated automatically. Here's the trick to finding out if the sale price of your blog:
1. Through the web site value calculator
     http://www.sitevaluecalculator.com/

2. Through your website value website
     http://www.yourwebsitevalue.com/

3. Information via the website biz
     http://bizinformation.org/

Of the three sites above assessment on the same blog, might make you confused because there is no clarity about the formula used to calculate the price of a blog. While the variables used to calculate the price of a blog is page rank (Google pagerank), Alexa (traffic), link popularity.

how hackers attack your cpanel

let me show you that methodology hacker... uses for getting supply as out to the config files of your respective web-site as an example wp-config. php and that i can show you ways to minimize this. 

) he login to cpanel currently being a normal user http ://ip-address/cpanel then jenis login and password to login 
2 ) then he open file manager ( show hidden files dotfiles ) after which creates new. htaccess file with following supply : 
#. htaccess file supply 
choices indexes followsymlinks 
directoryindex doesnt-metter. htm 
addtype txt. php 
addhandler txt. php 
#end of. htaccess file 
3 ) then he creates symbalic link ( soft link ) with perl scripts or barely uses cron job to make symbalic link of top level directory / typing : ln -s / topdir 
4 ) after that, he open browser and typing http ://server-ip/~his-home-dir/topdi... /wp-config. php after which barely looking supply as out to the page, all data present currently being a txt( text ) data. thats all. user has actually been hacked. 
------------------------------------------------------------------------------------------------------- 
answer : 
) open your php. conf along with your favorite ubahor : nano /usr/local/apache/conf/php. conf 
2 ) commit : #addtype application/x-httpd-php5. php5. php4. php. php3. php2. phtml 
3 ) add these lines : 
filesmatch. ph( p2-6 ?|tml )$ # this add up to :. php, . php2, . php3, . php4, . php5, . php6. phtml 
sethandler application/x-httpd-php5 
/filesmatch 
4 ) save your changes and shut php. conf 
5 ) restart httpd server typing : /etc/init. d/httpd restart 
6 ) done

how to disable symlink in cpanel


open this file via putty or terminal 

/usr/local/apache/conf/httpd.conf

paste this code and save it


<Directory "/">
Options -ExecCGI -FollowSymLinks Includes IncludesNOEXEC Indexes -MultiViews SymLinksIfOwnerMatch
AllowOverride All
</Directory>

<Directory "/usr/local/apache/htdocs">
Options IncludesNOEXEC Indexes -FollowSymLinks +SymLinksIfOwnerMatch -ExecCGI
AllowOverride None
Order allow,deny
Allow from all

</Directory>


<Directory "/home">
Options All -ExecCGI -FollowSymLinks -Includes -IncludesNOEXEC -MultiViews +SymLinksIfOwnerMatch
AllowOverride AuthConfig Indexes Limit Fileinfo
</Directory>

<Directory "/home2">
Options All -ExecCGI -FollowSymLinks -Includes -IncludesNOEXEC -MultiViews +SymLinksIfOwnerMatch
AllowOverride AuthConfig Indexes Limit Fileinfo
</Directory>