SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    About Virtual Host config

    Hi to All,

    In my httpd.conf I have create:

    Code:
    <VirtualHost *:85>
    DocumentRoot "/usr1/www"
    ServerName www.mydomain.lan
    <Directory "/usr1/www/myapp">
    Options FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
    Options +Indexes
    </Directory>
    ErrorLog /usr1/zend/apache2/logs/mydomain-error.log
    LogLevel emerg
    CustomLog /usr1/zend/apache2/logs/mydomain-access.log "combined"
    ServerSignature Off
    </VirtualHost>
    Now if I enter in the browser http://www.mydomain.lan:85/myapp, my PHP page is displayed and all work fine.

    My question is:
    Isi it possible modify the code in order to open my app with a link like www.mydomain.lan, instead the previous full path ?
    If yes, how must modify my code ?

    Thank You and Best Regards
    Gaetano

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Change

    Code:
    DocumentRoot "/usr1/www"
    to

    Code:
    DocumentRoot "/usr1/www/myapp"

  3. #3
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,607
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    Dan,

    That won't be successful.

    Nick,

    No, it looks like you've installed Apache on port 85 rather than 80 so you MUST use port 85 to access your localhost. Since you're using a 'nix box rather than WinDoze, I wonder why you did that (WinDoze boxes, like mine, come with IIS preinstalled on port 80 so it must be shut down and its properties set to manual start before installing Apache on port 80).

    Once past that problem, Dan's solution will work.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  4. #4
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank You to All,

    I have modified in httpd.conf

    Code:
    Listen 80
    ------
    ServerName 127.0.0.1:80
    ------
    <VirtualHost *:*>
    DocumentRoot "/usr1/www/myapp"
    --------
    And with these changes I be able to run my app with http://www.myapp.lan only

    Bye
    Gaetano

  5. #5
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,607
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    Nick,

    Thank you for that feedback. On WinDoze boxes, I've had to remove and reinstall Apache to get the "service" to register to port 80. I'm glad that Linux does that correctly ... and directly!

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •