Litespeed Port 80 (http) printing php code - litespeed

I've very new to Litespeed and so far love it! All works amazingly fast on port 443(HTTPS), but on port 80 (HTTP) the browser prints the PHP code rather than executing it.
Can anyone point me in the right direction, I'm a bit of a noob and very new to servers.
This is what's running on port 80
root#openlitespeed-cuyg-vm:/home/info# netstat -tulpn | grep :80
tcp6 0 0 :::80 :::* LISTEN 606/apache2
Many thanks

summary :
the case here is LiteSpeed runs on port 443, but Apache runs on port 80 , as OP's netstat output
and it seems the Apache did not configure the PHP properly , so it just outputs the source code
so the solution for OP was stop Apache to free port 80 , then restart LiteSpeed by systemctl restart lsws to make it bind to port 80

Related

Which VCenter Server Applience 5.5 service should be running on 443/tcp port?

I get error 'Connection refused' when try to connect from vSphere Client and web client.
I check output of command netstat -tnpl and not see 443 port in listening ports.
Which VCenter Server Applience 5.5 service should be running on 443/tcp port?
I was able to start the service running on port 443. This service is vmware-vpxd:
$ netstat -tnpl | grep :443
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 4780/vpxd
tcp 0 0 :::443 :::* LISTEN 4780/vpxd
In my case, i got error when vpxd started: "vpxd failed to initialize"
The problem was solved updade VCenter Server Applience, as described in the article https://kb.vmware.com/s/article/2031331
A similar problem was found in the blog:
https://blog.robinfourdeux.com/vcenter-5-1b-waiting-for-vpxd-to-initialize-failed/

I cannot open any port on my GCP instance. I'm trying to open port 25565

For whatever reason, I cannot open any ports on my Instance. Before I add a firewall rule trying to open 25565, I used https://www.yougetsignal.com/tools/open-ports/ and it had taken a few seconds to check. Now, when I added the firewall rule, it immediately says the port is closed. GCP Firewall Rules Image
I then tried running netstat -an | grep "LISTEN ", and the output was
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN
Then, I tried deleting the firewall rules I made and tried adding through the GCP command line.
My output there was
Creating firewall...done.
NAME NETWORK DIRECTION PRIORITY ALLOW DENY DISABLED
minecraft default INGRESS 1000 tcp:25565 False
I then tried running netstat -an | grep "LISTEN " again, and my output was the same. Any help would be greatly appreciated. I am running Ubuntu 16.04 on a custom 1vCPU 4.75gb ram setup.
I highly suspect that the port 25565 is already being used by another process. For this reason, you are unable to connect to it.
Try the following troubleshooting steps.
Type:
$ netstat -tulpn
This command will show a list of all processes running on their respective ports. If the port 25565 is there, take a look at the existing process running on it. You may then kill that process.
For more information on troubleshooting the processes running on port 25565, you may consult this article.

Why can't Apache start?

I'm setting up WAMP for the first time, and Apache won't start, and when I run the "Test Port 80" utility, it says that Your port 80 is not actually used.. From what I can tell, that means that something is blocking it from using Port 80.
I looked around several SO and blog solutions, and have never installed IIS (double-checked just in case).
Running Apache on port 81 worked, but I would really rather use Port 80.
netstat -aon | findstr :80 gives me this vague list of IPs and ports and their status, but I don't know what to do with this information:
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 7808
TCP 192.168.2.11:50860 141.101.114.59:80 TIME_WAIT 0
TCP 192.168.2.11:50864 69.31.132.24:80 ESTABLISHED 688
TCP 192.168.2.11:50875 134.170.119.140:80 ESTABLISHED 688
TCP 192.168.2.11:50879 23.78.219.215:80 ESTABLISHED 688
TCP 192.168.2.11:50880 23.78.219.215:80 ESTABLISHED 688
TCP 192.168.2.11:50883 134.170.188.139:80 ESTABLISHED 688
TCP [::]:80 [::]:0 LISTENING 7808
It also changes quite often.
netstat -b mentions a whole bunch of programs, but none using port 80. I left netstat -b | findstr :80 running for a while and nothing popped up.
I went into Windows firewall and added rules that allow all traffic from port 80, so it's not that.
There must be a culprit on my machine taking up port 80 but I have no idea how to find it!
Here we go.
I'd rather use technet.microsoft.com/es-ar/sysinternals/bb897437.aspx to check which process is using port 80. Once on my dev machine, Skype was preventing wamp to start. Skype use port 80. Also check HTTPS port. If 443 is taken wamp won't start either.

Using Apache to serve Django project on RHEL (503 error)

