Results 1 to 7 of 7

Thread: Apache includes

  1. #1
    Join Date
    Apr 2006
    Beans
    127

    Apache includes

    Hello,

    After developing a site locally, I uploaded to my reseller account; however, it did not work. My host told me to prepare and an include file that they will connect to my host plan. My VHOST in my local machine is
    Code:
    NameVirtualHost 192.168.1.2
    
    <VirtualHost 192.168.1.2>
        <Directory /home/hab/www/html/gp>
            Options FollowSymLinks Indexes
    	AllowOverride All
    	Allow from All  
           AddCharset            utf-8         .html
        </Directory>
       
         DirectoryIndex index.php
         DocumentRoot /home/hab/www/html/gp/
         ServerName   www.gp.loc
         ServerAlias  *.gp.loc
         AddDefaultCharset  utf-8
         DirectoryIndex index.php index.html
    </VirtualHost>
    How can I make this into include file and should be changed?

  2. #2
    Join Date
    Aug 2008
    Beans
    13
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Apache includes

    Take your example and place it in a file - call it myvhost.conf.

    Then in one of the conf files under the apache directory add:

    Include /your directory/myvhost.conf

    Done..

  3. #3
    Join Date
    Apr 2006
    Beans
    127

    Re: Apache includes

    Yea but what should I put instead my IP address 192.168.1.2

  4. #4
    Join Date
    Aug 2008
    Beans
    13
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Apache includes

    Here's what I do. I have several websites on my servers.

    <VirtualHost <HostAddr or HostName>:80>
    ServerName www.mydomain.com
    ServerAlias mydomain.com *.mydomain.com
    CustomLog /var/log/apache2/mydomain.log common
    <Directory />
    Options None +FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>
    DocumentRoot /var/www/hosts/mydomain
    </VirtualHost>

    Hope this helps.

  5. #5
    Join Date
    Apr 2006
    Beans
    127

    Re: Apache includes

    yes it did help.

    Is it possible to put these config into .htaccess file

  6. #6
    Join Date
    Aug 2008
    Beans
    13
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Apache includes

    I don't believe so.. Apache needs to know what to do upon startup and what Vhosts are available.

  7. #7
    Join Date
    Jan 2006
    Location
    United Kingdom
    Beans
    2,787
    Distro
    Kubuntu 6.06 Dapper

    Re: Apache includes

    Quote Originally Posted by OOzypal View Post
    Yea but what should I put instead my IP address 192.168.1.2
    Replace it with a wildcard (*) unless you have a specific reason to bind it to one, and only one, address.

    Note that your NameVirtualHost and VirtualHost directives should match.

    Mathew
    Last edited by MJN; November 26th, 2008 at 12:49 PM. Reason: Added directive match advisory
    www.NewtonNet.co.uk - Now supporting IPv6!

    ~ Please don't use PM's to request assistance - post your query on the forum and share the discussion - if you've got a problem chances are you won't be the only one! ~

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
  •