Apache Virtual Host Question

Discussion in 'General Server' started by animaguy, Aug 12, 2012.

  1. animaguy

    animaguy New Member

    Joined:
    May 18, 2012
    Messages:
    53
    Likes Received:
    1
    I am studying how to build a Web Server using CentOS 6.x.


    There are several different methods and tutorials and not only am I open to all but I want to learn as many different combinations mainly because I really like the way CentOS runs as a distro.

    I want to know if anyone has ever tried the wiki.centos.org version.

    And if so, what directives in the httpd.conf are the most important to look for.

    Any comments would beich appreciated.
     
  2. WeAreGeek

    WeAreGeek Member

    Joined:
    Apr 1, 2012
    Messages:
    38
    Likes Received:
    5
    If you're using Apache, it doesn't really matter much, which distribution you are using. You want to learn about Apache configuration, not about CentOS webserver configuration. There might be minor differences in the default config between distro's, but these are neglactable.

    Anyway. I reccommend you don't touch httpd.conf until you really have a good reason for it. Instead, create configuration files for individual virtual servers in /etc/apache2/sites/available and make symlinks to /etc/apache2/sites/enabled to enable them.

    http://httpd.apache.org/docs/2.2/vhosts/
     
  3. Rob

    Rob Administrator Staff Member

    Joined:
    Oct 27, 2011
    Messages:
    599
    Likes Received:
    267
    Well, in Cent, its /etc/httpd/conf.d .. looks like wearegeek is coming from a Debian-based system ;)

    Take a look at this page explaining how to do separate vhosts files on CentOS:
    http://wiki.centos.org/TipsAndTricks/ApacheVhostDir

    Or, you can just add them to the bottom of your /etc/httpd/conf/httpd.conf file if there aren't too many...
     
  4. WeAreGeek

    WeAreGeek Member

    Joined:
    Apr 1, 2012
    Messages:
    38
    Likes Received:
    5
    Oh, I'm sorry! Seems I was wrong... :eek:
    I have indeed only used debian and gentoo for server boxes. But apart from the location. The sytaxis of the config files should be the same.
     
  5. animaguy

    animaguy New Member

    Joined:
    May 18, 2012
    Messages:
    53
    Likes Received:
    1
    WeAreGeek,

    i wanted to ask since you know debian servers.

    Do you have to download 7 isos to install a Debian Server?
     
  6. WeAreGeek

    WeAreGeek Member

    Joined:
    Apr 1, 2012
    Messages:
    38
    Likes Received:
    5
    Nope, you can just use the netinstall iso, and download packages from the repositories as needed.
     
  7. animaguy

    animaguy New Member

    Joined:
    May 18, 2012
    Messages:
    53
    Likes Received:
    1
    WeAreGeek,

    Do you know how to set up a web server with Debian and a dynamic IP address?
     
  8. WeAreGeek

    WeAreGeek Member

    Joined:
    Apr 1, 2012
    Messages:
    38
    Likes Received:
    5
    Sorry for the late reply. I guess you should use a dynamic DNS solution, like no-ip.com. The basic plan is free, if I'm correct. You can download a Linux client to update your IP address from their website.
     
  9. mikewaals

    mikewaals New Member

    Joined:
    Jan 16, 2013
    Messages:
    4
    Likes Received:
    0
    humm u can do it in httpd.conf

    look at the end of file ..
     
  10. anubhav tiwari

    anubhav tiwari New Member

    Joined:
    Jul 30, 2013
    Messages:
    11
    Likes Received:
    2
    I beleive apache httpd.conf file is same as we get it in RHEL. syntex only depends on the version of apache we are using. so to enable virtual hosting we need to perform following steps.
    -Install httpd packege
    -open [/etc/httpd/conf/httpd.conf]
    -at the bottom make the virtual host blocks according to requirement we can get the example of the block there only.
    enable namevirtualhost option
    -save the file and exit
    -restart httpd service. ;)
     

Share This Page