Forbidden You don’t have permission to access / on this server. Apache Directory aliasing error[Solved]

Tags

I was assigned a task to redirect a folder with one of my site, Say you type a URL in you Web browser xyz.com and when you try to browse xyz.com/folder, it should display the content of the folder placed somewhere on the linux box.

This can be acheive by Directory Aliasing. what I did was in xyz.conf (located in /etc/httpd/conf.d) added the directory structure.

Alias /folder/     "/usr/folder/"
<Directory "/usr/folder/">
AllowOverride None
Order Allow,Deny
Allow from All
</Directory>

And then save the xyz.conf file and restarted the apache server. Then tried to access the xyz.com/folder.
what I got was

Forbidden You don't have permission to access /folder on this server.

Then I check on the internet and for a simple solution to my problem.
All I had to do was to add one more line to the xyz.conf file.

Alias /folder/     "/usr/folder/"
<Directory "/usr/folder/">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride None
Order Allow,Deny
Allow from All
</Directory>

This worked for me.

 

Host X.X.X.X is blocked bacause of many connection errors Mysql/Lampp [Solved]

Tags

On Thursday, a user raised a concern that he was not able to login to mysql server.
He was getting an error message which says:

Host X.X.X.X is blocked because of many connection errors;
unblock with 'mysqladmin flush-hosts'.

This error occurs when a user  tries to connect mysql server and provides a wrong username or password more then 10 times.

By default mysqld block a host after 10 connection errors. However this can be changed in LAMPP by

[root@linux ~]#/opt/lampp/bin/mysql -p (After this type the password)

(You will get a mysql prompt and the run the below command)

mysql> SET GLOBAL max_connect_errors=100; (here I am using upto 100 times)
mysql> quit;

Then restart the mysql server.

[root@linux ~]# /opt/lampp/bin/mysql.server restart

 

This has resolved my problem.

 

MYSQL start failed :The server quit without updating PID file [Solved]

Tags

,

Today I was assigned a task in which I have to restore tables to a Mysql database. The thing what i did was stopped the Mysql Server and then copied the file in the –datadir location. After that tried to start the mysql server and got the below error

[root@localhost mysql]# /etc/init.d/mysql start
Starting MySQL..........................................................
...........................................................
.The server quit without updating PID 
file (/var/lib/mysql/localhost.pid).           [FAILED]

To resolve this what I did was couple of things listed below:

Method 1:
[root@localhost mysql]# ps -ef | grep mysql 
[root@localhost mysql]#kill -9 PID (output of the above command)  or
[root@localhost mysql]#killall -9 mysql mysqld
[root@localhost mysql]#/etc/init.d/mysql start

Still Facing the problem..

Method 2:
[root@localhost mysql]#cd /var/lib/mysql
[root@localhost mysql]#mv ib_logfile* /root
[root@localhost mysql]#/etc/init.d/mysql start

Still Facing the Problem..

Method 3:
Try to rename the my.cnf file and start the mysql server
[root@localhost ~]#mv /etc/my.cnf /etc/my.cnf.bak
[root@localhost ~]#/etc/ini.d/mysql start

Still Facing the problem ( In my case)

Restart the linux server and then try to start mysql server

[root@localhost ~]# reboot
[root@localhost ~]# /etc/init.d/mysql start

The last one worked for me.

VSFTP Error 500 OOPS: cannot locate user entry:nobody [Solved]

Tags

Yesterday, I have a user complaining of getting Error 500 OOPS: cannot locate user entry:nobody while he was trying to connect one of our FTP server the error is listed below

[root@linux]# ftp X.X.X.X
 Connected to X.X.X.X (X.X.X.X).
 500 OOPS: cannot locate user entry:nobody
 ftp>

The problem was ftp server was not asking from username.

To resolve this what i did was I restarted the Ftp server and it started working fine.

/etc/init.d/vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]

Hope this help.

 

Thought on CVE-2014-6271: Vulnerability in bash (shellshock)

Today I was informed by one of my friend that a new vulnerability in bash “shellshock” has been announced. The major impact of this vulnerability is in a scenario where a bash script can be executed through cgi-bin. I searched a lot and read about it on web.

To check the vulnerability use the below command :

env 'x=() { :;}; echo vulnerable' 'BASH_FUNC_x()=() { :;}; echo 
vulnerable' bash -c "echo test"
vulnerable
bash: BASH_FUNC_x(): line 0: syntax error near unexpected token `)'
bash: BASH_FUNC_x(): line 0: `BASH_FUNC_x() () { :;}; echo vulnerable'
bash: error importing function definition for `BASH_FUNC_x'
test

If the output of your command is same as above you need to update your bash my friend.

update your bash using yum

# yum update bash

Then again try the same command and the output will be somewhat like:

bash: warning: x: ignoring function definition attempt
bash: error importing function definition for `BASH_FUNC_x'
test

For more reference please check the below links:

https://access.redhat.com/articles/1200223

https://isc.sans.edu/diary/Update+on+CVE-2014-6271%3A+Vulnerability+in+bash+%28shellshock%29/18707

IOException parsing XML document from URL [File://..] nested exception is Java.io.FileNotFoundException [Solved]

Tags

,

I was setting up J boss AS for QA environment . I did all the basic step and after that I started J boss AS and got an exception that says:“IOException parsing XML document from URL [file:/usr/abc/config/abcConfig.xml]; followed by  nested exception is java.io.FileNotFoundException: /usr/abc/config/abcConfig.xml”
Below is the log:

org.springframework.beans.factory.BeanDefinitionStoreException: IOException 
parsing XML document from URL [file:/usr/abc/config/abcConfig.xml]; 
nested exception is java.io.FileNotFoundException: /usr/abc/config/abcConfig.xml
java.io.FileNotFoundException: /usr/abc/config/abcConfig.xml
        at org.jboss.net.protocol.file.FileURLConnection.connect(FileURL
Connection.java:80)
        at org.jboss.net.protocol.file.FileURLConnection.getInputStream
(FileURLConnection.java:89)
        at org.springframework.core.io.UrlResource.getInputStream(UrlR
esource.java:102)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReade
r.loadBeanDefinitions(XmlBeanDefinitionReader.java:167)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReade
r.loadBeanDefinitions(XmlBeanDefinitionReader.java:148)
        at org.springframework.beans.factory.support.AbstractBeanDefin
itionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126)
        at org.springframework.beans.factory.support.AbstractBeanDefini
tionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
        at org.springframework.beans.factory.xml.DefaultXmlBeanDefiniti
onParser.importBeanDefinitionResource(DefaultXmlBeanDefinitionParser.java:325)
        at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitio
nParser.parseBeanDefinitions(DefaultXmlBeanDefinitionParser.java:298)
        at org.springframework.beans.factory.xml.DefaultXmlBeanDefinition
Parser.registerBeanDefinitions(DefaultXmlBeanDefinitionParser.java:191)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader
.registerBeanDefinitions(XmlBeanDefinitionReader.java:295)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader
.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:223)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader
.loadBeanDefinitions(XmlBeanDefinitionReader.java:173)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader
.loadBeanDefinitions(XmlBeanDefinitionReader.java:148)
        at org.springframework.beans.factory.support.AbstractBeanDefiniti
onReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126)
        at org.springframework.beans.factory.support.AbstractBeanDefinit
ionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
        at org.springframework.web.context.support.XmlWebApplicationCont
ext.loadBeanDefinitions(XmlWebApplicationContext.java:126)
        at org.springframework.web.context.support.XmlWebApplicationCont
ext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
        at org.springframework.context.support.AbstractRefreshableApplic
ationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
        at org.springframework.context.support.AbstractApplicationContex
t.refresh(AbstractApplicationContext.java:269)
        at org.springframework.web.context.support.AbstractRefreshableWe
bApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
        at org.springframework.web.context.ContextLoader.createWebAppli
cationContext(ContextLoader.java:246)
        at org.springframework.web.context.ContextLoader.initWebApplica
tionContext(ContextLoader.java:184)
        at org.springframework.web.context.ContextLoaderListener.contex
tInitialized(ContextLoaderListener.java:49)
        at org.apache.catalina.core.StandardContext.listenerStart(Standa
rdContext.java:3669)..
    ......

 

This error is self-explanatory.  It says that while AS was looking into 
some xml file (mainly application-context.xml)which contain the path for 
the other config file,  is not present on the path mentioned in the 
XML file (here abcConfig.xml is missing at /usr/abc/config/ location).

So, In order to overcome this exception moved the file to the mentioned loaction /usr/abc/config/ and then again tried to restart the Jboss AS server found no such exception.

Java.net.BindException: Address already in use: JVM_Bind [Solved]

Tags

Yesterday while I started Jboss AS I found a exception which says “java.net.BindException: Address already in use: JVM_Bind”
Below is the log:

