Impossible to access another port with curl and php - php

I'm trying to use basic authentication with curl and php to access Pentaho server. I'm using XAMPP on port 81 and Pentaho on port 8080.
The problem is that it searches Pentaho on port 81. I have tried both adding the port after the host (localhost:8080) and using the curl option (curl_setopt($ch,CURLOPT_PORT, 8080);).
If I access any other URL, it works.
I think it only works with the default port 80 and the current port (in this case 81), but not with the rest. How can I change the configuration to work with a port other than the default?
Edit: I don't want to change the Pentaho's port. What I want is to make CURL works with the specified port.

if you are using pentaho bi server with the bundled tomcat, you can change the port pentaho is running on in biserver-ee/tomcat/conf/server.xml. the port number next to protocol="HTTP/1.1"
if that's not what you are trying to do, please can you be more specific in the question?

Related

How to run both Microsoft IIS and WAMP on the same PC via localhost

I have recently enabled IIS by going to the Add/Remove Programs option in the Windows Control Panel and enabled IIS via the “Turn Windows features on or off” checklist.
I also want to install PHP for Windows on the same laptop and have downloaded XAMPP but I have yet to actually install it. Is it possible to do this and run them both from http://localhost/ - or is that not possible?
If so, great stuff... but if not, can you please give me some helpful pointers on how to achieve both IIS and PHP/MySQL running locally from the same PC?
You can have multiple servers on one physical machine, but you can only have one server running on one port. The default HTTP port is 80 and the default HTTPS port is 443. If IIS is running on 80 & 443, then WAMP will have to run on another port, and vice-versa. To access web servers on another port, you use the address http://localhost:PORT.
To change the ports of either web server see these questions:
How to change port number for apache in WAMP
How do I Change IIS Express 8 port 80 to 8080
In theory, it is possible to run two different web servers in the same machine. The only trick you need to consider for this is adjusting the reach points which are ports.
So the answer of your question is both yes and no. You can run them together in your localhost but if you want to access them both from http://localhost/ it is not possible. you need to provide the ports they've using to do that like http://localhost:5000/
To achieve this, you just need to adjust some settings files in your XAMMP etc. Change the default port and it should work.

server running IIS and Apache: setting up SSL

One of my clients have a server running both IIS and Apache. IIS is on port 80 and Apache is on port 8081. I am working on an application that will be running on Apache and this application needs to be configure so that it uses SSL.
The client already purchased the SSL certificate from Godaddy but when trying to generate the CSR file, it asks for certain information like the Common Name (fully qualified domain name, or URL, you are securing. I am having from with this particular section: Common Name.
The application's URL is http://apps.patria.com.do:8081/Cobros_Online/. When I use this as the URL, it tells me it is not valid. After doing some research, it looks like it cannot contain port number. How can I fix this? I can't use the default port 80 because IIS is on port 80.
So, for example, http://apps.patria.com.do/, will take you to another application running on IIS.
What can I do to make the URL acceptable?
Thanks in advance!

how to host a website using xampp server?

I have created a website for sending emails, it works fine in localhost and in LAN connection, but I'm not able to open my website from another network.
I use my public IP address (found on whatsmyip.org), I have also forwarded port (80) to the server computer in my router settings page.
I'm using xampp version 5.6.3. please help me out with this.
Thanks in advance
Make sure your firewall allows incoming connections from port 80. To do this, open your computers firewall-configuration and create an incoming-rule for port 80. If you are using Windows 8 please refer to this Microsoft-help-page.
To view your website from the internet, these conditions must be met:
Make sure you use the correct ip
Have an ISP that allows trafic on port 80 (thanks to DarkBee)
Forward the port to the correct computer, using the nat of your router
Configure your firewall to accept connections from port 80
Make sure your xampp listens to all ip-adresses (see "Listen 80" in httpd.conf)

How to port forward php-built in port number to localhost

PHP has a built-in server that connects to localhost through port 8888. i.e localhost:8888 I would like to know if it is possible to remove the port number using any port-forwarding method or application, so I can connect to it directly using just localhost
Why don't you install apache Virtual Hosts. It offers more than the local php development server and is quicker. Or try wamp and xammp

PHP: How to accept HTTP requests on a different port?

I'm making a simple endpoint for some API and I would like to know how can I achieve this? So the API user can basically cURL it and send some data but instead of the default port 80, he can change it to something else like port 5000 or something like that.
Unless u plan to build your server in PHP (does not making sense). U will have a server listening on that port. That server will have it's php module, which u will point to the right code. Same way you direct the server listening on port 80 to the right code (you put php files under it's www folder, I guess)
You just need to set up your server to listen to a port other than 80. The only reason servers are set up to port 80 by default is because that is the standard port for web servers that browsers will look to use. You can set a web server to use whatever port you like (as long as your server software of choice provides it that is, the majority will).
You can find relevant Apache documentation here: http://httpd.apache.org/docs/current/bind.html
Or if you're using nginx this question should help you out: How to start nginx via different port(other than 80)
Depending on your hosting situation, you may also need some firewall adjustments.

Categories