MRatWork Forum by Mustafa Ramadhan

Sawo Project - Kloxo-MR Discussions => Kloxo-MR Technical Helps => Topic started by: chrisf on 2014-04-30, 04:44:24

Title: Trying to switch to hiawatha proxy, fails
Post by: chrisf on 2014-04-30, 04:44:24
I have latest 6,5.1b (042902) and I tried switching Apache to Hiawatha proxy, no matter what I do I get this:

Code: [Select]
[root@cc-server ~]# sh /script/restart-web
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
Stopping Hiawatha web server:                              [FAILED]
Starting Hiawatha web server:                              [  OK  ]
listen(http(s)): Address already in use
Stopping php-fpm:                                          [  OK  ]
Starting php-fpm:                                          [  OK  ]
[root@cc-server ~]#

I try reboot.  Fixweb, old trick changed webserver to nginx, back to Hiawatha proxy.  Reboot, restart-all.

Nothing works.  Please advise.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: MRatWork on 2014-04-30, 05:05:16
Another trick use 'killall hiawatha; sh /script/restart-all'. The same way for httpd with 'killall httpd'.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: chrisf on 2014-04-30, 05:07:38
Still fails, same error.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: MRatWork on 2014-04-30, 06:13:52
Look like port 80 used by other (possible httpd). Try 'sh /script/fixweb'.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: chrisf on 2014-04-30, 13:03:05
I ran all the fix scripts, rebooted, restarted, something isn't right.  This Apache has a SSL certificate for a domain, could it be some problem with port 443 since all the recent changes?

It just will not start.:
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: MRatWork on 2014-04-30, 13:54:57
I think not related to ssl but maybe something wrong with /etc/httpd/conf/httpd.conf.

This file must content ('Listen 80' must disabled):
Code: [Select]
# MR -- must be disable here because can not overrite! -- importance for proxy-to-apache
# Listen 80

And or possible old files not removed in /home/apache/conf/defaults and /home/apache/conf/domains. Try remove current files in both directories and then run 'sh /script/fixweb'.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: chrisf on 2014-05-02, 05:42:03
I deleted files, fixweb, error remains.  Checked httpd conf, listen 80 was commented out '#'.

Switched to nginx proxy, all working:
Code: [Select]
[root@cc-server ~]# sh /script/restart-web
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
Stopping nginx:                                            [  OK  ]
Starting nginx:                                            [  OK  ]
Stopping php-fpm:                                          [  OK  ]
Starting php-fpm:                                          [  OK  ]
[root@cc-server ~]#

KloxoMR panel, switch program, Hiawatha proxy, fails!
Code: [Select]
[root@cc-server ~]# sh /script/restart-web
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
Stopping Hiawatha web server:                              [FAILED]
Starting Hiawatha web server:                              [  OK  ]
listen(http(s)): Address already in use
Stopping php-fpm:                                          [  OK  ]
Starting php-fpm:                                          [  OK  ]
[root@cc-server ~]#

So I can not get Hiawatha proxy to switch.  I have tried about everything!  Any more suggestions?
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: chrisf on 2014-05-02, 05:47:37
Just tried 'Hiawatha' with no proxy.  It will not start.  Same error, reboot, same error.  I have Hiawatha running on other servers,  no problems.  This server has SSL domains.

Hiawatha, no proxy, same error:
Code: [Select]

[root@cc-server ~]# sh /script/restart-web
Stopping Hiawatha web server:                              [FAILED]
Starting Hiawatha web server:                              [  OK  ]
listen(http(s)): Address already in use
Stopping php-fpm:                                          [  OK  ]
Starting php-fpm:                                          [  OK  ]
[root@cc-server ~]# sh /script/restart-web
Stopping Hiawatha web server:                              [FAILED]
Starting Hiawatha web server:                              [  OK  ]
listen(http(s)): Address already in use
Stopping php-fpm:                                          [  OK  ]
Starting php-fpm:                                          [  OK  ]
[root@cc-server ~]# service hiawatha stop
Stopping Hiawatha web server:                              [FAILED]
[root@cc-server ~]# service hiawatha start
Starting Hiawatha web server:                              [  OK  ]
[root@cc-server ~]# listen(http(s)): Address already in use

I think something is wrong, Hiawatha and Hiawatha proxy will not start.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: MRatWork on 2014-05-02, 06:27:06
No. Your hiawatha able to start but something wrong in stop process.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: chrisf on 2014-05-02, 14:07:47
I don't think so.  Stop fails because there is nothing to stop, Hiawatha never runs/starts properly.

I have Hiawatha running on four other servers, no problem.  No ssl certs either.

