Skip navigation

Change default website on port 80

11536 Views 11 Replies Latest reply: Feb 14, 2012 2:12 AM by spookybathtub RSS
Coen Jeukens Calculating status...
Currently Being Moderated
Aug 10, 2011 12:14 PM

Lion Server comes with a default website on port 80.

The port field is greyed out and I would like to change it to 8080

 

I have created a second website entry and. This I would like to be on the 80 port.

Thus having the default http protocol poiting to my own site and 8080 to the Lion built in site.

 

Q: how to do this.

 

:-( was able to do this in 10.6 :-(

 

Regards

Coen

  • mindcrime Level 1 Level 1 (50 points)
    Currently Being Moderated
    Aug 10, 2011 12:49 PM (in response to Coen Jeukens)

    I was wanting to do this as well but so far have not figured our how to.

  • Spinland Level 1 Level 1 (50 points)
    Currently Being Moderated
    Aug 10, 2011 2:53 PM (in response to Coen Jeukens)

    To the best of my knowledge you cannot edit the default Web Server entry at all.  All you can do is override it by creating entries specific to the incoming URLs you want to point in other directions (or use other ports).

     

    Frustrating, but there it is.

  • Hugo Costa Calculating status...
    Currently Being Moderated
    Aug 11, 2011 6:56 AM (in response to Coen Jeukens)

    you could edit the 0000_any_80_.conf file in /etc/apache2/sites and change the port number

  • mike.habermeier Level 1 Level 1 (5 points)
    Currently Being Moderated
    Aug 19, 2011 1:07 AM (in response to Coen Jeukens)

    Hallo to all.

     

    I have the same problem. I have to change the default port to 8080.

    But I can't ;-)

     

    I hope that someone can help me / us.

     

    Thanx in advance.

     

    Yours Mike

  • gracoat Level 3 Level 3 (645 points)
    Currently Being Moderated
    Aug 19, 2011 3:31 PM (in response to Coen Jeukens)

    The only way to do this is in the conf file. 

    You'll have to find the entry there.  Keep in mind however that if you need support from Apple on this point, they'll tell you that you've broken the system and need to re-install.  They will not help you change the conf file back.  So make sure that you back up the original file BEFORE you change anything there.

     

    The file is:

    /etc/apache2/sites/0000_any_80_.conf.default

     

    On line 4 (on mine) it reads:

    <VirtualHost *:80 >

     

    Change to:

    <VirtualHost *.8080 >

     

    There's a space between the 8080 and the >

    You'll want to copy and paste the change I think.  This solution will only work on the one site.  If you have more than one site served from the apache server, then you need to change it system wide.

    For instance... on port 8080, you'd have to change the /etc/apache2/httpd.conf file like so:

    pico /etc/apache2/httpd.conf

    Find the string of text: "Listen 80"

    Change it to "Listen 8080"

     

    Note that all the sites on your apache server will listen on that port. 

    Changing the first file will only change the one site.

  • mike.habermeier Level 1 Level 1 (5 points)
    Currently Being Moderated
    Aug 26, 2011 1:14 AM (in response to gracoat)

    Hi.

     

    Thank you for you help. But it did not work.

     

    I tried everything as explained but the web server is still on port 80.

    I rebooted the machine, edited all the files with or without spaces but

    no chance. It is not working.

     

    ...

     

    would be nice if we find a fix for that.

     

    Thanx Mike

  • Tom Yager Level 1 Level 1 (55 points)
    Currently Being Moderated
    Aug 26, 2011 3:24 PM (in response to mike.habermeier)

    You can change the site that comes up on port 80. You're off to a good start by creating a new site at port 8080.

     

    1. Check /etc/apache2/sites/virtual_host_global.conf to make sure that your server is listening on port 8080:

     

    Listen          *:80

    Listen          *:443

    Listen          *:8080

     

    The "8080" line should have been added when you used Server.App to add a new site at port 8080.

     

    2. Edit /etc/apache2/sites/0000_any_80_.conf and change the VirtualHost entry from "*:80" to "*:8080". Save.

     

    3. In the same folder, edit the .conf file for your newly-created site (the one at port 8080). Change its VirtualHost entry from "*:8080" to "*:80". Save.

     

    4. In Terminal, type the command

     

    sudo apachectl restart

     

    5. Now if you browse to http://localhost, you should see your new site. If you go to http://localhost:8080, you'll get Lion's collaboration portal, the old default.

     

    Exit and reopen Server.App. You should now see port 8080 (grayed out) shown next to the default Web site.

     

    This isn't perfect. On my machine, this maneuver causes the default collaboration site (now localhost:8080) to lose track of its landing page icons, and I expect its confusion runs deeper than that. I don't use those services, so I haven't tried to fix it.

     

    Best of luck, Mike.

  • mike.habermeier Level 1 Level 1 (5 points)
    Currently Being Moderated
    Aug 30, 2011 12:03 AM (in response to Tom Yager)

    Hallo Tom.

     

    Thank you for your help.

    Your workaround is working.

     

    I now have my Rumpus Server again on Port 80 and

    all the other stuff on 8080.

     

    Thank you for you help!!!!

     

    Sorry. I can not mark this questions as answered or am I too stupid ;-)

     

    THANK YOU THANK YOU THANK YOU!!

     

    Yours Mike

  • Nate Kondrick Calculating status...
    Currently Being Moderated
    Dec 7, 2011 2:33 PM (in response to Tom Yager)

    You can fix the collaboration stuff by editing a couple of lines in /etc/apache2/sites/0000_any_80_.conf

     

    Find the two references to /var/empty and change them to /Library/Server/Web/Data/Sites/Default

     

    Save and run "sudo apachectl restart"

     

    The default site will be restored.

  • spookybathtub Level 1 Level 1 (70 points)
    Currently Being Moderated
    Feb 14, 2012 1:37 AM (in response to Tom Yager)

    This tip helped me, but my problem is not completely solved.  I'm trying to host a Wiki on port 8080.  I successfully changed the default Website by following your instructions, but the Wiki isn't working.  If I try http://localhost:8080/wiki I get "The requested URL /wiki was not found on this server".  Any ideas?

  • spookybathtub Level 1 Level 1 (70 points)
    Currently Being Moderated
    Feb 14, 2012 2:12 AM (in response to spookybathtub)

    Update:  I realized that the Wiki service is turning itself off after just a few seconds.  If I enable it in Server.app, then relaunch Server.app, Wiki is turned off.  I don't know what's wrong.

Actions

More Like This

  • Retrieving data ...

Bookmarked By (2)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.