Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
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.
| |
|
Topic: Setting up vhosts in my conf file |
|
Author |
|
AldoTheApache
Joined: 15 Mar 2013 Posts: 3 Location: United States
|
Posted: Fri 15 Mar '13 16:37 Post subject: Setting up vhosts in my conf file |
|
|
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
|
|
Back to top |
|
AldoTheApache
Joined: 15 Mar 2013 Posts: 3 Location: United States
|
Posted: Fri 15 Mar '13 16:49 Post subject: |
|
|
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
|
Posted: Mon 18 Mar '13 16:13 Post subject: |
|
|
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
|
Posted: Tue 19 Mar '13 0:04 Post subject: |
|
|
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
|
Posted: Tue 19 Mar '13 15:05 Post subject: |
|
|
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 |
|
|
|
|
|
|