Netbeans project 404 + apache localhost XAMPP - apache

I've created a web project in Netbeans. When I run it, it starts a glassfish server, and everything works fine (I don't understand why or how, but it works).
I also have XAMPP installed on my mac. I copied my netbeans project folder to my user sites folder, and ran my apache server with XAMPP.
I can access the sites index, but whenever I try to use a servlet, I get a 404, object not found.
Does this have something to do with glassfish web xml file? Servlet Mapping? Is there a new apache web xml file that I must create for it to work on apache server?
I can paste code if you need it.
Thanks!!!

Apache Server is for php based application and for running java based web project you have to install apache tomcat or glassfish as you have done previously where the servlet container is available.

Related

Does file copy deployments work with CakePHP?

I have a legacy CakePHP(1.3.13) app, running on Ubuntu server 16.04, on apache. It is using php 5.6. I'm trying to migrate the app to a development server, also Ubuntu 16.04, but running php 7.2.
On the production machine, php file(s) are being executed even before line 1 of index.php in the app I'm trying to migrate. On the dev box, this isn't happening.
I've sudo tar'ed the entire web server tree, and sudo untar'ed it on the dev box. I've copied the apache site configs, and only edited them for hostnames.
I don't understand why apache is running one or many php files PRIOR to running index.php on the production box. It is apparently loading a custom configuration php file, that sets up some global variable, but for the life of me I can't figure out why this is happening. I'm sure I'm just missing something dumb.
Greg Schmidt nailed it. There was a second auto_prepend_file=MagicallyExecutingScript.php in the php.ini.

Howto run mod-mono and php on same apache webserver

I've successfully implemented mod-mono and apache webserver on a Centos 8 distro.
I've also installed PHP 7.2 on the server and the configuration looks ok on eye inspection.
However, the webserver is not executing the PHP files, but serving them for download.
If i go to http://example.com - it runs the website in MONO space
If I go to http://example.com/info.php - it gives me the PHP file for downloading. It makes me think that it tries to run the php file through mono and fails, so gives it to me for download instead forwarding it to PHP for execution.
Is it possible to run both PHP and MONO code on same apache webserver?
If yes, what could be the tricks to have it working ?
Many thanks.
Actually having a separate PHP website and also MONO websites in same apache server was working. However I though things were not working since I tried to run the PHP file from within the MONO-handled virtualhost ... so no need for clarifications.

The http://localhost:8080/axis2 link does not work

Hello fellow programmers,
I have to get axis2 (version 1.7.2) working in Tomcat (version 8.0.33) but here I encounter a annoying problem. I have followed the steps in the tutorial (from the axis.apache website) until the point of checking the link mentioned in the topic title.
I have downloaded the Axis2.war file and placed it in the webapps folder in the tomcat home directory (/opt/tomcat).
When I start tomcat using the startup.sh file and visit the homepage it all seems to work. visiting the link http://localhost:8080/ will show me the text:
It works !
If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations! etc etc
But then when I visit http://localhost:8080/axis2 I get:
HTTP Status 404 - /axis2
type Status report
message /axis2
description The requested resource is not available.
Apache Tomcat/8.0.28 (Ubuntu)
When I run the .startup file and at the same time look at my webapps folder I see that the .war folder is extracted and makes the axis2 folder appear, thus it works until there at least.
Does someone has an idea of what could be wrong here?
PS: I am using Ubuntu.
if your deploy axis2.war, port must be the same at the Apache Tomcat and Axis2 8080, check file tomcat_dir\conf\server.xml

JSP file is served as plain/text, when TOMCAT is behind an APACHE server

I'm running in a strange problem. I have a project based on MAVEN. When I run the project directly from my computer for testing it, using mvn tomcat7:run, my website display is correct. When I upload it to my distant Tomcat server, that is accessed through the JK Apache Tomcat connector, the JSP page is served as a text file. In response headers, I can see Content-Type:text/plainwhich is almost strange, and I'm suspecting the Apache server is adding it because of some erroneous configuration.
Any idea where to look, to fix this problem ?

Change docBase for apache tomcat in Netbeans

I have tried changing the docBase (with the help of several tutorials for serving static images from outside WebApp)of the Apache Tomcat installed by Netbeans, but till now no luck for me and getting 404 error.
<Context path="/WebApp/images" docBase="C:\\Users\Digvijay\Pictures\SAB" />
I am using windows.
I am not sure if there is some other way to configure Apache Tomcat installed by netbeans.
By the way below are the links for the solutions I tried
Simplest way to serve static data from outside the application server in a Java web application
Mapping a directory outside the web-app to URL in TOMCAT
Following steps works for me (NetBeans 7.3) ...
Select "Services" tab in NetBeans (top-lefthand box)
Right-click "Servers :: Apache Tomcat " and select "Edit server.xml" item
Put content as described in links and save file
Right-click "Servers :: Apache Tomcat " and select "Restart"