Tag Archives: apache

NettyAvroRpcClient RPC connection error

2014-12-19 01:05:42,141 (lifecycleSupervisor-1-1) [WARN – org.apache.flume.sink.AbstractRpcSink.start(AbstractRpcSink. java:294 )] Unable to create Rpc client using hostname: xxx.xxx.xxx.xxx, port: 41100
org.apache.flume.FlumeException: NettyAvroRpcClient { host: 121.41.49.51, port: 41100 }: RPC connection error

This problem occurs when flume uses Avro to accept data.

First, let’s see if the port of the connected server is monitored

If you want to send data to port 4383 of 192.168.1.1, you need a server listening to this window, otherwise RPC connection failure will occur

PHP connection to MySQL database error: call to undefined function MySQL_ connect()

Problem description
I just started to learn PHP, and the system environment is Ubuntu+PHP7.0+Mysql5.7+Apache2.
running a database connection test sample error:

[client 127.0.0.1:37496] PHP Fatal error:  Uncaught Error: Call to undefined function mysql_connect() in /var/www/html/test.php:2\nStack trace:\n#0 {main}\n  thrown in /var/www/html/test.php on line 2

The sample code is:

<?PHP
    $conn=mysql_connect("localhost","root","root");
    if($conn){
        echo"ok";
    }else{
        echo"error";    
    }
?>

The solution
The mysql_connect() function has been deprecated since PHP5.0. In PHP 7.0 it has been deprecated and replaced with this function:

mysqli_connect();

Usage is:

$con=mysqli_connect("localhost","my_user","my_password","my_db");

The description of the official connection: http://php.net/manual/en/function.mysqli-connect.php
the correct test code:

<?PHP
    $conn=mysqli_connect("localhost","root","root");
    if($conn){
        echo"ok";
    }else{
        echo"error";    
    }
?>

conclusion

    in the Ubuntu + PHP7.0 + Mysql5.7 + Apache2 system under the environment of the wrong, because the mysql_connect () function has been deprecated, when following outdated tutorial learning may encounter this error. (note: if it is a Windows system, are more likely to be Apache2 not enable mysql, details on baidu) when running the above test code, interface without any reaction, the error is in the log to consult, log directory in the/var/log/Apache2/error log “.

Error report and solution of PHP module introduced by Apache

Preface:
Today, I will share with you the introduction of Apache PHP module error and solution
 
The incoming module file path has Spaces

 
Solution: The path is enclosed in double quotes

 
The requested operation has failed. The requested operation has failed.
 
Solutions:
1. View the version of HTTPD
  

 
2. Check the PHP version

 
3. Check the VC version of the machine

 
Then we can use this information to select the appropriate PHP package

In the above picture, I downloaded the Win32 vc14 x86 PHP package, only to download the corresponding version, can not report errors.

SELinux solution to Apache SSL failure

The blogger today plans to configure a multi-certificate Apache so that multiple domain names can be accessed via https://***. According to the online tutorial, just add multiple < VirtualHost *:443> You can do that. But restarting HTTPD always prompts:

Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

Journalctl-xe examines with the command:

