View previous topic :: View next topic |
Author |
Message |
cghislai n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 15 Jun 2005 Posts: 11
|
Posted: Thu Nov 24, 2005 2:09 pm Post subject: change apache default port |
|
|
Hi all
I want to run apache on port 81 (cause my router use the port 80 for his web interface)
I set 'Listen 81' in httpd.conf and restarted apache. But when im trying to go to 127.0.0.1:81, i get an 404 Not found, with a footnote saying "Apache Server at 127.0.0.1 Port 81". When i try 127.0.0.1:80, browser change adress to http://127.0.0.1/ and my page is showed.
Where is the matter?
thanks
Charly |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
hanj Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/104414163441b8c6c1a6b4e.gif)
Joined: 19 Aug 2003 Posts: 1500
|
Posted: Thu Nov 24, 2005 4:33 pm Post subject: |
|
|
Quote: | I want to run apache on port 81 (cause my router use the port 80 for his web interface)
I set 'Listen 81' in httpd.conf and restarted apache. But when im trying to go to 127.0.0.1:81, i get an 404 Not found, with a footnote saying "Apache Server at 127.0.0.1 Port 81". When i try 127.0.0.1:80, browser change adress to http://127.0.0.1/ and my page is showed. |
Looks like you successfully changed the default port to 81.. and got apache to listen on it. You need to change your vhost and NameVirtualHost settings.
Are you using 00_default_vhost.conf?
If so... change this:
Code: | NameVirtualHost *:80 |
to this:
Code: | NameVirtualHost *:81 |
Also you need to change this:
to this:
Don't forget to restart apache.
Hope this helps.
hanji |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
cghislai n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 15 Jun 2005 Posts: 11
|
Posted: Thu Nov 24, 2005 7:20 pm Post subject: |
|
|
thanks for your reply
In fact, i had to add a line in my httpd.conf saying DocumentRoot /var/www/localhost/htdocs.
For some obscure reason, when i change the port, apache looks for these file in /usr/htdocs.... And the httpd.conf file did not provide a DocumentRoot option by default. Maybe i should submit a bug... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
mordredP Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/109096735548d6aa5286a8f.gif)
Joined: 17 Oct 2005 Posts: 155 Location: bari.italy.€urope.earth
|
Posted: Thu Nov 24, 2005 7:30 pm Post subject: Re: change apache default port |
|
|
cghislai wrote: | Hi all
I want to run apache on port 81 (cause my router use the port 80 for his web interface)
I set 'Listen 81' in httpd.conf and restarted apache. But when im trying to go to 127.0.0.1:81, i get an 404 Not found, with a footnote saying "Apache Server at 127.0.0.1 Port 81". When i try 127.0.0.1:80, browser change adress to http://127.0.0.1/ and my page is showed.
Where is the matter?
thanks
Charly |
no need to do that if you setup port forwarding correctly.. actually if your router displays his web interface while you try to access your web server just try to access your server from outside the LAN.. it should work fine.. _________________ People fall into 10 groups: those who know binary and those who don't
dosmary.netsons.org
01010110 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
cghislai n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 15 Jun 2005 Posts: 11
|
Posted: Fri Nov 25, 2005 10:36 pm Post subject: |
|
|
yes, it works fine
i didnt know that, thanks |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
guldan Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 24 May 2004 Posts: 81
|
Posted: Wed Dec 21, 2005 10:00 am Post subject: |
|
|
cghislai wrote: | thanks for your reply
In fact, i had to add a line in my httpd.conf saying DocumentRoot /var/www/localhost/htdocs.
For some obscure reason, when i change the port, apache looks for these file in /usr/htdocs.... And the httpd.conf file did not provide a DocumentRoot option by default. Maybe i should submit a bug... |
many thanks for that hint. I was fighting with exactlythe same problem (for a stll unknown reason, my port forwardign for port 80 will not work so for testing I wanted to use a different one).
Is there a way to check what config settings like "documentRoot,..." apache uses while running ? Or how did you foudn out that apache used a wrong DocumentRoot while running on a different port ? The apache config files on gentoo are too my understand a little bit confusing as some setting are missing in the httpd.conf file ? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|