RedHat Linux Server में Website Apache को Secure कैसे बनाएं

हेलो दोस्तों आज के इस लेख में हम सीखते है की RedHat Linux Server में Website को कैसे Security provide कराई जा सकती है और हम किस -किस प्रकार की Security Hosting के दौरान कर सकते है परन्तु इससे पहले हमे यह जानना होगा की लिनक्स में हम Apache Server कैसे Configure कर सकते है और कैसे Apache Server पर Website को कैसे Host कर सकते है यह जानने के लिए आप इस Link पर click करके देख सकते है

तो दोस्तों यहाँ में यह मानकर चलता हु की आप ने अपनी Linux मशीन में Apache Server Configure कर लिया है और कैसे किसी Website या Web page को Apache Server पर host किया जा सकता है और आपको थड़ी बहुद Hosting के बारे में जाकारी है

इस लेख में आप जानेगे—

Website को Password protract कैसे बनाये ?

Server की Information को Hide करना

Port को Customize करना

Website को Password protract कैसे बनाये ?

दोस्तों यहाँ यदि हम चाहते है की हमारी website password protect हो और इसको Search engine index नहीं कर सके कोई व्यक्ति विशेस ही website को open कर सके जिसके पास User name और Password हो जैसा की Deep वेब में होता है तो यहाँ हम उस वेबसाइट को ऐसी Security दे सकते है

इसके लिए आप को Server की Configuration File में जाकर निम्न Security के लिए कुछ इस प्रकार Configuration करना होगा

# vim /etc/httpd/conf/httpd.conf

<Directory “/var/www/html/”>
AuthName “private”
AuthType Basic
AuthUserFile /var/www/html/.htpasswd
require valid-user
</Directory>

how to secoure website in redhat

इसके बाद आपको निम्न Commands चलाकर web Site को access करने वाला user Name और Password देना है

[root@localhost ~]# htpasswd -c /var/www/html/vishnu.html   hindi
New password: 123
Re-type new password: 123
Adding password for user hindi

अब हमे हमारी Linux machine के IP Address देखना है निम्न Commands से

[root@localhost ~]# ifconfig

eth1      Link encap:Ethernet  HWaddr 08:00:27:A9:A6:1B
          inet addr:192.168.43.7  Bcast:192.168.43.255  Mask:255.255.255.0
          inet6 addr: 2405:205:130a:b1ca:a00:27ff:fea9:a61b/64 Scope:Global
          inet6 addr: fe80::a00:27ff:fea9:a61b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:407 errors:0 dropped:0 overruns:0 frame:0
          TX packets:137 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:39816 (38.8 KiB)  TX bytes:19270 (18.8 KiB)
          Base address:0xd240 Memory:f0820000-f0840000

अब  हमे HTTPD Service को Restart करना हे निम्न Commands से

[root@localhost ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

4 अब हमे Firewall और Selinux को Disable करना हे निंम्न Commands से

[root@localhost ~]# iptables -F
[root@localhost ~]# setenforce 0

अब हमे किसी भी Browser में जाकर उसकी Url bar में Linux machine का IP Address Fill करना है अब  web page को open करने पर यह User name password पूछे गा

Server की Information को Hide करना

यहाँ दोस्तों हमारे लिए एक ध्यान देने योग्य बात यह है की हमे हमारे Server की information को हमेसा Hide करके रखना होता है अन्यता कोई भी Hacker हमारे Server की information निकाल कर हमारे Web Server पर Attack कर सकता है यहाँ में आप को एक उदारहण से समजता हु की हमारे web Server की information कैसे निकली जाती है अगर किसी Hacker को हमारा IP Address पता है तो वह telnet कर हमारी information को निकाल सकता है और भी अन्य कहि तरिके है इसके लिए पर यहाँ में आप को एक समझाता हु

अगर हमे किसी Server machine का IP Address पता है तो hum निम्न Commands से Server की information देख सकते है

[root@localhost ~]# telnet 192.168.43.254 80
Trying 192.168.43.254…
Connected to 192.168.43.254 (192.168.43.254).
Escape character is ‘^]’.
^^
<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”>
<html><head>
<title>501 Method Not Implemented</title>
</head><body>
<h1>Method Not Implemented</h1>
<p>^^ to / not supported.<br />
</p>
<hr>
<address>Apache/2.2.3 (Red Hat) Server at localhost.localdomain Port 80</address>
</body></html>
Connection closed by foreign host.

तो इस तरह से कोई भी Hacker Server की Information को देख सकता है इसको Secure बनाने के लिए हमे Apache की Configuration file में जाकर Server signature को off करना होता है

#vim /etc/httpd/conf/httpd.conf

521 # Set to “EMail” to also include a mailto: link to the ServerAdmin.
522 # Set to one of: On | Off | EMail
523 #
524 ServerSignature OFF
525
526 #
527 # Aliases: Add here as many aliases as you need (with no limit). The format is
528 # Alias fakename realname

इसके आलावा Apache Server की information के लिए यदि browser की url bar में कोईServer machine का ipaddress और server -info text fill करे तो server की Information leak हो सकती है इसकी Security के लिए हमे Line number 915 को Comments out रखना अनिवार्य होता है यह by Default comment out ही रहता है परन्तु हमे इसको Check करना आवश्य्क होता है

यह हम एक उदारहण में देखते है की यदि line number 915 , 16 ,17 18 यदि Comment out है तो किस प्रकार से information show होती है

how to secoure apache server

तब हमे show होगा browser की url bar में Address fill करने पर

server security

इसके साथ ही यदि हम Comments out को Remove Permission allow करके देख़ते है तो हमे देख़ने को मिलता है निम्न प्रकार से

Apache Security

server security in redhat

इसके साथ ही यदि हम httpd Service की port को Customize करते है तो कोई भी Person के लिए Server की Information निकलना कठिन होता है

Apache server security in redhat linux

दोस्तों अगर आप को हिंदी आईटी सलूशन द्वरा दिगई Trips ज्ञान प्रद और Knowledge वाली लगी हो तो Share करे like करे और हिंदी आईटी डॉट कॉम को Follow करे Follow करने के बाद हिंदी आईटी सलूशन डॉट कॉम जब भी कोई knowledge वाली post या Tutorial publish करेगा आप को Notification अपने email पर मिल जाएगी इस website पर आप Linux से Related बहुद सी post है जो सरल हिंदी भाषा में है जिस से आप Linux में निपुर्ण हो सकते है अगर आप को हिंदी आईटी सलूशन द्वारा पब्लिश किये गए किसी भी Trick या Tutorial का Piratical process में कोई Problem आती है तो Comments करे हिंदी आईटी सलूशन द्वारा आपकी समस्या का समाधान किया जाये गा

धन्यवाद
लेखक -विष्णु शर्मा

Leave a Reply

Your email address will not be published.