java.rmi.server.ExportException: Port already in use: 8580; nested exception is: 
    java.net.BindException: Address already in use: JVM_Bind
    at sun.rmi.transport.tcp.TCPTransport.listen(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport.exportObject(Unknown Source)
    at sun.rmi.transport.tcp.TCPEndpoint.exportObject(Unknown Source)
    at sun.rmi.transport.LiveRef.exportObject(Unknown Source)
    at sun.rmi.server.UnicastServerRef.exportObject(Unknown Source)
    at java.rmi.server.UnicastRemoteObject.exportObject(Unknown Source)
    at java.rmi.server.UnicastRemoteObject.exportObject(Unknown Source)
    at org.jboss.invocation.jrmp.server.JRMPInvoker.exportCI(JRMPInvoker
.java:437)
    at org.jboss.invocation.jrmp.server.JRMPInvoker.startService(JRMPIn
voker.java:359)
    at org.jboss.invocation.jrmp.server.JRMPInvoker$1.startService(JRMPI
nvoker.java:136)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMB
eanSupport.java:272)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(Servi
ceMBeanSupport.java:222)
    at org.jboss.invocation.jrmp.server.JRMPInvoker.jbossInternalLifecy
cle(JRMPInvoker.java:631)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDisp
atcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanIn
voker.java:249)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceCo
ntroller.java:897)
    ......

This error itself says that the port is already in use. To check the same we can use:

In linux :
netstat -anp | grep <port number>
tcp        0      0 :::8580      :::*         LISTEN      4041/java
In Widows:
netstat -ano | find "<port number>
TCP       0.0.0.0:8580            0.0.0.0:0             LISTENING    1192

This problem occurs when a Jboss AS is not properly shutdown and we try to start the same Jboss AS again.

To overcome this exception we can follow the below step:

For linux
#ps -ef | grep java (it will display the jboss with its pid)
#kill -9 pid
then,
#cd JBOSS_HOME/bin
#./run.sh &
For windows:
1. Open the Task Manager window.
2. Goto Processlist and check for java.exe process.
3. select and right click the same and choose End process option.
4. Goto the JBOSS_HOME/bin location window and click on the run.bat file.

This can resolve the issue.

java.lang.VerifyError: verification failed at PC [Solved]

Tags

While running a jar file I got error message which says “java.lang.VerifyError: verification failed at PC 186”.
Below is the log

Caused by: java.lang.VerifyError: verification failed at PC 186 in 
com.alphaxml.cores9api.DXPConfigurationS9:getFormattedPipelineSummaryTable
((Ljava.util.Collection;II)Ljava.lang.String;): incompatible type on stack
 at java.lang.Class.initializeClass(libgcj.so.7rh)
 ...3 more

This error occurs when I was trying to execute a jar which I have compiled with jdk-1.7.0 and then I moved it to the QA server having jdk-1.4 and tried execute it.

 To resolve this I updated the jdk-1.4 to jdk-1.7.0

Then it worked fine for me

Waiting for welcome message while connecting to FTP Server using Filezilla [Solved]

Tags

While I trying to connect FTP Server using Filezilla I got error , “waiting for welcome message”, Below is the error which is shown.

Error: Connection attempt interrupted by user
Status: Resolving address of abcdftp.com
Status: Connecting to X.X.X.X:21...
Status: Connection established, waiting for welcome message..
Error: Connection timed out
Error: Could not connect to server
Status: Waiting to retry

This mainly happens when we have configured FTP with passive ports.

The easiest way to overcome this problem is to do the below steps:
1. In filezilla got to Edit menu and select Settings.
2. In Settings click on FTP.
3. Change the Transfer mode from Passive to Active.
4. Click on OK and try to reconnect.

This resolve my problem

How to add Additional Response Header SVG SVGZ in Lampp (Apache)

Tags

,

Hello All, Today I was trying to host a website on Lampp Server hosted on Linux 6.
Build was having some file having .svg extension whose effect were not visible in the browser. I searched on web a lot and then found a simple solution.

It says to modify my apache configuration:-

Below is what i modified:

vim /opt/lampp/etc/mime.types
add the line below line after image/* (* be image/png line )
image/svg+xml svg svgz

vim /opt/lampp/etc/httpd.conf
Now add the two line in after
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

AddType image/svg+xml svg svgz
 AddEncoding gzip svgz

After these change it worked fine for me..