Showing posts with label Allow. Show all posts
Showing posts with label Allow. Show all posts

Thursday, 13 February 2020

Error - "Forbidden : You don't have permission to acces /phpmyadmin/ on this server" on Linux server (CentOS 7).

After installing LAMP on your Linux server, if you are getting error like "Forbidden:You don't have permission to access /phpmyadmin/ on this server", then it means that you are accessing it from server ip address and it is allowed from only localhost or you are accessing it from localhost and it is allowed only from ip address. So what to do next?


Type command -

sudo gedit /etc/httpd/conf.d/phpMyAdmin.conf

You will get the phpMyAdmin.conf file and at top you will find following code

Chane the line Require ip 127.0.0.1 and Allow from 127.0.0.1 if you want to access it using localhost on local machine. If you want to access it using your system ip address  on local machine then change 127.0.0.1 to to your system ip address

<Directory /usr/share/phpMyAdmin/>
      AddDefaultCharset UTF-8
  
<IfModule mod_authz_core.c>
    # Apache 2.4
   <RequireAny>
        Require ip 127.0.0.1
        Require ip ::1
   </RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny, Allow
     Deny From All 
     Allow from 127.0.0.1
     Allow from ::1
</IfModule>
</Directory>
 
If you want to access this server from any machine then replace the above code with

<Directory /usr/share/phpMyAdmin/>
      AddDefaultCharset UTF-8

<IfModule mod_authz_core.c>
     # Apache 2.4

     <RequireAny>
       Require all granted
     </RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
     #Apache 2.2
      Order Allow, Deny
      Allow from all
      Allow from 127.0.0.1
      Allow from ::1
</IfModule>
</Directory>


Monday, 10 February 2020

Unable to access Tomcat server running on Linux from another machine.

If you have installed Tomcat server on Linux and it is working on properly on installed machine, but you are unable to access it from other machine. If both machines are connected properly but again you are unable to access this. Then you can try this method.

(If have used this on CentOS running Tomcat 9 server)

It might be problem of firewall, so please use this command-
(I suppose your Tomcat server is using port 8080, if it uses another then use that port number in command)

sudo firewall-cmd --zone=public --add-port=8080/tcp --permanent

sudo firewall-cmd --reload



Change image source dynamically on hyperlink

 Changing image source dynamically using JQuery. Here in this example I have created there hyperlink and stored all images in the same folde...