PDA

View Full Version : Apache working with Litespeed?


surfman
12-28-2006, 02:56 PM
Apache working with Litespeed?

Due to Litespeed does not support SSI. can I do this way under Cpanel/WHM:

1) keep Apache running for SHTML file only
2) Litespeed running for all other pages and PHP programs?
3)both Apache and Litespeed will be installed on one server.

is that OK? please let me know how to do it if it's ok.

thanks.

surfman
12-28-2006, 05:14 PM
one more thing,

4) is there any way to force apache to send all visitors who visit non-shtml files/pages to a designed port powered by litespeed?

say, when a user visits www.mysite.com/123.shtml , apache will take care of it.
if the user visits www.mysite.com/vbulletin_forum/ , he will be sent to www.mysite.com:8088/vbulletin_forum

is that ok? thanks.

mistwang
12-28-2006, 09:33 PM
Actually, you should let lsws forward request to .shtml to apache via the reverse proxy interface. it should work better this way. :)

surfman
12-29-2006, 06:35 AM
I checked the demo, saw there are some options for type web server under external app option:

I have no ideal to enter address, environment, and how to let LSWS know it need forward the request to .shtml to apache.

could you give me an example? I am totally new to LSWS. thanks.

mistwang
12-29-2006, 10:10 AM
For example,
1. run apache or port 81 or whatever port you'd like, just not 80
2. define a web server external app, address should be "127.0.0.1:81". no need to set "environment".
3. add a script handler for suffix "shtml", using the web server external app as handler. If can be done at server level or vhost level.

If any question, please read the online help first for each individual configuration option.

surfman
12-29-2006, 10:34 AM
got it.

But I got another problem. I changed port value in apache httpd.conf

port 80 ==> port 8080

after that, when I visit my site, got

"There is no website configured at this address" shown.

do I have to change

NameVirtualHost IP.IP.IP.IP:80

to

NameVirtualHost IP.IP.IP.IP:8080 as well?

thanks.

mistwang
12-29-2006, 10:42 AM
Yes, I think so.
Is LSWS using Apache's httpd.conf? If yes, you need to create a backup copy of the httpd.conf for LSWS.
Or, you can use "Apache port Offset" configuration to let LSWS run on the standard port 80 while apache on port 79 or something.

surfman
12-29-2006, 01:17 PM
Finally, LSWS is working well at 80 port. Thanks for all help.

However, regarding sending .shtml to apache at port 8080 is still not working although I already set it up based on above instruction and the post at

http://litespeedtech.com/support/forum/showthread.php?t=605

I am using Apache's httpd.conf in LSWS (following the instruction at http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:apache:cpanel ). the apache offset is 0 at this moment. I am wondering if I change anything in apache's httpd.conf, will LSWS change at same time?

The reason I am asking is that all ports are 80 in old httpd.conf, that is what I am guessing why LSWS is working at port 80 too. so, if I change them to 8080, will LSWS stop working at port 80? because they are using the same httpd.conf.

thanks for further kind help.

mistwang
12-29-2006, 02:36 PM
Yes, LSWS will change to port 8080 after restart since it uses the apache configuration.

Like what I said in last post, configure apache to use port 79 and 442 for SSL, set "Apache port offset" to "1", so LSWS will use port 80 and 443.
The external app address should change to "localhost:79" as well.
restart apache and LSWS, it should work.

surfman
12-29-2006, 03:56 PM
After changing apache port to 79, I have the following error:

This address is restricted

This address uses a network port which is normally used for purposes other than Web browsing. Firefox has canceled the request for your protection.

under IE, the error is:

The page cannot be displayed
The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings.

.......

is there way to fix it? thanks.

mistwang
12-29-2006, 05:12 PM
Firefox blocked access to port 79.
Not sure about the IE error. Is port 79 blocked by firewall? open a dos prompt and try "telnet <ip> 79" see if you can connect to the server.
If you can, it probably is something wrong with the httpd.conf.

3.0RC1 package has been updated to address a configuration issue related to shtml forwarding. Please update.