Please investigate this problem.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: MRatWork on 2014-05-02, 14:20:53
Basically, nothing wrong with stop process. But, sometimes not work. It's similar situation for apache. I found latest apache have this issue. Look like apache back to their old issue (certain version have this issue).

In context, hiwatha-proxy, the process are restart httpd and then hiawatha (possible better restart hiawatha and then httpd).
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: MRatWork on 2014-05-02, 14:23:04
In your case, try 'killall httpd; sh /script/restart-web'.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: chrisf on 2014-05-02, 17:21:56
Mustafa, nginx proxy, lightppd proxy both work.

Hiawatha, NO proxy, will not start. Nothing in the error.log at all.  Just that 'listen http(s) error message'.  There is no httpd to kill, just Hiawatha.

If Hiawatha doesn't start, Hiawatha proxy won't either.

I still think related to port 443, that is only difference in my servers.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: chrisf on 2014-05-02, 17:34:44
This error is related to Hiawatha configuration and the binding option.   I have not looked further at this point, but searching Hiawatha forums explains this error.

Logic to me is, four servers running Hiawatha perfect, no SSL.  1 server with SSL, Hiawatha will not start.

Problem must be in the configuration for binding port 443.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: MRatWork on 2014-05-02, 18:31:39
If you sure it's related to ssl, try re-create self-assign for IP and or domains ssl.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: chrisf on 2014-05-03, 00:06:46
IT IS DUE TO SSL BINDING / port 443.  Proof.  I deleted the conf file from hiawatha/conf/domains for the domain which has the ssl.  Hiawatha started perfectly.

Ran fixweb to recreate the domain with ssl.  Hiawatha FAILS!