systemd[1]: Unit httpd.service entered failed state.
systemd[1]: httpd.service failed.
polkitd[475]: Registered Authentication Agent for unix-process:7076:2357584 (system bus name :1.219 [/usr/bin/pkttyagent -.....

It’s hard to see what’s wrong (at this point the blogger doesn’t know that HTTPD has an error_log, face-covering)
After a long time, I finally opened /var/log/ HTTPD /error_log

AH02312: Fatal error initialising mod_ssl, exiting.
SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
Permission denied: AH02201: Init: Can't open server certificate file 

When the blogger saw this error message, he immediately understood that it was SELinux!! A lot of potholes on the SELinux before. So the first thing that comes to mind is that the SSL certificate file, the private key file, is not in the right context. Turning SELinux off directly would certainly solve the problem. But this is just a once-and-for-all approach that will cause more problems.
The solution
Three files are required to configure SSL:
2_domain.com.crt
3_domain.com.key
1_root_bundle.crt
Let’s say they’re all under /usr/local/apache/conf/

cd /usr/local/apache/conf/ 

Displays the current context of each file

ll -Z

Change context

chcon -u system_u -r object_r -t cert_t 1_root_bundle.crt
chcon -u system_u -r object_r -t cert_t 2_domain.com.crt
chcon -u system_u -r object_r -t cert_t 3_domain.com.key

The context configuration is not unique. If this setting doesn’t work, try something else.

[xampp] error: Apache shutdown unexpected. 11:00:50 [Apache] solution details

XAMPP Apache does not work, and has been reporting errors:
Error: Apache shutdown unexpectedly. 11:00:50 [Apache] This may be due to a blocked port, missing dependencies, 11:00:50 (Apache) improper privileges, a crash, Or a shutdown by another method. 11:00:50 [Apache] Press the Logs button to view error
 
That means the port problem, just change the port.
 

    click on this Config and select the Service and Port Settings

 

 
2. Change the original port Numbers 80 and 443 to 8080 and 4433, respectively (more commonly used, can also be changed to other unused ports, such as 81,801)

 
3. Then click Config in the main interface, select httpd.conf and httpd-sSL. conf to find the corresponding positions respectively and change them to 8080 and 4433 set previously (if other port Numbers are set, change the corresponding Settings).

 
This position is very easy to find, and when you see the number of Listen, you only need to change the Listen below. If this doesn’t work, change the Listen above


 
5. The next detail is that you have to go to the status bar to turn Xampp off completely! Reopen it. If it still doesn’t work, try again with a different port number.
 

 
Leave a comment.

Apache startup error ah00534: httpd: configuration error: more than one MPM loaded

Apache startup error AH00534: HTTPD: Configuration Error: More than one MPM loaded.
Open apache configuration file httpd.conf
LoadModule mpm_event.so
LoadModule mpm_prefork_module /mod_mpm_prefork.so
LoadModule mpm_worker_module Modules /mod_mpm_worker.so
comment out two changes as follows
Click to view full text: http://www.3qphp.com/server/server/2860.html

SQL Error: 904, SQLState: 42000

Question:

WARN 2011-03-04 09:33:18 org.hibernate.util.JDBCExceptionReporter – SQL Error: 904, SQLState: 42000

the ERROR 2011-03-04 09:33:18 org. Hibernate. Util. JDBCExceptionReporter – ORA – 00904: “MENU0_”. “MENU_OPEN_IN_HOME” : identifier is invalid

Hibernate: select portletloc0_.PORTLET_LOCATION_ROW as col_0_0_, portletloc0_.PORTLET_LOCATION_COLUMN as col_1_0_, portlet1_.PORTLET_URL as col_2_0_, portlet1_.PORTLET_TITLE as col_3_0_, portletloc0_.PORTLET_ID as col_4_0_ from JEDA_PORTLET_LOCATION portletloc0_, JEDA_PORTLET portlet1_ where portletloc0_.PORTLET_ID=portlet1_.PORTLET_ID and portletloc0_.POSITION_ID=?order by portletloc0_.PORTLET_LOCATION_ROW asc, portletloc0_.PORTLET_LOCATION_COLUMN asc

2011-3-4 9:33:18 org.apache.catalina.core.StandardWrapperValve invoke

severity: servlet.service () for Servlet DispatcherServlet threw exception

java.sqlexception: “MENU0_”.”MENU_OPEN_IN_HOME”: identifier is invalid

the reason:
The attribute name of the
hbm. XML file does not correspond to the attribute name of the database

[How to Fix] org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.

org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:230)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:244)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:729)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2261)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2134)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1988)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:639)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:244)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
at $Proxy54.save(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy55.save(Unknown Source)
at org.rtx.wmprd.test.TestAsnServices.main(TestAsnServices.java:37)
Caused by: com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 middle byte 0xde (at char #541, byte #127)
at com.ctc.wstx.sr.StreamScanner.throwFromIOE(StreamScanner.java:708)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1086)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:218)
... 32 more
Caused by: java.io.CharConversionException: Invalid UTF-8 middle byte 0xde (at char #541, byte #127)
at com.ctc.wstx.io.UTF8Reader.reportInvalidOther(UTF8Reader.java:313)
at com.ctc.wstx.io.UTF8Reader.read(UTF8Reader.java:204)
at com.ctc.wstx.io.MergedReader.read(MergedReader.java:101)
at com.ctc.wstx.io.ReaderSource.readInto(ReaderSource.java:84)
at com.ctc.wstx.io.BranchingReaderSource.readInto(BranchingReaderSource.java:57)
at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:992)
at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:1034)
at com.ctc.wstx.sr.StreamScanner.getNextChar(StreamScanner.java:794)
at com.ctc.wstx.sr.BasicStreamReader.parseNormalizedAttrValue(BasicStreamReader.java:1900)
at com.ctc.wstx.sr.BasicStreamReader.handleNsAttrs(BasicStreamReader.java:3037)
at com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:2936)
at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2848)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
... 33 more
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader.
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146)
at $Proxy54.save(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy55.save(Unknown Source)
at org.rtx.wmprd.test.TestAsnServices.main(TestAsnServices.java:37)
Caused by: com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 middle byte 0xde (at char #541, byte #127)
at com.ctc.wstx.sr.StreamScanner.throwFromIOE(StreamScanner.java:708)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1086)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:218)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:244)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:729)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2261)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2134)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1988)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:639)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:244)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
... 17 more
Caused by: java.io.CharConversionException: Invalid UTF-8 middle byte 0xde (at char #541, byte #127)
at com.ctc.wstx.io.UTF8Reader.reportInvalidOther(UTF8Reader.java:313)
at com.ctc.wstx.io.UTF8Reader.read(UTF8Reader.java:204)
at com.ctc.wstx.io.MergedReader.read(MergedReader.java:101)
at com.ctc.wstx.io.ReaderSource.readInto(ReaderSource.java:84)
at com.ctc.wstx.io.BranchingReaderSource.readInto(BranchingReaderSource.java:57)
at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:992)
at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:1034)
at com.ctc.wstx.sr.StreamScanner.getNextChar(StreamScanner.java:794)
at com.ctc.wstx.sr.BasicStreamReader.parseNormalizedAttrValue(BasicStreamReader.java:1900)
at com.ctc.wstx.sr.BasicStreamReader.handleNsAttrs(BasicStreamReader.java:3037)
at com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:2936)
at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2848)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
... 33 more

