Run newer webserver without root permissions - php

I want to use PHP 7 when it comes out, but my server admin refuses to upgrade past PHP 5.3.3 and I don't have root privileges. I can run a webserver on port 1024 or higher, but I need it to be available on ports 80 and 443.
I am considering connecting to this userland webserver via a local SOCKS client in PHP. Can I effectively run a PHP 7 webserver on port 80 and 443 this way, and will it be possible to handle PHP requests and sessions correctly?

No. Port 80 is a privileged port.

Related

Can PHP-FPM communicate with encryption between the webserver (SSL)?

Is it possible to set up PHP-FPM to receive/send encrypted communication with the webserver (e.g. NGINX)? most of the documentation I've found only refers to the webserver talking to outside with SSL.
Since we have NGINX and PHP-FPM on different servers, my hope was to be able to talk between the servers with encryption. Our webserver talk to the outside with SSL, but within the data center php and nginx communicate with over port 9000 without encryption

Can we run node and apache both on same port

I have a application in nodejs and PHP. For now i am using different both.
Can i run node and apache both on same port 8080
Is, there is any way to run any application both on 8080
Thanks
An port is usually connected only to one application. So you have to use different ports.
Proxy -
But you could for example create an virtual host in apache and configure this host as proxy. In this configuration you could access the node.js server on the same port. The node.js server would run on another port.
For TCP based applications, no. You can have only one application listening on a single port at time. If you had 2 network cards, you could have one application listen on the first IP and the second one on the second IP, both using port 8080.... but I doubt that is your case.
I guess you can run them on UDP protocol, which could allow you to have two applications listen to the same port, but as UDP is unreliable and it doesn't establish connection, just sends/receives packets. You might experience big packet loss on UDP.
So, short answer - no.
Actually, there might be a way using iptables. Add a rule of this nature
iptables -A INPUT \
-p tcp \
-m bpf --bytecode "14,0 0 0 20,177"
-j redirect .. Port 80
Check the first few bytes of the connection, and redirect the connection. Then you can accept both http and node.js on the same port, but have the servers running on separate ports.
The syntax above is incorrect, and I have not tried it, but I know people who have used this strategy successfully.

Check if php-cgi server is connectable remotely

I have a php server listening on a port that seems to have issues. How can I connect to the php-cgi server to find out it if it up or not? (Sort of "ping" the php-cgi process)
I need to determine if the issue I'm having is due to the http server or the php-cgi server. Therefor I want to be able to "ping" the php-cgi server to make sure it is accepting requests. If not, I know it is the php-cgi server that is the cause of the problem.
Try to use telnet
telnet localhost portnumber.
So if you running on port 80 of your localhost type in
telnet localhost 80
It should connect if it does not, your server is not running!

do you know any alternative port number for zend server?

do you know any alternative port number for zend server ?
because my port 80 is already occupied by xampp
<?php echo "help me install"; ?>
Usually Zend Server Administration runs on port 10081 by default and localhost on port 80. If you don't like this or another port, choose any free port you like :). Here is how you check what ports are used, open, closed, etc.
Windows
netstat -a -n
Linux
netstat -nap
As hakre commented, Zend writes the following about Zend Server and ports:
Q: What is my port number?
In most cases, your Web server's port number will be 80. If your port number is 80, you can omit the parameter from your URL when browsing to your Web pages (i.e. you can browse to http://localhost/ without specifying a port number).
In the following circumstances, your port number will be different:
You are running Zend Server on Mac OS X. In this case, the default port number will be 10088.
You installed Zend Server using the Generic Tarball package on Linux. In this case, the default port number will be 10088.
You modified the port number on which Zend Server listens, during or after installation.

which Apache server will it use?

Lets us consider a case, there are 2 apache server running, and one domain is available.
if we make a request like this, http://domain1.com/example1.php it should request one
apache server where actual domain is present. When http://domain1:8000/example1.php it should point to a application in a another server (other machine) under a same domain group.
Now a question is, if http://domain1:8000/example1.php is requested, then it will run in which server? which server will interpret it? which server will execute those files, either apache server in domain1 system or, a apache server that domain1:8000 (this is other machine, to which request is port forwarded) points?
A server will listen on a specific port, so if you are using different ports, it will go to whatever server is listening on that port, regardless of the domain.
Since you're using port forwarding, then it can only be processed by where ever you forward the ports to. So, port 80 is being forwarded to your main server and port 8000 to the other server. If you didn't forward, and all were going to the first server, then you would get an error if the first server were not also listening on port 8000.

Categories