surfman
12-29-2006, 05:15 PM
after changing port to 78, seems ok.

however, when I clicked any links to a shtml page, it seems still with litespeed, not sent to Apache.

I already setup the correct settings for external app, i.g. localhost:78, and script handler for suffix "shtml". also restarted lsws, it's ok when I enter by hand at browser, like, http://www.mydomain.com:78

but when I visit http://www.mydomain.com, it always stays with litespeed.

I am using 2.26 std. do I have to updated to 3.0RC1?

mistwang
12-29-2006, 09:45 PM
Yes, 2.2.6 may not work well, latest 3.0RC1 works.

surfman
12-30-2006, 07:20 AM
updated to 3.0RC1, the problem is still there.

when I visit

http://mydomain.com:78

it's fine. that means apache works fine at port 78

when I visit

http://www.mydomain.com

it shows "There is no website configured at this address" from cpanel.

but when I visit

http://www.mydomain.com/anyfolder

even

http://www.mydomain.com/anyfile.html

all are working fine, just shtml can not be visited. My default index file is a shtml page, so, the said error page is shown instead of showing a normal .shtml page.

I checked external apps settings and script handler, all settings are correct. it seems litespeed sends shtml file to somewhere where can not be processed correctly.

My apache is 1.3.34.

My external apps:

Type Name Address
Web Server Apache13 localhost:78

and script handler:

Suffixes Handler Type Handler Name
shtml Web Server [Server Level]: Apache13

the above info is for your reference.

any suggestion? thanks.

surfman
12-30-2006, 01:13 PM
a little further info for the problem.

after I removed external apps and script handler,

http://www.mydomain.com

is working under litespeed. for sure, there are SSI missing on my each shtml page.

alright, I added back external apps and script handler,

http://www.mydomain.com

shows the said error page from Cpanel. I traced the error, it comes from

/usr/local/apache/htdocs

Seems litespeed send shtml to apache at port 78. but apache failed to parse job for shtml. although, if I directly visit

http://www.mydomain.com:78

all shtml pages are working fine. any idea to fix it? thanks.

surfman
12-30-2006, 05:45 PM
well, well, well, finally, it works. I even have no idea how I fixed it. the settings are as same as that stated in my previous post. but it works!

Anyway, thanks to the owesome software. let my server drop server load from more than 50 to about 7 or 8 at this moment.

I will continue to install APC or eaccelerator later to get max performance.

surfman
12-30-2006, 09:04 PM
so weird!

After having been working about 3 hours,

http://www.mydomain.com

is showing "There is no website configured at this address" from cpanel again. Although

http://www.mydomain.com:78

is still working, as same as before.

I did nothing about it after it works. any idea on this strange thing? thanks.

mistwang
12-30-2006, 09:24 PM
I think the problem probably is the namevirtualhost, if you only host one web site on one IP, you don't have to use namedvirtualhost. And in the <VirtualHost ...> directive, see if you can get rid of the port number only leave the IP address.

The problem probably is because LSWS send Apache Host header with "www.mydomain.com", but Apache only like "www.mydomain.com:78".

surfman
12-30-2006, 09:51 PM
All my.ip.addre.ss is one same IP

NameVirtualHost my.ip.addre.ss:78
<VirtualHost my.ip.addre.ss>
ServerAlias mydomain.net
ServerAdmin webmaster@mydomain.net
DocumentRoot /home/myusername/public_html
BytesLog domlogs/mydomain.net-bytes_log
ServerName www.mydomain.net

User myusername
Group myusername
CustomLog /usr/local/apache/domlogs/mydomain.net combined
ScriptAlias /cgi-bin/ /home/myusername/public_html/cgi-bin/
</VirtualHost>


<VirtualHost my.ip.addre.ss>
ServerAlias www.blogs.mydomain.net
ServerAdmin webmaster@blogs.mydomain.net
DocumentRoot /home/myusername/public_html/blogs
BytesLog domlogs/blogs.mydomain.net-bytes_log
ServerName blogs.mydomain.net

