logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Setting up vhosts in my conf file
Author
AldoTheApache



Joined: 15 Mar 2013
Posts: 3
Location: United States

PostPosted: Fri 15 Mar '13 16:37    Post subject: Setting up vhosts in my conf file Reply with quote

Ok, so I work for a start up as well as do independent consulting. I had a friend set up my apache server initially for the start up. It's been running fine. Now I want to host a client's site on the same server. I tired just adding a vhost section at the bottom of the conf file, but it said that I was running two sites off the same port. I tried manipulating the stuff my buddy did for me for the first site, then putting two vhosts on the bottom, but that just didn't work. Any tips? What else should I post to get the best possible answer?

Thanks guys!
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Fri 15 Mar '13 16:41    Post subject: Reply with quote

Assuming you are running 2.4.x ?

For info to setup look first at http://httpd.apache.org/docs/2.4/vhosts/
Back to top
AldoTheApache



Joined: 15 Mar 2013
Posts: 3
Location: United States

PostPosted: Fri 15 Mar '13 16:49    Post subject: Reply with quote

I think it is 2.4.x? I am very new to Apache, clearly. I just used yum to download the most recent versions of my LAMP stack. I feel like I have tried all the tutorials and they aren't helping much. Ok, so my conf file has commented out sections 1-3. The 2nd one is for, like, a master server? and the 3rd is for virtual hosts? Right now, site A is running off things typed in the 2nd section. I think I want them both running as vhosts in the 3rd section? I want them to be name-based off the same IP, obviously.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Mon 18 Mar '13 16:13    Post subject: Reply with quote

which OS do you run? Redhat x? Fedora? Usualy you can find your version by

/usr/sbin/httpd -V

or what the path to httpd is. Maybe the name is apache or apache2
Back to top
AldoTheApache



Joined: 15 Mar 2013
Posts: 3
Location: United States

PostPosted: Tue 19 Mar '13 0:04    Post subject: Reply with quote

im running fedora

Below is what I got from running that line.

____________________________________________________
root@.........# /usr/sbin/httpd -V
Server version: Apache/2.2.23 (Unix)
Server built: Jan 29 2013 12:37:40
Server's Module Magic Number: 20051115:31
Server loaded: APR 1.4.6, APR-Util 1.4.1
Compiled using: APR 1.4.6, APR-Util 1.4.1
Architecture: 32-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="/var/run/httpd/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="/var/run/httpd/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Tue 19 Mar '13 15:05    Post subject: Reply with quote

So you are using 2.2.23

example vhosts
Code:

NameVirtualHost *:80

<VirtualHost __default__:80>
    ServerAdmin info@localhost
    ServerName localhost
    DocumentRoot /var/www/localhost
    <Directory /var/www/localhost>
        Options FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    ErrorLog /var/logs/localhost_error.log
    LogLevel warn

    CustomLog /var/logs/localhostaccess.log combined
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin info@firstdomain.com
    ServerName firstdomain.com
   ServerAlias www.firstdomain.com
    DocumentRoot /var/www/firstdomain
    <Directory /var/www/firstdomain>
        Options FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    ErrorLog /var/logs/firstdomain_error.log
    LogLevel warn

    CustomLog /var/logs/firstdomain_access.log combined
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin info@seconddomain.com
    ServerName seconddomain.com
   ServerAlias www.seconddomain.com
    DocumentRoot /var//www/seconddomain
    <Directory /var/www/seconddomain>
        Options FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    ErrorLog /var/logs/seconddomain_error.log
    LogLevel warn

    CustomLog /var/logs/seconddomain_access.log combined
</VirtualHost>
Back to top


Reply to topic   Topic: Setting up vhosts in my conf file View previous topic :: View next topic
Post new topic   Forum Index -> Apache