NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Need help

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
yuvi2288



Joined: 13 Aug 2010
Posts: 1

PostPosted: Fri Aug 13, 2010 12:39 pm    Post subject: Need help Reply with quote

Hello all,

I am Netbeans IDE to develop java and php.

But php runs only on apache http server and java runs on tomcat server.
In order to run both codes, I connected apache server2.2 and tomcat 6 with tomcat connector.

It is documented that when we run php, it is run in apache server and in case of java, the apache server forwards the request to tomcat to handle java.

But when we run the java file using run command in Netbeans, It works but not php. Because in order to run in apache http server, we have to save the project in htdocs folder inside the apache installation directory.

Please help me to run php using apache server through Netbeans..

Thanks and Regards,

yuvi
Back to top
mdeggers



Joined: 28 Jan 2009
Posts: 208

PostPosted: Fri Aug 13, 2010 5:17 pm    Post subject: Reply with quote

You might want to try enabling public directories in Apache in order
to ease PHP development. Do not do this on a production server
since it is a potential security risk (revealing user names, posting of
malicious web applications).

In Apache's httpd.conf (or an include file), add something like:

Code:
LoadModule userdir_module modules/mod_userdir.so
<IfModule mod_userdir.c>
    UserDir Public
</IfModule>


To restrict access a bit:

Code:
<Directory /home/*/Public>
    AllowOverride FileInfo AuthConfig Limit
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit GET POST OPTIONS>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS>
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>


Adjust paths and directories to suit your environment. This is on a
Fedora 13 system.

Now, when you deploy a PHP web application from NetBeans
locally, you need to set your deploy directory to:

/home/[user-name]/Public/[application-name]

And the URL to access the web application to:

http://localhost/~[username]/[application-name]/

Change [username] and [application-name] to fit your installation.

Note that if you're running under SELinux, this will cause all sorts
of warnings. I cannot remember the right SELinux settings at the
moment.

I imagine you can use mod_rewrite to get rid of the ~[username],
but this could create conflicts on a multi-user system. It's probably
best to use relative URLs.

. . . . just my two cents.

/mde/
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo