?
Solved

location of virtual domains/directories on apache web server( Red Hat 7.2)

Posted on 2004-10-14
14
Medium Priority
?
275 Views
Last Modified: 2013-12-16
Hi Experts,
We have been providing web-hosting support to few of our clients and I was trying to locate the server name and document root  in Virtual Hosts section of httpd.conf file and couldn't find anything. However, the default path for all existing virtual domains is set to /usr/local/apache/htdocs. Is there any other location where the settings for Virtual Domains be stored ? Actually, I want to add  one client and delete the services for one existing account and  so, in a fix ...
0
Comment
Question by:mn210
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
14 Comments
 
LVL 6

Expert Comment

by:blkline
ID: 12310887
<VirtualHost 192.168.1.20:80>
        ServerAdmin root@localhost
        DocumentRoot "/var/www/doc"    <-------------    this line contains the document root
        ServerName doc.mydomain.net     <-------------    this line contains the server name
        ServerAlias doc                                 <-------------    this line is basically an "a.k.a"
        ErrorLog logs/doc.mydomain-error_log
        CustomLog logs/doc.mydomain-access_log common
        <Files "*.docmgr">
                Order allow,deny
                Deny from all
        </Files>
</VirtualHost>
0
 
LVL 7

Expert Comment

by:troopern
ID: 12328261
Is your V-Hosts in your httpd.conf or in a vhosts.conf file ?
0
 

Author Comment

by:mn210
ID: 12339759
I have checked the contents of  httpd.conf file and there is no entry for V-Hosts . Moreover, I have  checked the /etc/httpd/conf directory and all /etc directory and couldn't find vhosts.conf file.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:blkline
ID: 12340711
I think he meant VirtualHost.

Do you have anything in /etc/httpd/conf/httpd.conf that looks similar to what I posted?
0
 

Author Comment

by:mn210
ID: 12341607
Below is the segment of Virtual Host section of httpd.conf file :
 ------------------------------------------------------------------------------
#NameVirtualHost *

#
# VirtualHost example:

# Use name-based virtual hosting.
#
#NameVirtualHost *
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

#<VirtualHost _default_:*>
#</VirtualHost>
-------------------
SSLLog      logs/ssl_engine_log
SSLLogLevel error

</IfModule>

<IfDefine HAVE_SSL>

##
## SSL Virtual Host Context
##

<VirtualHost _default_:443>

#  General setup for the virtual host
#DocumentRoot "/etc/httpd/htdocs"
#ServerName new.host.name
#ServerAdmin you@your.address
ErrorLog logs/error_log
TransferLog logs/access_log
-----------------------------------------------------------------------------------------
0
 
LVL 6

Expert Comment

by:blkline
ID: 12341746
And you currently are hosting multiple domains?  What you have here definitely does not specify virtual domains.

What does this command return?

ls -l /etc/httpd/conf.d/
0
 
LVL 6

Expert Comment

by:blkline
ID: 12341765
Also, please post the following:

grep "<VirtualHost" /etc/httpd/conf/httpd.conf
0
 

Author Comment

by:mn210
ID: 12342294
Yeah ! We are currently hosting three domains.

Here is the output  of the commands -
[shar@abc /etc]$ ls -l /etc/httpd/conf.d/
ls: /etc/httpd/conf.d/: No such file or directory
-------------------------
[shar@abc /etc]$ grep "<VirtualHost" /etc/httpd/conf/httpd.conf
# ports, in addition to the default. See also the <VirtualHost>
# See also the <VirtualHost> and Listen directives.
# <VirtualHost> definition.  These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
# All of these directives may appear inside <VirtualHost> containers,
# If you do not specify an ErrorLog directive within a <VirtualHost>
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# If you do not define any access logfiles within a <VirtualHost>
# define per-<VirtualHost> access logfiles, transactions will be
#<VirtualHost *>
#<VirtualHost _default_:*>
<VirtualHost _default_:443>
______________________
0
 

Author Comment

by:mn210
ID: 12434667
Still looking for help ....
0
 
LVL 6

Expert Comment

by:blkline
ID: 12434945
I was on vacation for a week and have been playing catch up... sorry for the delay.  

Would you be willing to post your httpd.conf file?  Use this command to strip out most of the junk:

cat /etc/httpd/conf/httpd.conf | sed -e '/^[ \t]*#/d' -e '/^$/d' > post_this.file

Also, please do:

ls -l /etc/httpd/conf.d

If you don't want to post this directly to the list then send just the httpd.conf file to:

   blkline at attglobal dot net  

and I'll post the salient points of it back with the answer... if I can find it in what you have provided.
0
 

Author Comment

by:mn210
ID: 12436841
As per your suggestion , I sent the httpd.conf file at your email address.
Further, I want to delete the account (web-hosting) for one of our clients? Can you please walk me thr' the steps  ?
0
 
LVL 6

Expert Comment

by:blkline
ID: 12436884
Got your file and there isn't anything in there to define your virtual hosts.  Which leads me to believe that the config file is elsewhere.  Please post the results of the following commands  (as root):

ps uxwwa

and

locate httpd.conf
0
 

Author Comment

by:mn210
ID: 12437697
Thanks a lot , it worked !!!
I got the location of httpd.conf and it  is /usr/local/apache/conf directory and also got Virtual Host domains.

Further, I want to delete the account (web-hosting) for one of our clients? Can you please walk me thr' the steps  ?
0
 
LVL 6

Accepted Solution

by:
blkline earned 1000 total points
ID: 12437908
That's pretty simple:

Locate the document root for the client.  You'll want to delete that directory.
Delete all of the contents of the .conf file between <VirtualHost> and </VirtualHost>
Delete logs, if they are specific to that domain.
Remove the client's domain from your DNS, wherever that happens to be.
Restart httpd.

 <VirtualHost 192.168.1.20:80>
        ServerAdmin root@localhost
        DocumentRoot "/var/www/doc"    <-------------    this line contains the document root
        ServerName doc.mydomain.net     <-------------    this line contains the server name
        ServerAlias doc                                 <-------------    this line is basically an "a.k.a"
        ErrorLog logs/doc.mydomain-error_log
        CustomLog logs/doc.mydomain-access_log common
        <Files "*.docmgr">
                Order allow,deny
                Deny from all
        </Files>
</VirtualHost>
0

Featured Post

CHALLENGE LAB: Troubleshooting Connectivity Issues

Goal: Fix the connectivity issue in the lab's AWS environment so that you can SSH into the provided EC2 instance.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month10 days, 14 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question