How can I secure access to my ISPconfig panel using an .htaccess file?

Procédure

Why should I secure my ISPconfig panel?

For added security, it may be useful to set up a user/password combination to restrict access to your ISPconfig panel.

This restriction can be extended to an IP address restriction, allowing you to give access only to a certain number of machines.

Creating the .htaccess file

To do this, you need to connect to your VPS server using SSH. If you don't know how to do this, please refer to this section of our knowledge base:

https://help.lws-hosting.com/en/dedicated-servers/ssh

Once connected, use the following command to create the :

nano /usr/local/ispconfig/interface/web/.htaccess

This file should contain the following:

AuthUserFile /usr/local/ispconfig/interface/.htpasswd AuthType Basic AuthName "ISPconfig auth." Require valid-user

Next, create the file /usr/local/ispconfig/interface/.htpasswd , which will contain your user and password (in this case we are creating the user lws):

htpasswd -c /usr/local/ispconfig/interface/.htpasswd lws

If you want to restrict access to certain IP addresses (in this case 192.168.1.193 and 192.168.1.194):

AuthUserFile /usr/local/ispconfig/interface/.htpasswd AuthType Basic AuthName "ISPconfig auth." Require valid-user Order Deny,Allow Deny from all Allow from 192.168.1.193 Allow from 192.168.1.194

Allow execution of the .htaccess file

Still using SSH, edit the following configuration file:

nano /etc/apache2-ispconfig/sites-available/ispconfig.vhost


or for older servers :

nano /etc/apache2/sites-available/ispconfig.vhost


Then replace the section :

# php_admin_value open_basedir "/usr/local/ispconfig/interface:/usr/share:/tmp" Options +FollowSymLinksAllowOverride NoneOrder allow,deny Allow from all php_value magic_quotes_gpc 0


per :

# php_admin_value open_basedir "/usr/local/ispconfig/interface:/usr/share:/tmp" Options +FollowSymLinksAllowOverride AllOrder allow,deny Allow from all php_value magic_quotes_gpc 0

Finally, restart the Apache web service:

/etc/init.d/apache2-ispconfig restart


or for older servers :

/etc/init.d/apache2 restart

Rate this article :

This article was useful to you ?

Article utileYes

Article non utileNo

Vous souhaitez nous laisser un commentaire concernant cet article ?

Si cela concerne une erreur dans la documentation ou un manque d'informations, n'hésitez pas à nous en faire part depuis le formulaire.

Pour toute question non liée à cette documentation ou problème technique sur l'un de vos services, contactez le support commercial ou le support technique

MerciMerci ! N'hésitez pas à poser des questions sur nos documentations si vous souhaitez plus d'informations et nous aider à les améliorer.


Vous avez noté 0 étoile(s)

Similar articles

3mn reading

How do I access ISPConfig on my dedicated VPS server?

0mn reading

How do I create a DNS server in ISPConfig on a dedicated VPS server?

0mn reading

How do I change the ISPConfig 3 panel password?

1mn reading

How do I change the php.ini file on my VPS server?


Ask the LWS team and its community a question