User myusername
Group myusername
CustomLog /usr/local/apache/domlogs/blogs.mydomain.net combined
ScriptAlias /cgi-bin/ /home/myusername/public_html/blogs/cgi-bin/
</VirtualHost>


<VirtualHost my.ip.addre.ss>
ServerAlias www.classifieds.mydomain.net
ServerAdmin webmaster@classifieds.mydomain.net
DocumentRoot /home/myusername/public_html/classifieds
BytesLog domlogs/classifieds.mydomain.net-bytes_log
ServerName classifieds.mydomain.net

User myusername
Group myusername
CustomLog /usr/local/apache/domlogs/classifieds.mydomain.net combined
ScriptAlias /cgi-bin/ /home/myusername/public_html/classifieds/cgi-bin/
</VirtualHost>

mistwang
12-30-2006, 10:01 PM
try getting rid of "NameVirtualHost my.ip.addre.ss:78", see if it helps.

surfman
12-31-2006, 09:57 AM
removing "NameVirtualHost my.ip.addre.ss:78" still does not help.

My concern is if the problem is like what you said:


The problem probably is because LSWS send Apache Host header with "www.mydomain.com", but Apache only like "www.mydomain.com:78".


why it did work for several hours, just like what I mentioned at post #16?

May be, Is there anyway to make sure LSWS sends Apache Host header with "www.mydomain.com:78" instead of "www.mydomain.com:78"? Thanks.

surfman
12-31-2006, 10:15 AM
I checked the apache error log, found all shtml files were sent to be like these:

[Sat Dec 30 09:52:27 2006] [error] [client 127.0.0.1] File does not exist: /usr/local/apache/htdocs/news/localnews/1475.shtml
[Sat Dec 30 09:52:27 2006] [error] [client 127.0.0.1] File does not exist: /usr/local/apache/htdocs/404.shtml
[Sat Dec 30 09:52:29 2006] [error] [client 127.0.0.1] File does not exist: /usr/local/apache/htdocs/news/localnews/index-13.shtml
[Sat Dec 30 09:52:29 2006] [error] [client 127.0.0.1] File does not exist: /usr/local/apache/htdocs/404.shtml


all shtml files were sent to:

/usr/local/apache/htdocs/news/localnews/1475.shtml

rather than

/home/myusername/public_html/localnews/1475.shtml

all my shtml pages are stored at folder

/home/myusername/public_html

NOT

/usr/local/apache/htdocs

I guess that's why http://www.mydomain.com is not working while http://www.mydomain.com:78 is working.

I checked with apache settings,

<VirtualHost my.ip.addre.ss>
ServerAlias mydomain.net
ServerAdmin webmaster@mydomain.net
DocumentRoot /home/myusername/public_html
BytesLog domlogs/mydomain.net-bytes_log
ServerName www.mydomain.net

User myusername
Group myusername
CustomLog /usr/local/apache/domlogs/mydomain.net combined
ScriptAlias /cgi-bin/ /home/myusername/public_html/cgi-bin/
</VirtualHost>


the red line for my DocumentRoot is correct. why apache still looks for shtml at the folder /usr/local/apache/htdocs ?

how can I correct this issue? thanks.

mistwang
01-01-2007, 01:24 PM
why it did work for several hours, just like what I mentioned at post #16?

May be, Is there anyway to make sure LSWS sends Apache Host header with "www.mydomain.com:78" instead of "www.mydomain.com:78"? Thanks.

I don't know what make it work for serval hours, what you have done to apache configuration during the few hours? ;)

Let's see what we can do with the Host header. :)

why apache still looks for shtml at the folder /usr/local/apache/htdocs ?

how can I correct this issue?
That's because for some reason apache serve http://www.mydomain.com with the default vhost, serve http://www.mydomain.com:78 with the vhost you defined.

Looks like the best way to fix it is to change the host header by appending ":78" to the domain name in LSWS.

mistwang
01-02-2007, 10:45 AM
OK, I find the cure. :)
You need to change "Port 80" to "Port 78" in your httpd.conf.