Re: [users@httpd] Apache Virtual Host not working properly

2017-12-30 Thread Marat Khalili
> For the second question, for sure it's not the application because I ever use 
> the same app before but i didn't get the problem [...]

Try to set ProxyPreserveHost
-- 

With Best Regards,
Marat Khalili

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Apache Virtual Host not working properly

2017-12-30 Thread Noor Mohammad
For the second question, for sure it's not the application because I ever
use the same app before but i didn't get the problem, in fact the
application i'm using is Apache Marmotta, there is docker image already so
I am using their docker image,
http://marmotta.apache.org/installation.html#docker



‌

On Sat, Dec 30, 2017 at 10:02 PM, Eric Covener  wrote:

> On Sat, Dec 30, 2017 at 3:30 PM, Noor Mohammad 
> wrote:
> > I have an application running at http://localhost:6512 and a virtual
> host
> > definition as follows:
> >
> > 
> > ServerName ldpmarmotta.example.com
> > ProxyPassMatch ^/(.*)$ http://localhost:6512/marmotta/$1
> > 
> > I am getting two problems with the above definition:
> > 1. All traffic to this server including http://example.com is being
> directed
> > to http://localhost:6512
>
> The first vhost for *:80 acts as a catch-all
> https://httpd.apache.org/docs/2.4/vhosts/name-based.html
>
>
> > 2. A request to http://ldpmarmotta.example.com is being directed to
> > http://localhost:6512. I was not expecting the URL to change but the
> > response to return on http://ldpmarmotta.example.com,
>
> Hard to guess the source. Maybe it's the backend app. See ProxyPassReverse
>
> -
> To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
> For additional commands, e-mail: users-h...@httpd.apache.org
>
>


Re: [users@httpd] Apache Virtual Host not working properly

2017-12-30 Thread Eric Covener
On Sat, Dec 30, 2017 at 3:30 PM, Noor Mohammad  wrote:
> I have an application running at http://localhost:6512 and a virtual host
> definition as follows:
>
> 
> ServerName ldpmarmotta.example.com
> ProxyPassMatch ^/(.*)$ http://localhost:6512/marmotta/$1
> 
> I am getting two problems with the above definition:
> 1. All traffic to this server including http://example.com is being directed
> to http://localhost:6512

The first vhost for *:80 acts as a catch-all
https://httpd.apache.org/docs/2.4/vhosts/name-based.html


> 2. A request to http://ldpmarmotta.example.com is being directed to
> http://localhost:6512. I was not expecting the URL to change but the
> response to return on http://ldpmarmotta.example.com,

Hard to guess the source. Maybe it's the backend app. See ProxyPassReverse

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[users@httpd] Apache Virtual Host not working properly

2017-12-30 Thread Noor Mohammad
I have an application running at http://localhost:6512 and a virtual host
definition as follows:


ServerName ldpmarmotta.example.com
ProxyPassMatch ^/(.*)$ http://localhost:6512/marmotta/$1

I am getting two problems with the above definition:
1. All traffic to this server including http://example.com is being
directed to http://localhost:6512
2. A request to http://ldpmarmotta.example.com is being directed to
http://localhost:6512. I was not expecting the URL to change but the
response to return on http://ldpmarmotta.example.com,





‌


RE: [users@httpd] Problem with CGI script

2017-12-30 Thread mahmood n
>You need to scope the SetHandler/AddHandler to just the things that
>are actually CGI.  Check the manual.

If you mean this topic (https://wiki.apache.org/httpd/DirectoryAsScript) , I 
already have read that. But don’t know how to apply that to my case.

Currently, I have

Options FollowSymLinks Indexes ExecCGI
AllowOverride None
Order allow,deny
Allow from all


SetHandler cgi-script
DirectoryIndex index.cgi
Allow from all



According to that document,  I have to replace ScriptAlias  with something 
else. However, I don’t have such thing! So, I changed that to


AddHandler cgi-script cgi py
Options FollowSymLinks Indexes ExecCGI
AllowOverride None
Order allow,deny
Allow from all


SetHandler cgi-script
DirectoryIndex index.cgi
Allow from all



But the error is still present.
Please let me know which document do you mean.

Regards,
Mahmood





Re: [users@httpd] Problem with CGI script

2017-12-30 Thread Eric Covener
On Sat, Dec 30, 2017 at 9:49 AM, mahmood n  wrote:
>>Missing SetHandler cgi-script or similar.
>
>
>
> I added “SetHandler cgi-script” above the DirecotryIndex. The web browser
> now seems to work fine as I don’t see the traditional folder structure.
>
>
>
> What about messages like this in the error.log
>
>
>
> [Sat Dec 30 18:10:14.142417 2017] [cgi:error] [pid 20329] [client
> 37.33.62.129:50963] attempt to invoke directory as script:
> /var/www/html/rocks/7.0/install/rolls/hpc/


You need to scope the SetHandler/AddHandler to just the things that
are actually CGI.  Check the manual.
>
>
>
>
>
> Regards,
>
> Mahmood
>
>



-- 
Eric Covener
cove...@gmail.com

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[users@httpd] Writing and debugging Apache modules on a macOS with preferably Docker containers.

2017-12-30 Thread Roy Teeuwen
Hey all,

I was wondering if any of you have any guidelines on what is the easiest way to 
write Apache modules on a macOS?

I currently only have experience in Java / C# but I would like to try out 
writing a custom module. My C experience is from 10 years ago when I helped 
IRCd daemon and IRC services, so it has been a while. I also found some 
tutorials that it would be possible to use C++ too to write them, so maybe that 
would be easier seeing that my last years have been OOP mainly.

The things I want to try out:

- Use either Netbeans C/C++ or Jetbrains CLion to write the module on a mac.
- Preferably run the Apache on a docker container as to have a clean Apache 
instead of the system one from macOS.
- Be able to (remote) debug the Apache module from the visual editor. It is 
this last step that I am mostly asking any guidance for, is this even plausible?

Thanks!
Roy


signature.asc
Description: Message signed with OpenPGP


Re: [users@httpd] Using environment variables in mod_substitute

2017-12-30 Thread Roy Teeuwen
Hey Nick,

Hmm if I read the documentation, then proxy_html is specifically meant for 
rewriting urls when doing a proxy, but I can indeed see how you could make it 
work as a sort of hack though:

ProxyHTMLInterp On
ProxyHTMLLinks script nonce
ProxyHTMLURLMap token ${UNIQUE_ID} V

In this situation the nonce attribute would have to be already in the html from 
the application, with possibly a token to be able to match it.

Greets,
Roy


> On 30 Dec 2017, at 01:36, Nick Kew  wrote:
> 
> On Fri, 29 Dec 2017 22:39:11 +0100
> Roy Teeuwen  wrote:
> 
>> - I have an application which generates static HTML pages, that are
>> cached by a custom apache http module.
>> - I want to start implementing CSP 3 headers by using a nonce to put
>> on all the inline script tags.
> 
> If the job is to rewrite something specific in HTML pages,
> mod_proxy_html could be another option.  You get a markup-aware
> parser, as opposed to a simple match-and-replace in
> the modules we've mentioned.  Though that'll depend on what
> works best with your application and your custom module.
> 
> --
> Nick Kew
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
> For additional commands, e-mail: users-h...@httpd.apache.org
> 



signature.asc
Description: Message signed with OpenPGP


RE: [users@httpd] Problem with CGI script

2017-12-30 Thread mahmood n
>Missing SetHandler cgi-script or similar.

I added “SetHandler cgi-script” above the DirecotryIndex. The web browser now 
seems to work fine as I don’t see the traditional folder structure.

What about messages like this in the error.log

[Sat Dec 30 18:10:14.142417 2017] [cgi:error] [pid 20329] [client 
37.33.62.129:50963] attempt to invoke directory as script: 
/var/www/html/rocks/7.0/install/rolls/hpc/


Regards,
Mahmood



Re: [users@httpd] Problem with CGI script

2017-12-30 Thread Eric Covener
Missing SetHandler cgi-script or similar.

On Sat, Dec 30, 2017 at 6:14 AM, Mahmood Naderan
 wrote:
>>DirectoryIndex contains a list of files to try, not a full path.
>>My guess is that it's supposed to be
>>DirectoryIndex index.cgi instead of the path.
>
> Well I change that to "DirectoryIndex index.cgi", however
> by visiting the url from the web browser, I see the content
> of index.cgi as a plain text.
>
> Any idea?
>
> Regards,
> Mahmood
>



-- 
Eric Covener
cove...@gmail.com

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Problem with CGI script

2017-12-30 Thread Mahmood Naderan
>DirectoryIndex contains a list of files to try, not a full path.  >My guess is 
>that it's supposed to be >DirectoryIndex index.cgi instead of the path.
Well I change that to "DirectoryIndex index.cgi", howeverby visiting the url 
from the web browser, I see the content of index.cgi as a plain text.
Any idea?

Regards,
Mahmood