SSH transcript:
Code: [Select]
[root@cc-server domains]# rm convictionshosting.com.conf
rm: remove regular file `convictionshosting.com.conf? y
[root@cc-server domains]# sh /script/restart-web
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
Stopping Hiawatha web server:                              [FAILED]
Starting Hiawatha web server:                              [  OK  ]
Stopping php-fpm:                                          [  OK  ]
Starting php-fpm:                                          [  OK  ]
[root@cc-server domains]# sh /script/restart-web
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
Stopping Hiawatha web server:                              [  OK  ]
Starting Hiawatha web server:                              [  OK  ]
Stopping php-fpm:                                          [  OK  ]
Starting php-fpm:                                          [  OK  ]
[root@cc-server domains]# sh /script/fixweb

- For help, type '/script/fixweb --help'
- No argument supplied. Defaulting to localhost (master) servers

Fixing Web server config
- 'defaults' pages at 'localhost'
- 'cc-server.us' ('admin') at 'localhost'
- '.htaccess' for 'cc-server.us' ('admin') at 'localhost'
- 'convictionshosting.com' ('admin') at 'localhost'
- '.htaccess' for 'convictionshosting.com' ('admin') at 'localhost'
[root@cc-server domains]# sh /script/restart-web
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
Stopping Hiawatha web server:                              [  OK  ]
Starting Hiawatha web server:                              [  OK  ]
listen(http(s)): Address already in use
Stopping php-fpm:                                          [  OK  ]
Starting php-fpm:                                          [  OK  ]
[root@cc-server domains]# sh /script/restart-web
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
Stopping Hiawatha web server:                              [FAILED]
Starting Hiawatha web server:                              [  OK  ]
listen(http(s)): Address already in use
Stopping php-fpm:                                          [  OK  ]
Starting php-fpm:                                          [  OK  ]
[root@cc-server domains]#

Hiawatha fails with a domain with SSL.   It is through admin and IP (old way).

Please investigate and fix,
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: MRatWork on 2014-05-03, 06:58:38
Using latest version of Kloxo-MR 6.5.1.b and ssl self-assign?.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: chrisf on 2014-05-03, 15:12:06
Yes, latest KloxoMR 6.5.1b.  The SSL is assigned through old way (admin ->IP->SSL) because it has been assigned for nearly half a year running Apache no proxy.

So there is a IP assigned to this domain as well.  I was reading on Hiawatha forums this error normally happens when using the 'interface' option under binding - but don't know for sure.

I just know that Hiawatha will not start.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: MRatWork on 2014-05-04, 12:16:21
Try not using .ca file if using self-assign (not ssl from thirdparty) in /home/kloxo/httpd/ssl.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: chrisf on 2014-05-04, 17:08:01
It is a rapidSSL and the intermediate file (ca) is required.  It could also be the additional IP - there are different reasons for that error to be displayed - BUT, they all are due to configuration errors.

Something is wrong.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: MRatWork on 2014-05-05, 04:42:30
Check your /home/hiawatha/tpl/domains.conf.tpl. In previous you will see 'if (file_exists("{$certname}.ca")) {' and also using '.pem' instead '.crt'.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: chrisf on 2014-05-05, 05:18:21
I switched back to pure Apache.   This is a live site, and customers use it.  I reported all of this because there is a obvious error in the Hiawatha configuration.

I don't know if it is due to the additional IP or the ssl, but I am sure it's wrong.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: chrisf on 2014-05-06, 17:36:37
Have you found the cause of this error ?
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: MRatWork on 2014-05-07, 02:55:53
Because I didn't have thirdparty ssl certificate, I don't know what's happen for your ssl.

If you permit, send to my PM your thirdparty ssl certificate.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: GentZu on 2014-05-07, 18:34:31
try

yum remove hiawatha -y
yum install hiawatha -y
service restart hiawatha
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: MRatWork on 2014-05-07, 18:56:02
try

yum remove hiawatha -y
yum install hiawatha -y
service restart hiawatha
If you try this commands, '/etc/hiawatha/hiawatha.conf' file is from hiawatha.rpm ('generic' hiawatha.conf). Kloxo-MR use 'special' hiawatha and taken from '/home/hiawatha/etc/conf/hiawatha.conf'.

As we know, other services (like apache, nginx, lighttpd and others) also using 'special' config.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: chrisf on 2014-05-16, 06:34:37
I am not sure this is related to the CA file.  I think it has to do with additional IP and ssl.  I am not sure.  I can not get Hiawatha to start.  I have no idea why the configuration is wrong.

Sorry, I can not give you a copy of my ssl.

This actually is a serious problem.  Add a ssl and IP to Hiawatha and it stops working.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: MRatWork on 2014-05-16, 06:45:10
Try update Kloxo-MR and then run 'sh /script/cleanup'.

I am not sure, but try install polarssl with 'yum install polarssl'.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: chrisf on 2014-05-16, 18:13:15
running latest 6.5.1b, installed polarssl, same error.

Code: [Select]
listen(http(s)): Address already in use

In Hiawatha forums this error is due to incorrect binding.  I use an additional IP with this site, could that be a problem.

I changed all my servers to Hiawatha proxy, if a customer wants ssl, is everything going to break?

This is a critical bug in the configuration of Hiawatha.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: chrisf on 2014-05-16, 19:19:39
Found the problem.  It is not because of the SSL, it is because of the IP set for that domain.

From Creator of Hiawatha:
Quote
Hugo Leisink

When not specifying an interface in a Binding block, Hiawatha will bind all available interfaces. When a second block has the interface option, that interface is already binded by the previous binding block. To solve this, specify an interface in the first binding block.

In Hiawatha defaults init.conf you don't use the interface option, you bind Hiawatha to all IP's.  In my website, I added exclusive IP, and you use interface option in binding it.  But, it is already bound to first init.conf binding id port_443.

You have to list all available ip's in the init.conf, using interface option.

This is a critical bug in KloxoMR and adding any exclusive IP to a website will break Hiawatha.

Please fix.  Thank you.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: MRatWork on 2014-05-16, 20:46:41
It's different behaviour between hiawatha and other webservers.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: chrisf on 2014-05-16, 21:06:16
Yes, I was able to get it working like this:
These are examples.

If my server had 5 ip's with 2 dedicated / exclusive for a site, Hiawatha conf needs to be:
1.1.1.1, 1.1.1.2, 1.1.1.3
1.1.1.4 is exclusive IP for website, 1.1.1.5 exclusive for website

In init.conf for Hiawatha in binding part add
Interface options for 1.1.1.1-3 ONLY
in domain conf use interface for corresponding IP

It works.  But on fixweb/cleanup init.conf is rewrote.

Title: Re: Trying to switch to hiawatha proxy, fails
Post by: MRatWork on 2014-05-19, 04:04:40
Don't modified init.conf directly but modified custom.defaults.conf.tpl.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: chrisf on 2014-05-19, 06:00:14
I never got it working completely.  Php wasn't working.  I got Hiawatha to start, but had problems.

You should investigate, since KloxoMR uses Hiawatha/Hiawatha proxy.  Adding a site with exclusive IP breaks KloxoMR.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: chrisf on 2014-05-23, 02:27:03
Anything Mustafa? 
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: MRatWork on 2014-05-23, 06:23:54
I can't testing in my servers because every server only have 1 IP address.
Title: Re: Trying to switch to hiawatha proxy, fails
Post by: chrisf on 2014-05-24, 00:56:21
In a couple weeks I will be provisioning a server for vps sales.  At this time I can let you use a vps to fix Hiawatha, it will have atleast 4 ip's available.

This vps could be available to you for a month.

Agreed?