Find the answer to your Linux question:
Results 1 to 2 of 2
I was hired as a programmer and my manager neglected to tell me that I would also be the only person in the department managing the server (RHEL 3). I ...
  1. #1
    Just Joined!
    Join Date
    May 2009
    Posts
    1

    I seem to be missing something with httpd.conf and virtual hosts

    I was hired as a programmer and my manager neglected to tell me that I would also be the only person in the department managing the server (RHEL 3). I can get around in Linux (it's been 17 years since I used to use a bit of Unix), but I would not consider myself competent in it.

    The hosted website is quite large and is successfully running virtual hosts already. I was asked to create a blog for someone. That was fine. The problem I have is giving it a direct address.

    In the httpd.conf file I found a working vh entry (I changed my school name to 'foo'):
    # WORKING SETUP
    <VirtualHost *:80>
    ServerAdmin *removed*
    DocumentRoot /opt/webroot/html/cfac_r10/blogs/tmaseason
    ServerName tmaseason.foo.edu
    ServerAlias tmaseason.cfac.foo.edu
    ErrorLog "|/usr/sbin/rotatelogs /opt/webaccess_logs/blog-tmaseason-error_log 500M"
    CustomLog "|/usr/sbin/rotatelogs /opt/webaccess_logs/blog-tmaseason-access_log 500M" combined
    </VirtualHost>

    The address of the above entry is mckinley.foo.edu/cfac_r10/blogs/tmaseason/

    I have a blog I set up at: mckinley.foo.edu/cfac_r10/blogs/visualarts/
    This address works.

    I then added this to the httpd.conf (cut and paste above entry then minor mod):

    <VirtualHost *:80>
    ServerAdmin *removed*
    DocumentRoot /opt/webroot/html/cfac_r10/blogs/visualarts
    ServerName visualartsblog.foo.edu
    ServerAlias visualartsblog.cfac.foo.edu
    ErrorLog "|/usr/sbin/rotatelogs /opt/webaccess_logs/blog-vablog-error_log 500M"
    CustomLog "|/usr/sbin/rotatelogs /opt/webaccess_logs/blog-vablog-access_log 500M" combined
    </VirtualHost>

    Save. Restart apache.

    If I enter:
    /usr/sbin/httpd -S

    I see this vh in the listing (along with all the others--about 50--and it looks like all the others):

    port 80 namevhost visualartsblog.byu.edu (/etc/httpd/conf/httpd.conf:1369)


    However, my browser will not load the vh address (ie visualartsblog.foo.edu) the address is not found.

    Apparently there is something else I need to do, but in my noobness I don't know. Web search indicates these are the steps I need to do . . . but . . . why am I stuck?

    Many many thanks
    elby

  2. #2
    Linux Engineer b2bwild's Avatar
    Join Date
    Jul 2008
    Location
    Behind You!
    Posts
    1,108
    To make namebased virtualhost work, you should have entry for both hostnames having same IP address on DNS server.

    To check if your configuration is working, add the proper entries in /etc/hosts.
    e.g.
    10.0.0.1 virtual.example.com
    10.0.0.1 server.example.com
    Never make any misteaks.

    Read my Blog at --> Penguin Inside Subscribe Feed

Posting Permissions

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