Roobarb-Work: I know.
what does the -m option do?
-m option of?
I don't understand your question then
invalid option -- m
Try ``grub --help'' for more information.
well, looks like its my turn to ask for help again, I'm lost. When I try and run a cgi script suexec'ed to a local user, I get an internal server error and nothing useful in error_log (just the usual premature headers warning but that shouldn't cause a internal server host error)
http://pastebin.ca/601205
httpd
what else would premature end of script headers cause?
httpd -m
httpd -M lists both statically and dynamically loaded modules for apache version 2.2 and higher
see.. still no -m only -M
and there;s no option -m?
ah ok thanks
nothing really, its just a warning, the majority of browsers are capable of processing a website with reduced headers I've found
ls has a -m option... if you're looking so badly for a program with a -m option...
no, you're way off course
"premature end of script headers" in the error log == 500 error to the client
Okay, then explain this please:
that's not to say that there's nothing wrong with your suexec config. i expect there is, but let's deal with the easy error first
that's why it says [error] instead of [warning] in the error log
if I comment out the SuexecUserGroup line in the config, the page works fine, but if I uncomment it, I get the 500 error
either way, I still get premature header warning
it happens with even the most basic hello world cgi host script
Roobarb-Work: another thing.... aren't you missing a NameVirtualHost directive?
[in your httpd-simple.conf, that is]
uh, no - not for a single vhost bound to an IP
Roobarb-Work: yeah.. but as soon as someone tries to add another vhost he'll run into a wall
where's my sodding screwdriver gone?
behind the keyboard
you're a programmer. Hands off the screwdriver, unless you want to cause 'accidents'
close, in the laptop bag
hehe
depends if they add IP-based ot Name-based vhosts
any ideas on the suexec thing though mate?
its only an example, after all
Roobarb-Work: ack
i expect the document root you're using isn't the one suexec likes. check the suexec error log
jMCg++ put the screwdriver down
oh
its that silly security thing where it can't be suexec'ed to a gid less than 1500 or something
right, that didn't work. let's try hammer 'n nail
yeah, there's about 11 of those checks documented on the suexec howto page (linked to from the docs frontpage)
can I borrow said hammer and nail to torture suexe?
*suexec
I just added multiviews to my site because I have it in 2 languages (english and danish). Is there anything I should be conserned with regarding googlebot and other crawlers?
here you go --|| ///
just for a split second there I was going to do some ascii art of a swollen thumb post-hammer strike
looking for a simple mod_rewrite. I get and internal server error with: "RewriteRule ^(.*) /down.html [L, R]" I'm attempting to redirect everything to a 'site down for maintanence' page.
you could cheat tech13
that'd be impressive on one line
move the site tree away and have a custom 404 document saying the sites down for maintenance
use AliasMatch instead
now you got me thinking about it x.x
--|| &~~
hehe, nice try
You know you're bored at work when you resort to drawing ascii art of DIY accidents
to mcdonalds!
back soon
you know you'r bored at home when you resort to DIY
and how
-e
later Foxdie :p
why do people pronounce "touche" like tooshay? shouldn't it just be toosh?
what language is that anyway?
french
We, being Americans, hate the french
fajita++
touché, even
as in, touched
I just added multiviews to my apache conf because I have my site in 2 languages (english and danish). Is there anything I should be concerned with regarding googlebot and other crawlers?
i think it's derived from fencing
hi , when I state , 'Require User test' in httpd.conf
where is the passwd looked up from
the AuthUserFile location?
that depends on the auth mechanism you use
im using Basic
if you use file authentication, then yes
htpasswd
htpasswd is http://httpd.apache.org/docs-2.0/programs/htpasswd.html. A utility for creating password files for use with Basic authentication
it doesnt seem to accept my password
then you did something wrong
the errorlog usually tells you what and why
oh, then i guess tooshay is right. there goes another theory..
How do I make apache2 send a different content-type for a specific file extension?
Never mind
Oh ha ha
-.-
is it possible to configure the number of character displayed for a file or dir name in indexed mode ?
IndexOptions NameWidth
thanks !!
I've got NameVirtualHost *:80, and I've got VirtualHost *:80 / ServerName server1 / RedirectMatch permanent server1 https://server1 / then I have another Virtualhost *:80 / ServerName server2. pulling up http://server1 redirects as it
should, but http://server2 redirects to https://server1 too
shouldn't the 'server1' part of the redirectmatch pretty much guarantee that doesn't happen?
Program mode requires special privileges, e.g., root or Trusted User'
what permissions am I supposed to set to a perlscript if I get that message
its in cgi-bin
or is it something in the httpd.conf?
what does the error lgo say, exactly?
2 2007] [error] [client 127.0.0.1] Program mode requires special privileges, e.g., root or Trusted User, referer:
back
then it's not a matter of setting permissions on the file
the executing user needs special privileges
was cool, hailstones in birmingham x.x
AL or UK?
I am a little worried about the purpose of the script, honestly
UK
I left the office and it was bright and sunny, got to mcdonalds and it started to rain very heavily (to the point where the carpark flooded), then it battered my car with hailstones
anyone have time for a RedirectMatch question?
it appears as the script requires root access and that you chould chmod +s it. That is VERY dangerous.
its the DSpam Web UI
yeah, really don't do it unless you know it's ok
if there's a flaw in the script, you just got rooted
I need to go to work, unfortunately.
hi joel
hey Foxdie
I'll help you with the webUI problem if you'd like
no biggie, I just got a bit more good info on it
sure
I'm tracking it down
its why I'm here right now actually, having problems with it being suexec'd
actually, holy crap
now my redirectmatch doesn't work again...all I did was comment, restart, uncomment, restart
ah ok
it works fine as root
or rather apache
1) RewriteRule ^view/topic/(.*)$ view.php?topic=$1 and 2) RewriteRule ^view/topic/(.*)/(.*)$ view.php?topic=$1&page=$2
why would putting 1 in the list first cause 2 to not work?
it works if I out 2 before 1
[dot]Al: .* is greedy
[dot]Al: becaus... jink is faster than me.
[^/]*
[dot]Al: you could've seen that, by the way. i suppose you got requests for topics like aa/bb
instead of topic aa and page bb
im new to htaccess, still learning the proper ways to use it
the proper way is to NOT use .htaccess at all
so what would I use to rewrite urls?
httpd.conf, of course
i find htaccess easier tbh, I leave httpd.conf as it is
that's because you don't know the proper way
I'd listen to your 'elders'
I dont have access to httpd.conf on my webhost server
well, then you're out of luck and bound to use .htaccess
that's fine
had you had access it wasn't
lol
anyway, the solution is to replace .* with [^/]* in both rules
thanks
doesn't ServerName bind a virtual host to a specific host header?
not sure if this is due to the html hosting or the server. on an page that has basic authentication, there is a table with an icon on each row. it makes a new request for each icon, even though they are all the same image file. how do I get firefox to just
request one copy?
if you use it with NameVirtualHost, yes
http://pastie.caboo.se/75685
Roobarb-Work: ha, this is something you're personally pretty familiar with (you helped me before on the same server)
ok
anyway, I've got the redirect working just fine...for server1. server2's redirecting too, however, and that's no good.
what's more, when I commented out the virtualhost for server1's redirect, http://server1 took me to server2!
default vhost?
The first-listed virtual host is always the default one when using name based virtual hosts. See http://www.onlamp.com/pub/a/apache/2004/01/08/apacheckbk.html for more details.
NameVirtualhost?
NameVirtualhost is http://httpd.apache.org/docs-2.0/mod/core.html#namevirtualhost or http://httpd.apache.org/docs/mod/core.html#namevirtualhost or
You must specify only one NameVirtualHost directive, hopefully with an IP address or a *. It says on which interfaces should Apache listen to name based vhosts requests, nothing more.
I'm afraid I've probably forgotten everything about your server. Please can you pastebin your current configuration and give me a brief description of what you are trying to achieve.
thanks, reading
Roobarb-Work: sure, five minutes...trying to read this article first to see if I can catch what I did wrong
i have 2.2.3 installed.
heyo, when using mod_proxy with Apache 2.2.x and a cluster of backend application servers I've noticed that generally one of the 8 application servers seems to grow in memory much quicker and get higher than the others. Which isn't a problem
I was just curious why Apache seems to route more traffic to that one rather than more evenly between all 8.
Is it just because if that first one is free it hits it first?
i want ot keep that, and install 2.2.4
meh, can't see what I did wrong
probably
2.2.3 installed with apt-get and server root is in /etc/apache2
are you always coming from the same ip address host ?
2.2.4 installed via sources with server host root in /usr/local/apache2
Roobarb-Work : nope this is organic production traffic
if that's what you mean
it's interesting, I could probably get away with just 5 or 6 apps running looking at the usage
I'm not sure what load-balancing algorithms mod_proxy_balancer uses. It may, as you say just pick the first host if its free
when i execute /usr/local/apache2/bin/httpd -k start, it doesn t read /usr/local/apche2/apache2.conf
Roobarb-Work : that's cool, I remember reading in the docs about there being a couple of algorithmic options
mod_proxy_balancer
mod_proxy_balancer is http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html
plenty there to look at
enabling the balancer-manager might be useful
Roobarb-Work : excellent I forgot all about that
I'm guessing you want to set each back-end server to have an lbfactor of 1
http://pastie.caboo.se/75688 with this configuration, http://www.rocketrestoration.com is just showing the default vhost (which is redirecting it to https://www.deepsouthfibers.com)
why do you have multiple Listen ports ?
are you proxying from port 80 to each of those ?
Hi, can anyone give me any advice as to what to investigate when I receive "Premature End Of File" errors from Apache Axis running on tomcat web hosting 5.5.17?
Roobarb-Work : that sounds right, I think that's the default
Roobarb-Work : thanks for the help
Roobarb-Work: they were in use earlier, kind of pointless now
but not entirely
I'll hit ip_address:9570 to show a site that's in staging before I switch it over for a given domain host name
(where 9570 is any of those)
k
so whats the problem?
Roobarb-Work: the second vhost never gets hit
I go to http://www.rocketrestoration.com and I just get redirected to https://www.deepsouthfibers.com
hmm
you are aware that those 2 hosts have different IP Addresses ?
deepsouthfibers.com and rocketrestoration.com both resolve to 208.75.85.114 for me
[mwatts@mwatts ~]$ dig +short www.deepsouthfibers.com
deepsouthfibers.com.
208.75.85.114
[mwatts@mwatts ~]$ dig +short www.rocketrestoration.com
64.74.96.243
oh
www.rocketrestoration.com and rocketrestoration.com point two different places
well, http://www.rocketrestoration.com redirects me to http://rocketrestoration.com
and I see a green website
at any rate, www.rocketrestoration.com seems to redirect to rocketrestoration.com maybe (it's a google apps hosted domain, so I don't know what they do exactly...just a friend's site)
Roobarb-Work: with pictures of house work?
yeah - some decking and a bathroom
well, great
that's correct
it redirects me to deepsouthfibers.com
I mean, www. redirects to rocketrestoration.com
which then redirects me to deepsouthfibers.com
at least it's working for you
very odd
Hi, can anyone give me any advice as to what to investigate when I receive "Premature End Of File" errors from Apache Axis running on Tomcat 5.5.17?
Premature end of script headers
'Premature end of script headers' means that the script either encountered an error, or is emitting a bogus HTTP header. Check out http://httpd.apache.org/docs/misc/FAQ.html#premature-script-headers or see suexec
or see ScriptLog or see 500 or see cg-eye (diagnostic tool)
there ya go
different issue I think
google "Premature End Of File" axis
http://forum.java.sun.com/thread.jspa?messageID=3790406
ahh
Thanks Roobarb-Work, but i've spent the last hour or so searching the web.
well there are a squillion different hits...
Roobarb-Work: my laptop battery died
heh
but I think it was fixed already for a while, and my machine just wasn't working right
now I get rocketrestoration (since the reboot)
good
thanks again
on debian, how can I set apache's root serving directory to /var/www/coyote
as opposed to /var/www/apache2-default
change any reference of one to the other, in your httpd configs
ok
Is there a nice way to disable partial content requests? Insofar as it would respond with something along the lines of "No. Download the full thing from the start again."
would it be the option ServerRoot?
right now its set to /var/apache2 though
block
you'd have to choose to ignore the Range: header, and I'm not sure how you'd do that.
ok
Roobarb-Work: I can do it in a nasty way with mod_rewrite (responds with 403), but I was hoping there was a way to have it say "Download from the start" rather than "fuck off".
hi have a problem
http://apache.pastebin.ca/601382
basically i want to get directory listing on the directory promos
what I get is the perl handler (Foo) hhandling it
Roobarb-Work: there isn't a DocumentRoot in my config
do I just add one?
I am attempting more than one method at doing this all currently fail
there will be
but you may find it in another file (apache.2.conf maybe)
I just installed apache 2.2.4 on my server and am trying to merge my config files from an apache 1.3.x install with it and having issues
yeah
I can (if I know the file name) see the files in the promos directory but I want directory listing
and deservedly so
I have no DocumentRoot (except in a couple virtualhosts), but it still seems to load documents for all virtualhosts from the default DocumentRoot (which is no longer specified)
options indexes
Options +Indexes allows a directory listing to be displayed if there is no index document in the directory the user requested.
any pointerS?
Roobarb-Work: theres no other config files in /etc/apache2
user RemoveHandler pl instead of Sethandler none
name based vhosts
name based vhosts is http://httpd.apache.org/docs/2.2/vhosts/name-based.html#using
faq1
exactly. For example, NameVirtualHost *:80 must be used with VirtualHost *:80
distro layout
See http://wiki.apache.org/httpd/Info/DistrosDefaultLayout for clues on how your distro mangles or organises its Apache package(s)
^^
common misconfigurations
common misconfigurations is http://wiki.apache.org/httpd/Info/CommonMisconfigurations
thanks, already have valid name-based virtualhosts; will check the default layouts and common misconfigs
no problem _trace
oh yay for fajita's response
Roobarb-Work: thanks, that link fixed it
debian
debian is "we complicate it for you so you don't have to" or see /usr/share/doc/apache*/README.Debian* or http://wiki.apache.org/httpd/Platform/DebianLike
The reason I want to kill off 'partial content' requests is to effectivly fuck over people who use that piplining crap. They hold connections other people could use. Am I going about this the wrong way, or is there a better way to do it?
heh, its a decent server platform
got a production server thats been running it close to 300 days uptime, no reboot
you'd be fucking-over people with unreliable connections too
Roobarb-Work: Yeah, that is the downside. Unless you know of a way to stop people making multiple requests for the different parts of the same file at the same time
300 days is peanuts:
is there an axis channel ?
4
its been up wince May 30th 2002
hehe
which distro?
which distro is you running? (might save some pain, various distros try and fail to make apache configs easier for noobs)
an old one
how does apache decide which vhost is the default?
meow
meow is a small Cat's BIG roarrrrr
DistrosDefaultLayout's description doesn't match my install at all :-\
excuse me?
default vhost
The first-listed virtual host is always the default one when using name based virtual hosts. See http://www.onlamp.com/pub/a/apache/2004/01/08/apacheckbk.html for more details.
er... sorry, where is apache getting the default DocumentRoot from when it's not in my config file anywhere?
is it caching an old config file or just reverting to some built-in default?
Roobarb-Work: so, then it would be the one with the lowest name if they're all in include sites-enabled/* ?
have you restarted Apache?
yes
oh, yes
I'll bet its in an Included config file somewhere
do you have anything in your httpd.conf file that would load other .conf files?
Roobarb-Work++
my guess, bad configuration. what does your httpd -S tell?
yes, it includes separate conf files for each virtualhost
will check
checks out okay
could you pastebin the output
sure
http://pastebin.com/941296
a couple warnings
any ideas?
still waiting for that page to open
apc
Try using http://apache.pastebin.ca - It's a good pastebin, and is even set up to highlight Apache 'stuff'.
will do
what?
bah
humbug
silly fajita
http://apache.pastebin.ca/601409
ok. it seems you need to a) fix your ServerLimit or MaxClients b) you are missing NameVirtualhost *:8080
I was aware of a), was putting it off until I had figured out the other issue
so I need a default NameVirtualhost *:8080?
yes. By setting 'NameVirtualhost *:8080' you tell apache that you are using name based hosting (multiple sites on same ip:port) on *:8080
Someone knows how to install the service on vista? If i try i'll get (OS 5)Toegang geweigerd. : Failed to open the WinNT service manager
after that http://apple-archive.dyndns.org:8080/ ... http://mirrors.unna.org:8080/ should work better
hmm, now it only warns about *:80 not having any virtualhosts, bit it's not accepting any connections :-\
http://apache.pastebin.ca/601382
I think I have everything in the config you stated
what?
omg - i haven't used irc in a while. that pastebin is awesome!!!
what does httpd -S output now?
what else did you do besides adding 'NameVirtualhost *:8080' ?
much better than a hundred lines of unformatted code
you gave advice on directory listing
huh?
and i think i have followed everything
http://apache.pastebin.ca/601382
is the viirtualhost part
the config works (i.e. all vhost work
http://apache.pastebin.ca/601437
that was all I changed
why do you 127.0.0.1?
its a test box
oh
discovered it was a conflict with the old version of apache 1.3 still running (accidentally)
my problem is that the handler seems to take over
i can access files in teh directory
ONLY if i know there names
the '[warn] NameVirtualHost *:80' is not important, you could comment out 'NameVirtualhost *:80' but it really doesn't matter. No fix the ServerLimit or MaxClients and you should be ready to rock
what I'm trying to do is get the dir listing
but it still spits back the contents of '/usr/local/apache2/htdocs/' for all the sites when subdirectories of '/Library/WebServer/Documents/' are specified as the DocumentRoot in each of the virtualhosts
and no other DocumentRoot is specified
blocks, things get confusing
ok
will win
regardless of the order you put them in your config
i only have then all in there to show the methods i have tried
anyway, i've set up another apache server but am running into a wierd problem where apache doesn't render pages if you used the IP address from the local machine
using just one method (and in diff orders ) also fails
still can't figure out where the hell that is coming from
tag produces the same result
if i VNC to the server and open a browser it responds to it's servername (http://servername) , internal network address (http://192.168.x.x) , but unfortunately it won't respond to the IP the rest of the world sees (http://1.2.3.4)
sure
now you have 6 vhosts on *:8080, you need to access hosts with http://site:8080/
what you want is to not include directories in the matches
anyone have an idea of what could be wrong?
for example, LocationMatch ^/promos.+[^/]$
or LocationMatch ^/promos/.*[^/]$
aye?
won't match urls ending in /
oic
hmm
however, that's not quite good enough
because you still have the issue of people providing directories without the slash
actually, i just got it. there was a Listen *:80 in my virtual_host_global.conf file (it was the only line in there and I had missed switching it to *:8080)
thanks for the assistance and patience
thats actually not the problem (i think)
i'm not sure exactly what your setup is... that was just a hint
something happens AFTER the locationMatch that causes the dir listing to be over rided by the handler (in this case perl)
any help is good help
that locationmatch pattern is a bit odd
yes
it is
locationmatch takes a regex, not a glob
but i think it will match your particular test case.
fajita, scopes?
bugger all, i dunno
fajita, scope?
section, or a Location, perhaps. or http://httpd.apache.org/docs/configuring.html#scope or http://httpd.apache.org/docs/2.2/configuring.html#scope
bloodly literal bot
its should be like ^(phpBB|blah)[^/]*$
in anycase it still works
im getting random redirects from http://www.domain.com to http://domain.com and its screwin stuff up
benchmark
siege, apachebench, jmeter, flood, grinder, httperf
block anywhere in the config
afternoon rici
directory removed
are most people in here sys admins?
programmer (by name)
hey noodl
try this http://apache.pastebin.ca/601461
i'm not sure it captures everything you want
but it might give you some ideas
ok
i think you might need to add a check that %{PATH_INFO} is empty to the rewrite
so the REQUEST_FILENAME is an env setting?
rewritecond
rewritecond is http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritecond
there's a list of variables there
cool but it still (underlyingly) is the same as what I'm doing
yes
correct me if i'm wrong
but in a slightly different way
but when you do "PerlHandler -Foo" it removes the handle
yes, and that locationmatch only matches urls ending with a /
and when you do "SetHandler none" it resets the handle
yes
hmm, does that remove the directory handler?
maybe it does
that is were the flaw is ... by both yours and my def the perl-handle *should not* handle this request
but it does
Hello
Is anyone available that knows how to set up vhosts/redirects? I'm very confused by the documentation, as I don't think it covers what it is that I want to do.
what is it that you want to do?
what DO you want to do?
I own 3 domains
all point to my static IP address
and all http traffic is pointed to my apache server
but i want webmail.domain1.com to be pointed to another physical machine inside of my network
I was told that apache can do this
hmm
i don't know if that makes sense
does each box have a different ext ip?
no :|
lol
hmmm
www.transwarphub.com is one of the domains
one thing you CAN do is make them point to different directories, which is easy
on the same box though
fajita redirects
redirects is not working... look at this url for example: http://www.docweinstein.com/proc/lipo.html
fajita redirect
redirect is http://httpd.apache.org/docs-2.0/mod/mod_alias.html#redirect or http://httpd.apache.org/docs/mod/mod_alias.html#redirect or see 'Redirect
Context'
redirect is a href="http://httpd.apache.org/docs-2.0/mod/mod_alias.html#redirect"http://httpd.apache.org/docs-2.0/mod/mod_alias.html#redirect/a or a href="http://httpd.apache.org/docs/mod/mod_alias.html#redirect"http://httpd.apache.org/docs/mod/mod_alias.html#redirect/a or see 'Redirect Context'
hmm no thats not what you want
and 72.240.122.160 points to my machine on .204 inside the private network...
i want webmail.transwarphub.com
get another IP
to point to .202 inside the private network
uh you cant do that residentially, Marticus_
might be able to do a proxy?
mercutio*
sure you can
not cheaply
heh
i dont hink?
think*
I can get another IP address - but my router doesn't support it.
depends on the isp - some offer up to 5 free
oh nice
my ISP charges $20 per
heh
no huge deal.
i have comcast 6Mbps, comcast sucks tbh, the speeds okay though, dont know anything about extra ips
but anyway
but the router (Hotbrick LB2 Load Balancer) only supports one IP per WAN
new router then
all routers support it, you just have to understand how it works
anyone know where I can ask some questions about apache axis ??
you want different domains pointing to diff machines all on one network?
tyler2435 precisely!
right
that's exactly how i wanted to describe it
hmm
if your ISP allocates you more than one IP Address, they'll usually allocate you a block of 8, which go on the LAN interface, then they give you a special address to go on the WAN interface, with a specifig gateway to use
look into mod_proxy
fajita mod_proxy
mod_proxy is http://httpd.apache.org/docs-2.0/mod/mod_proxy.html or http://httpd.apache.org/docs/mod/mod_proxy.html http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
might be able to do something with that
ProxyPass /foo http://foo.example.com/bar
ProxyPassReverse /foo http://foo.example.com/bar
looks like redirect
anyone know how to stop this?
well you could do ProxyPass / http://10.1.1.1/
would pass all to 10.1.1.1 in theory
first, why is it redirecting?
you sure itd work internally?
hmm
i have no idea
tyler2435 can i message you?
i just moved my site to this host
We have all our ports locked down and use that to do just that
sure
i see
http://apache.pastebin.ca/601478
actually, i cant privmsg back
lol!
ive failed to stop being lazy and register
thanks... the prob is (i think) the way sethandler works
mk, so ...
this is how my proxy is set : http://rafb.net/p/72rYTn23.html
method not allowed ?
hmm
i haven't a clue, ipv4freely
damnit
hmm
i wonder how youd do it
btw that would not work... as you have not "SetHandler none"
Treader i want www.transwarphub.com to stay where it's at (.204 in private network)
i was thinking you could use virtual servers and redirect
but that wouldnt work
well
maybe it would
I want webmail.transwarphub.com to be forwarded internally to .202 in private network
etc
because the server that hosts my email also hosts webmail
you would set the proxy in each vhost
then setup http on each server so it can hadle the proxy
the problem is that once you set a perlhandler doing " PerlHandler -Foo" has no effect
Treader can i message ya?
nor does "SetHandler none"
sure
well, the one i posted tries to avoid setting perlhandler or sethandler
hmm
i don't know if it's ideal but it might work
that sounds good to me
kinda complicated
i think you'll have to add a check on PATH_INFO to the Rewrites
a little
but it should work
but I want the perl-handler to handle everything except request made to /phpbb , /blar, /promos
plus yours works well (looks better than the orig) but doesn;t solve the problem
hange on
hey peeps, i have in a vhost.conf file a rewrite rule and proxy pass that sends all requests to port 8000 which is my rails app, this was all well and good until I tried to access the webstats via www.domain.com/webstats/ which my rails application is trying to handle. Is there any way to create
exceptions to rewrites? i can paste what i have in vhosts.conf to a pastie if needed, im just a...
...little stuck and need some light
maybe it does
maybe i misunderstood the problem statement
around the perl stuff?
then you could ditch the rewrite stuff too
take a look at
[p]
[p] is a proxypass. See http://rewrite.drbacchus.com/rewritewiki/Flags_2fP
reverse proxy
reverse proxy is http://www.apachetutor.org/admin/reverseproxies
I'm not quite sure what it is you're doing wrong, but I'm pretty sure you are doing something wrong.
many thanks i will do now
the orig config works
its just for some reason it does not do dir listing
i think that sethandler none might defeat dir listings
what's the original config?
are you setting Options -ExecCGI or Options None?
None
http://apache.pastebin.ca/601382
and server is running mod_perl
yeah.. but Options None DOES affect indexes.. don't you think
yes
so what *should* I set it to
default-handler?
default-handler is 6already used for htdocs whether you tell it to or not.
set it to Options -ExecCGI
he's got an options +indexes in there
that should suffice.
oh.
ok
1 sec
what you need to do is to sethandler httpd/unix-directory but only for directories
suexec is evil
there's paranoia, and then there's suexec, whole different ballgame
sorry to be a pain, could i show you a copy of my vhosts http://apache.pastebin.ca/601513 i just want to be able to access www.ghmcc.co.uk/webstat/ without it being re-routed to the Rails server. I can see that the rewrite rule has a [p] already on
it so im a little lost should i create a new rule?
SetHandler httpd/unix-directory
in location Match
go ahead.
Oh
many thanks its http://apache.pastebin.ca/601513
I've got an .htpasswd file and .htaccess file per the direction at the bottom of http://www.howtoforge.com/server_monitoring_monit_munin (except they're in the same directory) and it's not doing any auth
the last line says proxypass reverse ...:80 --- that's wrong, I suppose...
sorry i just checked in the file the last line is 8000
According to DrBacchus, it should be ProxyPassReverse / http://www.ghmcc.co.uk:8000/
hi... after adding a module to apache - do I have to restart it or can I just graceful it?
sorry think i lost it in the pasting over from putty
you need to stop it and then start it
thanks
so the last / is there too?
jMCg yeah i will update the pastebin now
Options Indexes FollowSymlinks MultiViews -ExecCGI
where is that line?
and still no dir listings
the -execcgi in there will do nothing
jMCg that bit works fine all requests to ghmcc.co.uk go to the rails mongrel server. I just want certain bits not to
in LocationMatch it does nothing
i agree
yeah, i don't think the problem is options
esp as this is not a cgi
although it also needs to be right
why don't you just not enable mod_perl for the directories which are not perl
or, alternatively, enable it for the url prefixes which belong to it
Treader = a God - he should be opped!
that seems simpler, although possibly a bit more work.
ALL url's belong to mod_perl except 4 dirs
so it is the right way round right now
perl stuf /Location
perl stuff /LocationMatch
yes
blocks
i have just updated the pastie
great idea!
http://apache.pastebin.ca/601525
why don't you stick parts that you don't want to be proxied in a location match [or vice versa]?
why don't you stick parts that you don't want to be proxied in a location match [or vice versa]?
cheers will investigate
manby thanks
locationmatch
locationmatch is http://httpd.apache.org/docs/2.2/mod/core.html#locationmatch
many*
o/~
o/~ is anybody out there! o/~
listen i gotta go
but thanks so much for your input
very much apprieciated.
hope it helps
fajita mod_rewrite
mod_rewrite is http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html or http://httpd.apache.org/docs/mod/mod_rewrite.html or see http://rewrite.drbacchus.com/
I'm attempting to redirect a url with a query string, and can
't seem to get it going. my line is 'redirect /default.asp?item=1234 http://www.foo.com/bar/post123' - This isn't working, any suggestions?
if i have a rewrite rule that is forwarding all requests to port 8000 is it possible to add an exception into this rule?
RewriteCond?
RewriteCond is http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritecond
^
the query string is not part of the location being matched
fajita, query?
bugger all, i dunno, rici
many thanks guys will look at that now, didn't have a clue where to start
query?
The query is the part of the url starting with a question mark. RewriteRule and *Match directives only see the location, not the query.
Is there a way to restrict WebDAV to upload-only?
you'll have to use a rewritecond, although personally i'd rethink my url structure if i were you
What is the best solution for redirecting urls that contain location specific hostnames and query strings in the source. i.e. foo.bar.com/page?qs=1 to bar.com/bax/page_five, and doing a few thousand of them? I'm attempting to make permalinks work while we transition blog systems.
ah
use a rewritecond and a rewritemap
look the query string up in the map
Can I use a rewrite map to do the hostname redirects also? I have about 400 blogs on the old system, which uses per-blog hostnames and query strings. Can I use a rewrite map that is just as simple as a space seperated file of 'source urls' and 'destination urls' and have the rewritecond match
the entire url as a string?
yes
take a look at the variables available to you in RewriteCond
and read the RewriteMap docs
rewritecond
rewritecond is http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritecond
rewritemap
rewritemap is http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritemap or http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritemap or http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html#rewritemap or http://www.onlamp.com/pub/a/apache/2005/04/28/apacheckbk.html
Thanks rici, I'll go hit the docs.
After moving my apache from having a wan ip to being behind a nat firewall with a nat ip
Invalid method in request \x80\x80\x01\x03\x01
when i try to access it
what coudl be wrong?
you're handling an ssl request with a non-ssl enabled vhost
but it worked fine when it had the wan ip, what coudl ahve changed
the hostname is the same
your ssl config is wrong, i guess
SSLEngine
SSLEngine is http://httpd.apache.org/docs/2.2/mod/mod_ssl.html#sslengine http://httpd.apache.org/docs/2.0/mod/mod_ssl.html#sslengine
block
theres an ip number
yes
not in mine
it has to be the ip number which apache sees
ahh i know
there is a hostname
and it resolves to a lan locally, and a wan externally
but the apache server is using external dns servers, that could be whats wrong
split horizon dns is full of little traps
hmmm
if i dont want to use virtualhosts anymore
whats the easiest way to convert my virtual host block to a "default" or * block
that will be active for anything send to apache
ok i have been reading up now on rewritecond and from what i can gather if a condition is met before a rule it will execute the rule. So the next part in my quest is to find out how i can get it to execute the rule if the request_uri isn't equal to www.domain.com/webstat/, will this involce
regular expressions in the condpattern?
invoice?
invoke? involve?
I just added multiviews to my apache conf because I have my site in 2 languages (english and danish). Is there anything I should be concerned with regarding googlebot and other crawlers?
_E-bola: Virtualhost *:80, and don't use NameVirtualHost
the order of rewriterule/rewritecond is a bit odd
i need some help with RewriteRule...
first the rewriterule pattern is checked. if it passes, the rewritecond(s) are executed
yeah i think im getting myself very confused
if they succeed, then the rewriterule's substitution is performed
why does this don't work? RewriteRule ^([a-z]{2})-([a-z]{2})/(.*) /$1-$2/$3/ [R]
consequently you can use captures from the rewriterule in the rewriteconds and you can use captures from the rewritecond in the rewriterule substitution
rici, wow my head is hurting now very much i thought i had it for a second lol
RewriteRule ^([a-z]{2})-([a-z]{2})/test /$1-$2/test/ [R]
read that three times and then go to work
rici hehe yeah i think i may just explode and cry
it's only three lines
Roobarb-Work: thanks that did the trick
i still dont understand how using wrong ip's/hosts can give ssl problems
but ohh well atleast everything is working again
so say i have a request to my site domain.com this will be checked in the rewrite rule(the rule is to forward all requests to port 8000) then if there are any conditions before the rule, say if "domain.com/webstats/" is the full request and there is a condition stating that requests to this url
shouldn't be forward to port 8000 it wont forward it?
sorry im just trying to get it in my head
the rewriterule only matches the location
rici ahh so just domain.com?
if you have a rewriterule which matches anything then the match will trivially succeed
no, just the part after the server and before the query
and then move onto the conditions?
(scheme) //foo.com (host) /foo/bar.html (location) ?act=3 (query)
the rewriterule only sees the location part
ahh i see
the rewritecond has access to everything, through various variables
i want it to not re-route to a particular location then i take it domain.com/webstats/
--gone
its making more sense now
Can i filter some keywords being posted to forums which runs on apache ?
gonna take a lot of fiddling about though till i crack it
I mean by doing that it will work for all hosting sites
I'm reading through the onlamp article you sent me to and I'm trying to use the most basic example, which although basic should work. The only thing I've changed from the example is that my map has fully-qualified urls in both fields, and my rule is 'RewriteRule ^(.*)$ ${blogs:$1} [R,L]',
however this is not working and I'm not exactly sure what is failing. How can I better debug this? Can I use a single map file to do what I'm trying to d
see what i just said to matt1982:
about six lines up, about what rewriterule sees
you'll need to use a rewritecond
hi all
All is not in today, furibondox
ty
sorry.. i've a problem like this
make_sock: could not bind to address [::]:443
i use plesk on centos
plesk is cool
usually that means apache is already running or that you weren't root when you started it
hi all
All is not in today, dokma
Can I concatenate HTTP_HOST and THE_REQUEST to create my 'source' in order to match?
sure
not THE_REQUEST
i'm root and apache is stopped before i started it
but you can do an arbitrary concatenation
my apache server just started hogging my bandwidth on my home machine, some bot obviously found me or somethings. is there a way to find what is sucking my bandwidth and ban that ip?
I see why I wouldn't want THE_REQUEST, but does REQUEST_URI include the query string arguments?
no
duh, I've found what it is
it was me downloading something from another machine lol
the process left hanging
and kept on sucking my bandwidth
at least, i don't think so
but QUERY_STRING is available
http://apache.pastebin.ca/601634 Here's the error logs of my trac/fcgid/500
thanks. I'm still digging/learning. What is the syntax to concatenate in mod_rewrite/ will this work to verify that host, uri, and query string exist: RewriteCond %{HTTP_HOST}%{HTTP_URI}?{%QUERY_STRING} !^$
they exist, you don't have to check that
what you want to do is pass them into a rewritemap
rewritecond (%{mymap:...}) .
why the ()
the . is to check that there is at least one characcter in the substitution
so that you can refer to %1 in the rewriterule
RewriteCond %{HTTP_HOST}%{HTTP_URI}?{%QUERY_STRING} ^(.*)$
oops, you're right, i got it wrong.
more coffee is needed
but put the map on the lhs
wouldn't the map go on the next line?
the last part is b0rked.
it's supposed to be ?%{Q...G}
you can put the map in the rewriterule, too
oh, yes. ty.
I know that the map goes in the rewriterule, but I have to use the RewriteCond to create the $1 in order to match, yes?
the %1
the %1 is the match in the RewriteCond?
but you might also want to check in the rewriterule whether there was a match
s/rule/cond/
damn, my brain is sloppy this morning.
sec, i have a real example
ty.
huh?
oh yeah...
are you a bot?
No, I just type really really fast.
http://wiki.apache.org/httpd/Recipes/Different_UserIDs_Using_Reverse_Proxy
look at the section "alternative proxy configuration" at the bottom
there's a rewritecond and a rewriterule
the rewritecond lowercases the hostname, then looks it up in a map, and succeeds if the map returned a non-empty string
then the rewrite rule uses the %1 from the rewritecond
yours would be similar but you'd want to match more than just the host
and you might not want the [P], dunno
can I lowercase multiple variables at once?
you can lowercase a concatenation
thats great. thanks for the example, I didn't know there was an apache wiki
the rewritemap format is %{mapname:whatever}
can be any concatenation
or even a nested map expansion
%{mymap:http://%{lower:%{HTTP_HOST}/%{REQUEST_URI}}}
for example
does graceful not reload the php configuration?
should.
maybe you're a victim of
browser cache
Browser caches can be very persistent. Restarting the browser, or even rebooting, will not necessarily clear the cache. You must expressly clear the cache via the menus.
i have a problem where my modwrite its affecting my redirects
well... duh!
I use a modwerite to change xxxxx.html into ?page=xxxxx, but i need to specifically redirect a couple specific links, but something is getting messed up
is the problem that the modrewrite matches first, and the redirects dont run?
Ahrmpf
There's a [flag]
rewrite flags
rewrite flags is http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriteflags
[pt]
[pt] is pass through to next handler
RewriteRule ^([a-z]{2})-([a-z]{2})/($*)$ /$1-$2/$3/ [R]
i want to redirect /country-language/something to /country-language/something/
$*
did you mean .*
what context is that rewriterule in?
yes i mean .*
jMCg, am I looking for the [PT] flag?
context?
context is http://httpd.apache.org/docs/mod/directive-dict.html#Context http://httpd.apache.org/docs/2.0/mod/directive-dict.html#Context
http://httpd.apache.org/docs/2.2/mod/directive-dict.html#Context
isn't that a no-op?
how are you changing the original url?
?
i want to redirect /country-language/something to /country-language/something/
yes
in other words, "change x to x"
well
i read [pt] and it makes sense, but i dont get it completely. so it rewrites the rule, but if something else matches the original it will still fire the redirect?
RewriteRule ^([a-z]{2})\-([a-z]{2})/(.*)$ /$1\-$2/$3/ [R]
RewriteRule ^([a-z]{2})\-([a-z]{2})/(.*)/$* /$3/index.php?country=$1&language=$2
second rule works
hi
niihau, elshaa.
i used to have it like this:
# software
RewriteRule ^([a-z]{2})/software$ /$1/software/ [R]
RewriteRule ^([a-z]{2})/software/$* /software/index.php?language=$1
but i wanted to make a more generic rule
how can I protect the access of a directory that is under DocumentRoot ? (I'd like to have a "Forbidden" without prompting for any password ?
the result of the first rewriterule in your original will not again trigger that rule when it's redirected
however, your new rule will
so you'll get a redirect loop
k
rici, can you explain how the PT works exactly?
can i avoid that somehow?
no, it's heavy-duty voodoo
but approximately, it does the rewrite and then lets other modules play with the result
yes, by being aware of the exact transformation you want
if you redirect in a rewriterule, make sure the result cannot be matched by the rule
I think if can also hapen that other RewriteRules get to play with it.
that is always possible unless you specify [L]
i don't see an easy solution tough
yes, putting Last
(that's what L is right)
try something like (.*[^/])
"match any string which doesn't end with a /"
ah
that's what i need
whether that counts as easy or not depends on your perception
but it's certainly short
btw
someone told me i needed to escape hypens
not in substitutions
*hyphens
k
seems weird to me still tho, say the modrewrite changes xxxx.html to index.php?page=xxxx. With the PT can I redirect sitemap.html, or will the modrewrite still mangle it so the redirect wont work?
well thx for the help, all working now
if you want to redirect sitemap.html, do it with a rewriterule before the one which changes xxxx.html
and use [R,L]
http://128.128.2.11/c/portal/layout?p_l_id=PUB.1013.(anything after this) into http://128.128.2.11/c/portal/layout/p_l_id=PUB.1013.(anything
after this) or http://128.128.2.11/c/portal/layout/p_l_id/PUB.1013.(anything after this) ... I've currently been working with http://apache.pastebin.ca/601714 ... any
suggestions?
i wanted set sitemap.html to 404 error actually, i need to redirect a few other pages.
but I could add a modrewrite rule that matched sitemap.html exactly, if I rewrote it sitemap.html, and use PT, would redirect then match and do it?
or then the next modrewrite would re write it again
arg
where can i found one book/pdf/howto/etc about apache high performance and tuning?
you don't need PT. you do need L
don't use redirect and rewrite
do the redirect with rewrite
how can i change the order of 2 .conf files so that i change the default virtual host?
include foo.conf // include bar.conf
or do it the debian way
000-foo.conf 001-bar.conf
apache will order em by the number prefix?
personally i prefer explicitly including the default conf and then including the rest
include conf.default // include *.conf
gotcha
make sure the default filename doesn't match the glob
what do you mean by the glob?
glob=
glob?
glob is a typo from blog
argh
*.conf is a glob
any suggestions?
Hello, I installed apache runs fine on 8080 but noone else can see it if they go to my ip:8080, and i have portforwarded :s
so a rewrite rule can redirect? I see, so rewrite sitemap.html to redirect, and on that rewrite rule use [L] ?
[R]
[R] is a redirect
[R,L]
go for a Proxypass
redirect + last
Proxypass?
Proxypass is http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#proxypass
maybe a ProxypassReverse as well
how do you open a tail of a log file in unix?
is that a tricky question?
`tail file`
wow that is complicated.
my line RewriteCond ${blogs:${lowercase:%{HTTP_HOST}%{HTTP_URI}?%{QUERY_STRING}}} (.+)
after the host
where do i put the proxypass
oh, sorry, my mistake
yeah, that looks right
in your map
doesn't seem to ever be matching (sorry bout the CR). It works when I drop the ?%{QUERY_STRING} (but of course doesn't match any of my map lines with query strings) anything obvious? -- yes I dropped http:// from the map file.
Can you fix my issue... with my apache conf
what?
the problem is that it always put in a ?
http://whatever.com/c/portal/layout?p_l_id=PUB.1013.(anything after this) into http://whatever.com/c/portal/layout/p_l_id=PUB.1013.(anything
after this) or http://whatever.com/c/portal/layout/p_l_id/PUB.1013.(anything after this) ... I've currently been working with http://apache.pastebin.ca/601714 ... any
suggestions?
what do you mean?
you meant REQUEST_URI didn't you?
i take it that when i want to enable a module in apache2 i copy it from /etc/apache/mods-avaliable to mods-enabled?
personally i wouldn't lowercase everything, unless your map is all lowercase and that's really what you mean
link it, rather
yes, exactly, thank you.
but the issue i was referring to is that the string being passed to the map will be, for example:
www.jaga.com/whatever?
not www.jaga.com/whatever
Quick question
Don't announce it. Just ask it.
which is probably what's in your map
Where can i go to download a set of forums that will run on apache server?
phpbb
well can anyone tell me if a reqwrite base can be something like /xyz/xyz or */xyz ?
I have the ? marks in my map, so I'm looking for the former. This is working pretty well for me now with one exception. If a request comes in with a query string, it gets the appropraite match but the original query string is still appended to the redirected url.
can I check out your script?
yes, that would hapen
hmmm
can't you add a cond to separate the case of an empty query string from the other case?
http://apache.pastebin.ca/601739
You might help me out
I don't think it is actually a problem, the user still gets the data they are looking for and it is an html page that they get redirected to with the extraneous query string... I'm not sure that I care
i don't see a flag to delete query strings
ok, if it's not a problem, that's cool
thanks so much for all of your help.
found it
"When you want to erase an existing query string, end the substitution string with just a question mark."
the docs are great
so can I use a rewrite map to just change the values I need?
in the rewrite rule?
which log file stores the date at which apache is stopped and started?
yep, in the rewrite rule. that works
yah
ty
i am trying to block some programs that are trying to download my entire site
i just came across this user agent:
"Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98)"
robots.txt
robots.txt is http://www.robotstxt.org or A file which nice robots/spiders request in order to tell them which parts of your web site they may or may not index.
but some ignore this
yes
httrack honors it i believe
it's certainly a good first step
RewriteCond %{HTTP_USER_AGENT} ^httrack$ [NC,OR]
i tried this in my apache conf but it doesn't appear to work
No, I don't imagine it would.
Remove the ^ and the $ and it might.
i still think you'd be better off with a robots.txt file (maybe as well)
Have you looked in the access log to see what user agent it actually reports?
if the robot honors robots.txt it will go away and stop bugging you
Yes, that would be the better solution.
that cuts down on bandwidth a lot more than not telling them to go away and then rejecting every request they send
rewritecond
rewritecond is http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritecond
i love you guys
i pulled it off
apache is successfully reverse proxy'ing an SSL tomcate page
too bad i don't have login credentials to actually test it
but this is good enough for me
Next question
PhpBB - Japanese language pack = where?
over at phpbb's site mebbe?
o.O
nope
even though their forums make mention of a japanese lang pack...
google phpbb japanese language pack
http://forums.vtiger.com/archive/o_t__t_11516__japanese-language-pack.html
heh
negative
well, looks like you're up shit creek
:P
so you are reverse proxying target which is https site? is connection between your server and the client encrypted? or do you play man in the middle?
hmmm ... even if I knew if I was on that right or wrong track it would be nice
bhmmm ... even if I knew if I was on that right or wrong track it would be nice/b
lamp, dude, i'm just the sys engineer
i don't care
i'm happy it works
:P
so the sys engineer is just happy it works
yay
lol
Having rewrite issues
can you be more specific?
where would the fun in that be? :P
Well, I'm trying to wake up, and an interesting rewrite challenge might do it for me.
we'll see
decrypting the trafic between server and client is little suspicious. At least I would high doubts towards a service/server that does it. But as I don't know the details..
http://whatever.com/c/portal/layout?p_l_id=PUB.1013.(anything after this) into http://whatever.com/c/portal/layout/p_l_id=PUB.1013.(anything
after this) or http://whatever.com/c/portal/layout/p_l_id/PUB.1013.(anything after this) ... I've currently been working withhttp://apache.pastebin.ca/601730 ... any
suggestions?
there ya go
So you're effectively converting the ? into a / in that URI?
lamp, both the conn to the revproxy and from the revproxy to the tomcat server are encrypted
yeah trying to so I can run some Location Directives against it
So first of all, (1)$(.*) doesn't mean what you think it means. Although I have no idea what you think it means.
$ means "ends with" so $ followed by (.*) is going to get ignored.
I was hoping it (1)$ made a variable
anyone got time to help me with an obscure problem?:s
So you probably want to replace (1)$(.*) with just (.*)
() captures something into $1. The next () captures $2 and so on.
So, just the existence of () makes a variable.
Other than that, it looks like what you have will mostly work.
ah... cool... thanks testing now
Well, actually ...
The ^$ in the RewriteRule is also incorrect.
One more thing ...
^/portal/layout means "starts with /portal/layout"
I don't think that's what you want.
I think you want ^/c/portal/layout
I have three files AddTrustExternalCARoot.crt, NetworkSolutions_CA.crt and UTNAddTrustServer_CA.crt. Anyone know if I can combine them into a SSLCertificateChainFile file?
And then the ^$ in your RewriteRule can just be a . or perhaps a ^ or something else inocuous.
Can I just copy / paste them into one order in a particular file?
^$ means "empty string"
Which is certainly not what you mean.
Yep so effectively ^ and $ is NOT whatever comes before and whatever comes after ...
Something more like http://apache.pastebin.ca/601775
^ means "starts with" and $ means "ends with"
So ^$ means "starts with nothing, followed by nothing, ending with nothing.
thank you soooooo much
Hopefully a little more has sunk in
Or ... if you wanted to make this a little more efficient ...