Skip to main content

Posts

Showing posts with the label apache

How to put different host entries on same linux server, for different virtual hosts? [closed]

The setup is : Two applications are hosted on same linux server using vhost entries in apache configuration. say : http://greatapp.example.com and http://superapp.example.com Both of them have a functionality where they do server side http request to a third url (using php cURL / file_get_contents) : http://apis.example.com Now there is a host entry of an in the hosts file '/etc/hosts' xx.xx.xx.xx apis.example.com This is only intended for greatapp.example.com code, and not for superapp.example.com. How to configure the server such that greatapps.example.com uses the host entry, but superapp.example.com uses the public ip of apis.example.com

java output missing for cgi

In apache server,I want to use java to output something to the client,here's the java code public class Compile { public static void main(String[] args) { System.out.println("Hello world"); } } it just simply output a hello world,then I compiled it an copy Compile.class to server's root.there is also a cmd file there(the OS is windows),the compile.cmd @echo off echo Content-Type: application/x-javascript echo. echo start java Compile it has been good so far,if I execute it in command line the "hello world" will be shown. in apache's config file ExecCGI has been on and AddHandler cgi-script .cmd also been added. however,by visit [http://localhost/compile.cmd,only "start" displyed,the java's output "Hello world" disappeard.I can't find why the same problem can be fond here http://www.gossamer-threads.com/lists/apache/users/189828

How to detect Outgoing links (apache,php..)

I'm developing a website, but stuck at some point, where i needed to detect outgoing links on my website, and either forbid the links, or accept that, i don't know how facebook is doing this, but they can do it through facebook.com/l.php that if the link is marked spam, users will get notified about it. I don't know if that's a php or htaccess, it worked in php using the DOMDOCUMENT, but it's not a real solution for this.