Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
change apache default port
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
cghislai
n00b
n00b


Joined: 15 Jun 2005
Posts: 11

PostPosted: Thu Nov 24, 2005 2:09 pm    Post subject: change apache default port Reply with quote

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
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1500

PostPosted: Thu Nov 24, 2005 4:33 pm    Post subject: Reply with quote

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:
Code:
<VirtualHost *:80>

to this:
Code:
<VirtualHost *:81>


Don't forget to restart apache.

Hope this helps.
hanji
Back to top
View user's profile Send private message
cghislai
n00b
n00b


Joined: 15 Jun 2005
Posts: 11

PostPosted: Thu Nov 24, 2005 7:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
mordredP
Apprentice
Apprentice


Joined: 17 Oct 2005
Posts: 155
Location: bari.italy.€urope.earth

PostPosted: Thu Nov 24, 2005 7:30 pm    Post subject: Re: change apache default port Reply with quote

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
View user's profile Send private message
cghislai
n00b
n00b


Joined: 15 Jun 2005
Posts: 11

PostPosted: Fri Nov 25, 2005 10:36 pm    Post subject: Reply with quote

yes, it works fine :)

i didnt know that, thanks
Back to top
View user's profile Send private message
guldan
Tux's lil' helper
Tux's lil' helper


Joined: 24 May 2004
Posts: 81

PostPosted: Wed Dec 21, 2005 10:00 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum