I have installed Apache GUI on Linux Debian in the following directory
/usr/local/apachegui/ApacheGUI/bin
by the following instruction as shown on this webpage:
https://www.howtoforge.com/tutorial/ubuntu-apache-gui/
At the end of the instruction, it’s says run the following command:
sudo ./run.sh
when I run the above command I get the following output but with an error
./run.sh: 1: [: -ne: unexpected operator
Bottom of the terminal window its mention tomcat started and as in above mention tutorial webpage claims after running run.sh command
Your ApacheGUI is now starting and listening on port 9999.
Next, open your web browser and type the URL >http://your-server-ip:9999/ApacheGUI. You will >be redirected to the following page (ApachiGUI home page)
In my case when I am typing the above URL with my IP address or localhost my Chrome browser print: output site can not be reach
So I searched to check if port 9999 is enabled and listening in my case I was unable to see port 9999 in my list of ports so ran the following commands and the terminal window didn’t produce any output from here I assumed port 9999 is close
pi@Home:~ $ ss -na | grep :9999
After using the above command terminal window return back to ip@home:$
now I open a separate terminal window and ping port 9999 and as result, This terminal window hang now it is clear the port 9999 is not open in my server so to open the close port I run the following command
Open port command:
sudo iptables -A INPUT -p tcp --dport 9999 -j ACCEPT
To update the firewall rules, I restart the iptables service
sudo iptables -L
output:
pi@Home:~ $ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:9999
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Now I check again a list of open ports on my server and I still can’t see port 9999
After taking all these steps executed following command:
pi@Home:/usr/local/apachegui/ApacheGUI/bin $ ./run.sh
Output:
Using CATALINA_BASE: /usr/local/apachegui/ApacheGUI/tomcat Using
CATALINA_HOME: /usr/local/apachegui/ApacheGUI/tomcat Using
CATALINA_TMPDIR: /usr/local/apachegui/ApacheGUI/tomcat/temp Using
JRE_HOME: /usr Using CLASSPATH:/usr/local/apachegui/ApacheGUI/tomcat/bin/bootstrap.jar:/usr/local/apachegui/ApacheGUI/tomcat/bin/tomcat-juli.jar
Tomcat started.
look like the initial error is resolved but I am still unable access ApacheGUI from my browser still unable to resolve the error mention above can anyone suggest what is the solution to this problem?
2
Answers
By executing following tests you will learn port testing and port configuration and at the end of these test you will be able to find out either problem exist within your Server ports or you have to check the setting of your browser. In my case I have taken an unintentional long route, I set my testing plan into three sections as follow
If you ever experience the same issue my advise is to troubleshoot
By executing tomcat/bin/startup.sh it does start the server successfully just like run.sh (as mention in Question and given answer above) but the browser was still unable to load the
localhost:9999/ApacheGUI
index page because the server's initial errorwas resolve (as shown in question) but the browser was still unable to load the GUI page so for this reason just to find out if there is a problem with port 9999 itself or there is something else causing localhost not to communicate with the browser via port 9999 I have carried out following tests:
I believe the following information is suitable for a tester who wants to troubleshoot ports but if you think there is nothing wrong with your ports and the problem may lies with the browser then visit the following link Where I had the same problem with port 8080 and I overcome this issue by modifying browser settings:
Reboot my server and execute the following command in terminal
output shows
With this output, I know ApacheGUI is installed and the server is up and running.
let's test port 9999 and take the following steps to check either it's port on your machine causing this error or it's something else
StepNO:1
StepNO:2 type command on Linux terminal to test port 9999 (Enter)
StepNo:3 Then turn ON Window computer and open PuTTY client
Establish SSH connection from window machine by typing the following credentials in PuTTY Client interface:
if port 9999 is open successfully you will get the following results
Linux Server Terminal (StepNO:2) Where cursor was flashing start responding to Client request and print following line (where the cursor is still flashing):
SSH-2.0-PuTTY_Release_0.74
StepNO:4 Open a new terminal window and typed another command to make sure port 9999 is definitely open and responding (Linux Server terminal in StepNO:2 still open)
Output:
This stage confirmed I have successfully open port 9999 and the port is responding to TCP protocols
StepNO:5
in the same Linux server terminal (stepNO:2) I type the following command again:
sudo ls | nc -l -p 9999
(Enter)Now I have open the browser and type ApacheGUI URL
192.168.0.16:9999/ApacheGUI
(Enter)Linux server terminal from StepNO:2 where the cursor is flashing start responding to URL request from the browser and print the following lines in the terminal window:
Output:
But: my ApacheGUI index page still unable to load and showing the following error message
At this stage, I am 100% sure that my installed server is up and running. Port 9999 in my server is open and functional so there is nothing else that can cause this error except the browser so I have followed the step to tune my browser setting as described in answer to the following link:
Result: Successful connection ApacheGUI index page finally loaded to the browser.
The
run.sh
file is a badly written shell script with content:Just execute
tomcat/bin/startup.sh
. This script can fail in many ways:#!interpreter_name
), so it is executed using/bin/sh
or whatever the default shell is,UID
is not a POSIX variable (cf. this question), so the result is blank andtest
([
) only sees-ne 0
. Usually in such cases the variable should be quoted or tested if it is not empty,../tomcat/bin/startup.sh
is relative to the current directory, not the directory of the script.