When using Apache CXF, the above exception appears in the calling method. After careful inspection, the ASM package is missing. Just introduce the ASM package.

ajp_read_header: ajp_ilink_receive failed

Using the HTTPD proxy_AJp module, proxy_AJp.conf is configured as follows

ProxyPass /examples/ ajp://localhost:8009/examples/

error occurs when accessing http://hostname/examples:

[Wed Feb 01 15:56:37 2012] [error] (70014)End of file found: ajp_ilink_receive() can't receive header

[Wed Feb 01 15:56:37 2012] [error] ajp_read_header: ajp_ilink_receive failed

[Wed Feb 01 15:56:37 2012] [error] (120006)APR does not understand this error code: proxy: read response failed from (null) (localhost)

Tomcat startup information:

Feb 1, 2012 4:54:34 PM org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deploying web application directory ROOT

Feb 1, 2012 4:54:35 PM org.apache.coyote.http11.Http11Protocol start

INFO: Starting Coyote HTTP/1.1 on http-8090

Feb 1, 2012 4:54:36 PM org.apache.jk.common.ChannelSocket init

INFO: Port busy 8009 java.net.BindException: Address already in use

Feb 1, 2012 4:54:36 PM org.apache.jk.common.ChannelSocket init

INFO: JK: ajp13 listening on /0.0.0.0:8010

Feb 1, 2012 4:54:36 PM org.apache.jk.server.JkMain start

INFO: Jk running ID=1 time=0/645 config=null

Feb 1, 2012 4:54:37 PM org.apache.catalina.startup.Catalina start

INFO: Server startup in 207063 ms

solution:

it can be seen from the tomcat startup information that port 8009 is used, so change the ajp port under conf/server.xml from 8009 to 8010


<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

instead


<Connector port="8010" protocol="AJP/1.3" redirectPort="8443" />

ProxyPass is also modified to port 8010


ProxyPass /examples/ ajp://localhost:8010/examples/

specific why 8009 port is used, it is not clear, welcome to communicate.

Use sc command under CMD, report openservice failed 1060 error

Use sc command under CMD to delete the tomcat service and report openservice failed 1060 error
Reason: The status of the Tomcat service in the service is disabled. If the status is changed to automatic, sc DELETE Tomcat can be used
Note: Although the service name is Apache Tomcat, you do not need to add Apache when removing the Tomcat service
Conclusion:
There are two ways to delete Windows services:
Option 1: start — run — cmd.exe with the Windows command
, then type sc to see it. The method is simple:
sc delete “Service name” (if there is a space in the Service name, you need to put quotes around it)
as above: sc delete Service

open the registry editor and find the following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services generally the service will display a key with the same name here, just delete the key directly.

Install apache2.4 on windows to solve the problem of the requested operation has failed

  1. double-click on \Apache\Apache24\bin\ ApacheMonitor. Exe to start, click start the requested operation has failed to report an error.
  2. at first thought it was port 80, changing port 80 won’t help.
  3. CMD open \Apache\Apache24\bin\, and enter httpd-t to display normally.
  4. CMD open \Apache\Apache24\bin\ and enter httpd. exe-w-n “apache2.4” -k start.
  5. shows not baidu experience https://jingyan.baidu.com/article/ceb9fb10d909c48cac2ba06c.html said OS 10013 problems, but OS 10048
  6. then find this article solve the problem of OS 10048,
    https://blog.csdn.net/sun9979/article/details/102960811 Because there is a problem that 443 is occupied, we have modified the two files in \conf\extra\ and changed 443 to 442.
  7. but then appeared a new problem, looked at the server. CRT file exists, {SRVROOT} has also been configured, close look is HTTPD -ahssl.conf file has a {SSRVROOT}, the default file actually has this error, delete an S, change to {SRVROOT}.
  8. and then start is successful.
    summary: change 443 port, ${SSRVROOT}.