2

I try configure my localhost XAMPP on like these step How to change XAMPP apache server port? But when i try restarted my apache and try open http://localhost instead of http://localhost:8012. It said HTTP Error 404. The requested resource is not found.

My suggestion problem :

on file http-ssl.conf i cant found line ServerName localhost:443

Maybe that my problem cant instead http://localhost instead of http://localhost:8012?? Or did i missing something, if i try open http://localhost:8012 is working.

My XAMMP version is 3.2.2 and my apache is Apache2.4, windows 7. And idk i'm using IIS or not because is not my own computer but is my computer office.

Wolfzmus
  • 463
  • 1
  • 10
  • 23
  • 1
    You change server port apache listens to with `Listen` directive. But if there are any virtualhosts they probably need to be changed accordingly for the specified port. – Daniel Ferradal Nov 29 '19 at 17:32
  • i'm pretty sure said i follow the step from i give a link. And you didn't notice i've change the `listen` – Wolfzmus Dec 02 '19 at 03:41

1 Answers1

1

Just in case, the full answer does not answer the question. Only some parts do.

If I understand your question, you want to run your website on http://localhost. I just want to clarify that the normal localhost runs on port 80 i.e. http://localhost:80.
So, port 80 and just the localhost aren't different, so please don't get confused. You should not worry about httpd-ssl.conf, you shouldn't have to change it. The configuration is in the main conf: httpd.conf. And, I don't think the link you've given in your question is similar. Can you access localhost using https://localhost
After all, I think, you want to change your port from 8012 to 80 (http default). Please follow the following steps to change the port.

1) Click on Config after opening XAMPP

2) Click on Service And Port Settings

3) Change the port to 80 from your current port

If it still has the same error, do this:

Take a backup of httpd.conf before doing the following.

1) Edit your httpd.conf, change the following.

Listen 8012

To:

Listen 80

If still not working, go ahead and add the following at the end:

<VirtualHost *:80>
ServerAdmin your@email.com
DocumentRoot "C:\path\to\website"
</VirtualHost>

Thanks.

Edit:

The only way you could do this is by running your XAMPP server on a different IP like 127.0.0.2 So, try the following:
Edit httpd.conf and say:

<VirtualHost 127.0.0.2:80>
ServerAdmin your@email.com
DocumentRoot "path to htdocs"
</VirtualHost>

Go to the C:\Windows\System32\drivers\etc
Edit hosts file:
For some time, please add something like this.

127.0.0.2 localhostt

Also

You could also change the port of the application that is running on port 80
Open up the CMD
Run the following command:

netstat -aon | findstr "80"<br>

And get the info of something like:

TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       11560<br>

Get the info of the last number i.e is in this post is 11560
Run the following after that

tasklist | findstr "11560"<br>

Replace 11560 to the number that you got running the previous command
And you will know what app is running in the port

My Last Guess:

The new way I found out is by doing this:

Change the listen directive to:

Listen 127.0.0.2:80

Go to the C:\Windows\System32\drivers\etc
Edit hosts file:
Try this:

127.0.0.2 localhost

OR
For some time, please add something like this.

127.0.0.2 localhostt

Hope it works.

Example person
  • 3,198
  • 3
  • 18
  • 45