Apache set server name to default localhost without including port :8080 - php

I changed my port to 8080 so whenever user visit to website they need to include port is it possible to set to default same like using port 80. Instead of localhost:8080 should be localhost only. I need to change because my apache randomly crashing

Most web browsers will request through port 80. If you want to change that, it would have to be client wise. So, no, you can't set a default port.
The most you can do is set up the configuration to redirect traffic to the desired port. Check out on how to do it here.

Related

Need to change the URL for apache localhost

I'm new to XAMPP. I just installed XAMPP on Windows 10 and it said that port is blocked. So I changed the default port for apache from port 80 to port 8080, and now have to type HTTP://localhost:8080.
Is there a way I can change this URL to remove the port number from the URL. So it will still point to port 8080 even if I don't mention in the URL.
You have to run the application as administrator or, at least, using a user having admin privileges.
Ports below 1024 need higher privileges to be bound by a process.

How to remove port number from url using apache server?

I have installed Apache, PHP, Mysql in ubuntu system.
I have changed the port of apache server 80 to 802 in httpd.conf file.
I am accessing localhost from the below URL successfully.
http://localhost:802/
But the thing I want to access the localhost without using port number in the URL. Where I need to change for this.
Please suggest.
Where I need to change for this.
In httpd.conf where you set the port number to 802, set it back to 80.
HTTP operates on port 80 by default, and web browsers use that default by convention. Since you have changed that default, you need to specify the port in the address. Otherwise the web browser will attempt to connect to port 80 and won't find your server.

wamp server localhost not working after changing the port 80 to 8085

I'm trying to open my Wamp server by entering this URL into my web browser:
http://localhost/
The browser returns a 400 error, stating that the webpage is not available.
Earlier, my Wamp server had stopped working (it was not turning green in the control panel) after I had installed tomcat. I found out that there was a conflict between ports with the two services, so I changed the port used by Wamp server from 80 to 8085 (8085 port is being used my tomcat).
To change the port, I the following change to the httpd.conf file:
Listen 80 //changed to 8085
ServerName localhost:8080 //changed to 8085
After that, the Wamp server turned green in the control panel and appeared to be working, but accessing the URL http://localhost/ still returned the 400 error.
What is happening?
It is important to understand the difference between normal ports, web browsers, and non-standard ports. The "web" runs on port 80 by default, and 443 for secured connections. But this isn't all that a URL can do.
Per RFC 1738, the URL can be formatted as such:
protocol://username:password#host.tld:port
Most browsers assume you mean to access the server anonymously, via port 80, and using the HTTP protocol.
In this case, you changed the default port that Apache would listen on to 8085. This means that you must specify the port as 8085 for the server to respond to the request.
The URL should be:
http://localhost:8085
The httpd.conf file into the folder you listen port Apache Find veto the change now
Listen 12.34.56.78:80
Listen any number
for sample
Listen 68

Port Redirect on Mac

What is the easiest option to redirect a request to a different host/port?
Here is my entire scenario:
I am making a request using php to a certain ip and port. The response includes another url location, but it is badly configured and instead of including ip and port, it simply includes a server name. Now, if I access the entire url location that I have as response with the server name replaced with the proper ip and port it works.
I've tried editing /etc/hosts setting the server name to the ip address, but how do I workaround the port too?
I am using mac osx 10.9.4, and I've tried some things with ipfw and pf, but neither really worked.
Thanks.
I had a similar problem quite recently on Mavericks (10.9). The way I solved it included 2 steps:
hosts file
Simply added a line similar to this:
127.0.0.1 www.someaddress.com
port forwarding
To set up port forwarding I used ipfw, which worked fine, e.g:
ipfw add 100 fwd 127.0.0.1,9001 tcp from any to any 80 in
In the example above port 9001 is forwarded to port 80. Even though ipfw is deprecated it still works.

apache and mysql ports

I am installing an open source software, which is `vtiger, and that use mysql and php
The first screen in installing that software asks for mysql and apache code,
the installation tools set these values as:
apache port 8888
and mysql port 33307
but when I open my xampp I see different ports like this:
Should I change the values of these ports to the values that I see in the image or not?
Thanks in advance
edit
this is what the installation tool suggest
so should I replace the 8888 with the 8082
and should I replace the 33307 with 3306 ?
Mysql's default port is 3306, and your XAMPP control panel shows that's the one in use, so you don't need to touch anything here.
As per apache webserver, the default http port is 80, which in this case you could access with
http://localhost
but you can use pretty much whatever you want as long as you append the port number to the url
http://localhost:8082
http://localhost:8082/anotherpage.html
Your Apache webserver is listening to both 4430 and 8082. I wonder if http://localhost:4430 would try to open as https, but I believe that is irrelevant at this point.
Long story short: if you aren't planning to use any other app on port 80, just set Apache to listen to port 80 to forget about appending port numbers on your urls.

Categories