I am a newbie to the whole website thing... Would really appreciate if you could give some help here...
What I want to do is host a Django project on a remote server (red hat, CentOS release 6.5)
I've been running test of the project on a remote server using the development server and port 8000:
python manage.py runserver *.*.*.*:8000 --insecure
In this case, the website works fine and accessible from other machines.
0 errors found
September 04, 2014 - 08:13:03
Django version 1.6.4, using settings 'mysite.settings'
Starting development server at http://*.*.*.*:8000/
Quit the server with CONTROL-C.
Now I want to put it in production, and I've chosen to use Apache http server and mod_wsgi. I have httpd and wsgi installed and activated. I changed the httpd.conf configuration file to:
Listen *:80 (I've also tried Listen *:8000 and Listen (IP address):8000)
#DocumentRoot "/var/www/html"
DocumentRoot "/testsite" (I put a plan html file under the directory just for test)
ServerName <here is the url of the site,with no port number>
However, when I try to open the webpage I am always having a 503 error:
Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime
or capacity problems. Please try again later.
Apache/2.2.3 (CentOS) Server at <site url> Port 80
I tried a couple of things (1) checked what's using the port 80:
~# sudo lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
httpd 28732 root 4u IPv6 19802111 0t0 TCP *:http (LISTEN)
httpd 28734 apache 4u IPv6 19802111 0t0 TCP *:http (LISTEN)
httpd 28735 apache 4u IPv6 19802111 0t0 TCP *:http (LISTEN)
httpd 28736 apache 4u IPv6 19802111 0t0 TCP *:http (LISTEN)
httpd 28737 apache 4u IPv6 19802111 0t0 TCP *:http (LISTEN)
httpd 28738 apache 4u IPv6 19802111 0t0 TCP *:http (LISTEN)
httpd 28739 apache 4u IPv6 19802111 0t0 TCP *:http (LISTEN)
httpd 28740 apache 4u IPv6 19802111 0t0 TCP *:http (LISTEN)
httpd 28741 apache 4u IPv6 19802111 0t0 TCP *:http (LISTEN)
~# service httpd status
httpd (pid 28732) is running...
(2) restart the apache server:
service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
(3) placed a plain .html in /var/www/html/testsite, the DocumentRoot directory for testing.
(4) I tried to run the django on a different port (such as 8008, 8001 and 80)
e.g. python manage.py runserver *.*.*.*:8008 --insecure
0 errors found
September 04, 2014 - 07:56:18
Django version 1.6.4, using settings 'mysite.settings'
Starting development server at http://*.*.*.*:8008/
Quit the server with CONTROL-C.
As shown above, in the terminal it looks like it's working , but I cannot even access the website from remote machines even using the development server. I tried different port numbers but only the port 8000 can be used. But why can I open the webpage on localhost when I change the port number? e.g. 127.0.0.1:8008 or 127.0.0.1:8080 will work.
I guess it can be the firewall setting, then I went to /etc/sysconfig/iptables, I found under the web section, there was only one line:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8000 -j ACCEPT
Then I added another line for testing:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8001 -j ACCEPT
Then tried the development again with port 8001. Again, it looks like it's woking on the remote server but not accessible from remote machines.
Sorry if I made this confusing and if I asked something really silly. Now, I have three questions that I really don't understand. First of all, the 503 error really annoys me. Even it shows the apache server is running (restart httpd is OK), nothing actually displays... Second of all, when using the development server why can I only use port 8000 but not any else? Finally, in the 503 error message, it shows apache runs on Port 80 even after I changed the Listen port to 8000 in the configuration file, why is this?
Thanks ahead for any help!
If that is your only configuration I don't see how Apache could be aware of your Django running 8000. There is no indication that you are making Apache to connect or proxy requests to running Django instance.
What you need to do is
Configure mod_wsgi for Apache
or
Configure fgci for Apache
You are free to choose any port with Django development server. You can configure the IP address and the port the development server listens to with command line parameters.
You can make the Django development server to listen all IP addresses, including public IP addresses on the server, as:
python manage.py runserver 0.0.0.0:8000
Also Apache logs can be read at /var/log/apache (or similar directory), so it should explain why you are getting 503.
I doubt iptables are not related to any way to your problem, but somehow Django development server is not listening to public IP address. You can easily try this by disabled iptables firewall on the server.

Jstatd connection issues

Having a little trouble connecting jstatd with visualvm. Below is a break down of my settings:
jstatd.policy
grant codebase "file:/usr/java/jre1.7.0/lib/tools.jar" {
permission java.security.AllPermission;
};
Called With
jstatd -p 9999 -J-Djava.security.policy=/usr/java/jre1.7.0/bin/jstatd.policy
Pulling Ports
tcp 0 0 0.0.0.0:43786 0.0.0.0:* LISTEN 22846/jstatd
tcp 0 0 0.0.0.0:9999 0.0.0.0:* LISTEN 22846/jstatd
And Ports Nice and Open
ACCEPT tcp -- anywhere anywhere tcp dpt:9999
ACCEPT tcp -- anywhere anywhere tcp dpt:43786
The application being run is sat on vmware, although application can be accessed with no issues.
If anyone has any ideas on connecting to visualvm it would be great.
Probably you need to start jstatd with host IP addr parameter, like this:
jstatd -p 9999 -J-Djava.security.policy=/usr/java/jre1.7.0/bin/jstatd.policy -J-Djava.rmi.server.hostname=192.168.0.123
192.168.0.123 - change this IP with your IP address of remote server
Check this link: http://hwellmann.blogspot.com/2012/01/troubleshooting-visualvm-remote.html